-
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
min_const_generic
takes precedence over const_generics
#76280
Comments
You are right rust/compiler/rustc_typeck/src/check/wfcheck.rs Lines 293 to 310 in 08deb86
But why would you want to use the two of them? |
I imagine this to happen whenever at first you only decide to use This could also perhaps get triggered in a more subtle way where you write a library that uses |
what do you think @lcnr ? |
It probably makes sense to instead check if we are not using |
Created a way to produce an error in case of incompatible features, like this one |
I have one question, how does using 'incompatible feature' cause maybe undefined behavior? Are there other incompatible features? In this case, wouldn't it be better to produce an error message like "feature(const_generics) is a superset of feature(min_const_generics)"? |
Note that: #[feature(const_generics)]
struct S<const I: usize>; results in a compile error:
So currently |
You are missing a |
Ah of course, my bad 😅 I was confused looking at some ui tests for const generics, and missed that those now have support differentiating between expected behavior under |
…, r=lcnr Implementation of incompatible features error Proposal of a new error: Incompatible features This error should happen if two features which are not compatible are used together. For now the only incompatible features are `const_generics` and `min_const_generics` fixes rust-lang#76280
…, r=lcnr Implementation of incompatible features error Proposal of a new error: Incompatible features This error should happen if two features which are not compatible are used together. For now the only incompatible features are `const_generics` and `min_const_generics` fixes rust-lang#76280
I expect the code below code to compile, but it fails.
const_generics
should allow more than just the types whitelisted inmin_const_generics
, but it seems rustc only looks at themin_const_generics
flag in this case.The error message is:
The text was updated successfully, but these errors were encountered: