-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Require that const param tys implement ConstParamTy
#111670
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
tests/ui/const-generics/forbid-non-structural_match-types.stderr
Outdated
Show resolved
Hide resolved
@@ -8,10 +8,10 @@ struct CompileTimeSettings{ | |||
} | |||
|
|||
struct Foo<const T: CompileTimeSettings>; | |||
//~^ ERROR using function pointers as const generic parameters is forbidden | |||
//~^ ERROR `CompileTimeSettings` must be annotated with `#[derive(ConstParamTy)]` to be used as the type of a const generic parameter |
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.
This is an example of the fixme I left above:
// We should probably see if we're allowed to derive
ConstParamTy
on the type...
Since the user will follow the advice from the error message, then see an error message that &'static [fn()]
is a bad field.
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #111671) made this pull request unmergeable. Please resolve the merge conflicts. |
8a9cb03
to
57f7198
Compare
This comment has been minimized.
This comment has been minimized.
See rust-lang#111670 (comment) Thanks @Nilstrieb for the pointer :)
This comment has been minimized.
This comment has been minimized.
74372fc
to
7ce024f
Compare
This comment has been minimized.
This comment has been minimized.
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
…r=Nilstrieb Fix doc comment for `ConstParamTy` derive See rust-lang#111670 (comment) Thanks `@Nilstrieb` for the pointer :)
…r=Nilstrieb Fix doc comment for `ConstParamTy` derive See rust-lang#111670 (comment) Thanks ``@Nilstrieb`` for the pointer :)
…r=Nilstrieb Fix doc comment for `ConstParamTy` derive See rust-lang#111670 (comment) Thanks ```@Nilstrieb``` for the pointer :)
98bb09f
to
ba2a598
Compare
This comment has been minimized.
This comment has been minimized.
…r=Nilstrieb Fix doc comment for `ConstParamTy` derive See rust-lang#111670 (comment) Thanks ````@Nilstrieb```` for the pointer :)
ba2a598
to
a0ab416
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #110204) made this pull request unmergeable. Please resolve the merge conflicts. |
⌛ Testing commit 6aa1a3538743bd63d04813d8ea29dda6253b06ad with merge 72916f6114413f1ba881c8080c3757b5a0b012a2... |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
bootstrap started using the newest beta which has waffle's PR to add compiler checks to |
6aa1a35
to
97bacba
Compare
I @bors r=BoxyUwU |
…mpiler-errors Rollup of 7 pull requests Successful merges: - rust-lang#111670 (Require that const param tys implement `ConstParamTy`) - rust-lang#111914 (CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…) - rust-lang#112030 (Migrate `item_trait_alias` to Askama) - rust-lang#112150 (Support 128-bit atomics on all x86_64 Apple targets) - rust-lang#112174 (Fix broken link) - rust-lang#112190 (Improve comments on `TyCtxt` and `GlobalCtxt`.) - rust-lang#112193 (Check tuple elements are `Sized` in `offset_of`) Failed merges: - rust-lang#112071 (Group rfcs tests) r? `@ghost` `@rustbot` modify labels: rollup
…mpiler-errors Rollup of 7 pull requests Successful merges: - rust-lang#111670 (Require that const param tys implement `ConstParamTy`) - rust-lang#111914 (CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…) - rust-lang#112030 (Migrate `item_trait_alias` to Askama) - rust-lang#112150 (Support 128-bit atomics on all x86_64 Apple targets) - rust-lang#112174 (Fix broken link) - rust-lang#112190 (Improve comments on `TyCtxt` and `GlobalCtxt`.) - rust-lang#112193 (Check tuple elements are `Sized` in `offset_of`) Failed merges: - rust-lang#112071 (Group rfcs tests) r? `@ghost` `@rustbot` modify labels: rollup
See rust-lang/rust#111670 (comment) Thanks @Nilstrieb for the pointer :)
Fix doc comment for `ConstParamTy` derive See rust-lang/rust#111670 (comment) Thanks ````@Nilstrieb```` for the pointer :)
ConstParamTy
instead of usingsearch_for_adt_const_param_violation
StructuralPartialEq
as a supertrait forConstParamTy
, since we need to make sure that we derive bothPartialEq
andEq
ConstParamTy
for tuples up to 12 (or whatever the default for tuples is)ConstParamTy
errors, to avoid regressions from (1.). It's still not as great as it could be -- will point out inline in comments.r? @BoxyUwU