diff options
| author | Jubilee <workingjubilee@gmail.com> | 2025-01-14 19:56:33 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-14 19:56:33 -0800 |
| commit | 11ac57af6e22be046bda763aecf452355633a618 (patch) | |
| tree | bfcca59c665e582f77fb8c2e1e50df0101e7188a /compiler/rustc_codegen_gcc/example/std_example.rs | |
| parent | 7c85da900335cc9e1d40605e2b52f62b433ed7b5 (diff) | |
| parent | 2743df848b0970ad9d97b6ce8222d4fd64898b61 (diff) | |
| download | rust-11ac57af6e22be046bda763aecf452355633a618.tar.gz rust-11ac57af6e22be046bda763aecf452355633a618.zip | |
Rollup merge of #135423 - compiler-errors:enforce-const-trait-syntactical, r=oli-obk,RalfJung
Enforce syntactical stability of const traits in HIR This PR enforces what I'm calling *syntactical* const stability of traits. In other words, it enforces the ability to name `~const`/`const` traits in trait bounds in various syntax positions in HIR (including in the trait of an impl header). This functionality is analogous to the *regular* item stability checker, which is concerned with making sure that you cannot refer to unstable items by name, and is implemented as an extension of that pass. This is separate from enforcing the *recursive* const stability of const trait methods, which is implemented in MIR and runs on MIR bodies. That will require adding a new `NonConstOp` to the const checker and probably adjusting some logic to deduplicate redundant errors. However, this check is separate and necessary for making sure that users don't add `~const`/`const` bounds to items when the trait is not const-stable in the first place. I chose to separate enforcing recursive const stability out of this PR to make it easier to review. I'll probably open a follow-up following this one, blocked on this PR. r? `@RalfJung` cc `@rust-lang/project-const-traits`
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/std_example.rs')
0 files changed, 0 insertions, 0 deletions
