Skip to content

Add exception for loom cfg in rust 1.80-beta#3354

Merged
stevenengler merged 1 commit intoshadow:mainfrom
stevenengler:workspace-lints
Jun 12, 2024
Merged

Add exception for loom cfg in rust 1.80-beta#3354
stevenengler merged 1 commit intoshadow:mainfrom
stevenengler:workspace-lints

Conversation

@stevenengler
Copy link
Copy Markdown
Contributor

@stevenengler stevenengler commented Jun 12, 2024

This is in preparation for the upcoming changes in rust 1.80:

https://blog.rust-lang.org/2024/05/06/check-cfg.html

Rust 1.80 will likely be released before we publish another Shadow release (end of July), so I don't think it hurts to merge now.

Fixes around 40 warnings of the form:

warning: unexpected `cfg` condition name: `loom`
   --> lib/vasi-sync/src/sync.rs:163:15
    |
163 |     #[cfg(not(loom))]
    |               ^^^^
    |
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
             unexpected_cfgs = { level = "warn", check-cfg = ['cfg(loom)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(loom)");` to the top of the `build.rs`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

On old (including the current) rust versions, this commit causes:

warning: lib/vasi-sync/Cargo.toml: unused manifest key: lints.rust.unexpected_cfgs.check-cfg

@stevenengler stevenengler self-assigned this Jun 12, 2024
@github-actions github-actions bot added Component: Libraries Support functions like LD_PRELOAD and logging Component: Build Build/install tools and dependencies labels Jun 12, 2024
This is in preparation for the upcoming changes in rust 1.80:

https://blog.rust-lang.org/2024/05/06/check-cfg.html

Fixes around 40 warnings of the form:

```
warning: unexpected `cfg` condition name: `loom`
   --> lib/vasi-sync/src/sync.rs:163:15
    |
163 |     #[cfg(not(loom))]
    |               ^^^^
    |
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
             unexpected_cfgs = { level = "warn", check-cfg = ['cfg(loom)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(loom)");` to the top of the `build.rs`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
```

On old (including the current) rust versions, this commit causes:

```
warning: lib/vasi-sync/Cargo.toml: unused manifest key: lints.rust.unexpected_cfgs.check-cfg
```
@stevenengler stevenengler enabled auto-merge June 12, 2024 16:51
@stevenengler stevenengler merged commit 1f4b6b2 into shadow:main Jun 12, 2024
@stevenengler stevenengler deleted the workspace-lints branch June 12, 2024 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Build Build/install tools and dependencies Component: Libraries Support functions like LD_PRELOAD and logging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants