-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Migrate UnsizedConstParamTy to unstable impl of ConstParamTy_
#145095
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
Conversation
This comment has been minimized.
This comment has been minimized.
a4bd0a8 to
262cf11
Compare
|
Currently all tests in |
|
☔ The latest upstream changes (presumably #145773) made this pull request unmergeable. Please resolve the merge conflicts. |
tests/ui/const-generics/generic_const_parameter_types/check-type-in-mir.stderr
Show resolved
Hide resolved
| error[E0741]: `Bar` must implement `ConstParamTy` to be used as the type of a const generic parameter | ||
| --> $DIR/feature-gate-unsized-const-params.rs:5:21 | ||
| | | ||
| LL | struct Foo<const N: [u8]>; | ||
| | ^^^^ | ||
| LL | struct Foo<const N: Bar>; | ||
| | ^^^ | ||
| | | ||
| = note: the only supported types are integers, `bool`, and `char` | ||
| help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types | ||
| help: add `#[derive(ConstParamTy, PartialEq, Eq)]` to the struct | ||
| | | ||
| LL + #![feature(adt_const_params)] | ||
| | | ||
| help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait | ||
| | | ||
| LL + #![feature(unsized_const_params)] | ||
| LL - struct Bar(u8); | ||
| LL + #[derive(ConstParamTy, PartialEq, Eq)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggestion here is a bit weird,
LL - struct Bar(u8);
LL + #[derive(ConstParamTy, PartialEq, Eq)]but feels like a pre-existing issue, can take a look at this after tihs PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fascinating I wonder what's going on here
8d88452 to
1f70531
Compare
This comment has been minimized.
This comment has been minimized.
…with #[unstable_feature_bound(unsized_const_params)]
379e7ea to
1c30399
Compare
| LL | struct A([u8]); | ||
| | ---- this field does not implement `ConstParamTy_` | ||
| | | ||
| note: the `ConstParamTy_` impl for `[u8]` requires that `unstable feature: `unsized_const_params`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably make the diagnostic for unsatisfied UnstableFeature clauses be worded a bit nicer. different PR though
|
@bors r+ thanks gamer :3 very cool |
Now that we have
#[unstable_feature_bound], we can removeUnsizedConstParamTythat was meant to be an unstable impl of stable type andConstParamTy_trait.r? @BoxyUwU