Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bogus duplicate definition of value error #3186

Closed
Dretch opened this issue Aug 12, 2012 · 2 comments
Closed

Bogus duplicate definition of value error #3186

Dretch opened this issue Aug 12, 2012 · 2 comments
Labels
A-resolve Area: Name resolution

Comments

@Dretch
Copy link
Contributor

Dretch commented Aug 12, 2012

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
@brson brson closed this as completed in 395d1ac Aug 13, 2012
@brson
Copy link
Contributor

brson commented Aug 13, 2012

Fixed.

@Dretch
Copy link
Contributor Author

Dretch commented Aug 14, 2012

Thanks!

On 13 August 2012 23:19, Brian Anderson [email protected] wrote:

Fixed.


Reply to this email directly or view it on GitHubhttps://github.com//issues/3186#issuecomment-7710120.

bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
Update `rustc-ap-*` crates to 290.0.0.
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
…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`).

Resolves rust-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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name resolution
Projects
None yet
Development

No branches or pull requests

2 participants