diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-06-25 18:02:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-25 18:02:58 +0200 |
| commit | 8b72058985391c2592de3b514f802f4e58e13d38 (patch) | |
| tree | 2167978c3eb3f881d90dc7c6588918064d90a1b8 /compiler/rustc_ast_lowering/messages.ftl | |
| parent | 2724aeaaeb127a8073e39461caacbe21a128ce7b (diff) | |
| parent | 6521c3971d0818ab37f27f36f2eb99de420c780f (diff) | |
| download | rust-8b72058985391c2592de3b514f802f4e58e13d38.tar.gz rust-8b72058985391c2592de3b514f802f4e58e13d38.zip | |
Rollup merge of #126746 - compiler-errors:no-rpitit, r=oli-obk
Deny `use<>` for RPITITs Precise capturing `use<>` syntax is currently a no-op on RPITITs, since GATs have no variance, so all captured lifetimes are captured invariantly. We don't currently *need* to support `use<>` on RPITITs, since `use<>` is initially intended for migrating RPIT *overcaptures* from edition 2021->2024, but since RPITITs currently capture all in-scope lifetimes, we'll never need to write `use<>` on an RPITIT. Eventually, though, it would be desirable to support precise capturing on RPITITs, since RPITITs overcapturing by default can be annoying to some folks. But let's separate that (which will likely require some delicate types team work for adding variances to GATs and adjusting the refinement rules) from the stabilization of the feature for edition 2024. r? oli-obk cc ``@traviscross`` Tracking: - https://github.com/rust-lang/rust/issues/123432
Diffstat (limited to 'compiler/rustc_ast_lowering/messages.ftl')
| -rw-r--r-- | compiler/rustc_ast_lowering/messages.ftl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_ast_lowering/messages.ftl b/compiler/rustc_ast_lowering/messages.ftl index 52164d6ef16..58f65f1257f 100644 --- a/compiler/rustc_ast_lowering/messages.ftl +++ b/compiler/rustc_ast_lowering/messages.ftl @@ -130,6 +130,9 @@ ast_lowering_never_pattern_with_guard = ast_lowering_no_precise_captures_on_apit = `use<...>` precise capturing syntax not allowed in argument-position `impl Trait` +ast_lowering_no_precise_captures_on_rpitit = `use<...>` precise capturing syntax is currently not allowed in return-position `impl Trait` in traits + .note = currently, return-position `impl Trait` in traits and trait implementations capture all lifetimes in scope + ast_lowering_previously_used_here = previously used here ast_lowering_register1 = register `{$reg1_name}` |
