You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code compiles with no warning or error:
enum x {}
enum y { x }
fn main() {}
However if the positions of the enums are reversed then the compile fails with a (I think bogus) error message:
enum y { x }
enum x {}
fn main() {}
The error message is:
test.rs:5:0: 5:9 error: Duplicate definition of value x
test.rs:5 enum x {}
^~~~~~~~~
test.rs:3:9: 3:10 note: First definition of value x here:
test.rs:3 enum y { x }
^
error: aborting due to previous error
The text was updated successfully, but these errors were encountered:
…about an unknown `cfg`. (rust-lang#3187)
Starting with the 2024-05-05 toolchain (and the upcoming Rust 1.80
release), the `unexpected_cfgs` lint has been turned on by default. As a
result, running `cargo kani` on a crate that has a `#[cfg(kani)]`
results in a warning (see rust-lang#3186). To avoid this warning, this PR adds
`--check-cfg=cfg(kani)` to `RUSTFLAGS` when Kani invokes `cargo`.
Call-outs: On such packages, doing a `cargo build` will also result in
this warning, unless:
```rust
println!("cargo::rustc-check-cfg=cfg(kani)");
```
is added to the package's `build.rs` file. However, this warning would
only occur with `cargo build` if the package uses the 2024-05-05
toolchain (or newer), or the Rust version used in the package is
upgraded to 1.80 (when it's released at the end of July 2024). Since
we're likely to release a new version of Kani sooner than the 1.80
release, this PR mitigates the issue that is more likely to impact users
(a warning from `cargo kani`).
Resolvesrust-lang#3186
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
The following code compiles with no warning or error:
However if the positions of the enums are reversed then the compile fails with a (I think bogus) error message:
The error message is:
The text was updated successfully, but these errors were encountered: