-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
seemingly incorrect nontrivial_structural_match warning #110508
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
A-MIR
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
A-patterns
Relating to patterns and pattern matching
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Strange... Given:
The MIR we generate for either associated const is quite different...
🤔 |
jyn514
added
A-MIR
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
A-patterns
Relating to patterns and pattern matching
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Apr 20, 2023
I'd like to take a swing at this |
@rustbot claim |
@compiler-errors I looked at the thir generated for your program #[derive(PartialEq, Eq)]
pub enum Thing { Foo(bool), Bar(Vec<()>) }
impl Thing {
pub const FOO: Thing = Thing::Foo(true);
pub const BAR: Thing = Self::Foo(true);
}
fn main() {} and |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jul 8, 2023
…-ctor-to-adt, r=cjgillot resolve typerelative ctors to adt Associated issue: rust-lang#110508 r? `@spastorino`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jul 8, 2023
…-ctor-to-adt, r=cjgillot resolve typerelative ctors to adt Associated issue: rust-lang#110508 r? ``@spastorino``
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
A-MIR
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
A-patterns
Relating to patterns and pattern matching
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
For the following code, I get a compiler warning:
Playground link
And the warning:
What makes me think this warning is incorrect is that the constant's initializer does not produce the
Vec
-containing variant like the warning suggests, and changingSelf::
toThing::
in the initializer resolves the error despite those (afaik) being equivalent.The text was updated successfully, but these errors were encountered: