about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-10-10 22:00:48 +0200
committerGitHub <noreply@github.com>2024-10-10 22:00:48 +0200
commit4f2af123ebf687888e2003676f6d7ae79f811640 (patch)
tree6384112aa5ad2e75b5bac058572e68a69b13b285 /compiler/rustc_codegen_llvm/src
parentedb669350a59ce48586152cf87b1d1f2841cea62 (diff)
parent322c4bdac595e7689dcf08b847d0bd4d82a4bad9 (diff)
downloadrust-4f2af123ebf687888e2003676f6d7ae79f811640.tar.gz
rust-4f2af123ebf687888e2003676f6d7ae79f811640.zip
Rollup merge of #131033 - compiler-errors:precise-capturing-in-traits, r=spastorino
Precise capturing in traits

This PR begins to implement `feature(precise_capturing_in_traits)`, which enables using the `impl Trait + use<..>` syntax for RPITITs. It implements this by giving the desugared GATs variance, and representing the uncaptured lifetimes as bivariant, like how opaque captures work.

Right now, I've left out implementing a necessary extension to the `refining_impl_trait` lint, and also I've made it so that all RPITITs always capture the parameters that come from the trait, because I'm not totally yet convinced that it's sound to not capture these args. It's certainly required to capture the type and const parameters from the trait (e.g. Self), or else users could bivariantly relate two RPITIT args that come from different impls, but region parameters don't affect trait selection in the same way, so it *may* be possible to relax this in the future. Let's stay conservative for now, though.

I'm not totally sure what tests could be added on top of the ones I already added, since we really don't need to exercise the `precise_capturing` feature but simply what makes it special for RPITITs.

r? types

Tracking issue:
* #130044
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions