diff options
| author | bors <bors@rust-lang.org> | 2022-10-20 03:07:17 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-10-20 03:07:17 +0000 |
| commit | ebdde35dced40adb46f8aad054fb2adb86b39427 (patch) | |
| tree | 948e9386989e7b398a996dc4d3a98bc75b6cad6a /src | |
| parent | cb9467515b5a9b15aaa905683c6b4dd9e851056c (diff) | |
| parent | 49ce8a22b05d779da4ffc531a44380656d51404b (diff) | |
| download | rust-ebdde35dced40adb46f8aad054fb2adb86b39427.tar.gz rust-ebdde35dced40adb46f8aad054fb2adb86b39427.zip | |
Auto merge of #103205 - spastorino:fix-rpits-lifetime-remapping, r=cjgillot
Do anonymous lifetimes remapping correctly for nested rpits Closes #103141 r? `@cjgillot` `@nikomatsakis` This fixes a stable to stable regression that in my opinion is `P-critical` so, we probably want to backport it all the way up to stable.
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/impl-trait/nested-rpit-with-anonymous-lifetimes.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/ui/impl-trait/nested-rpit-with-anonymous-lifetimes.rs b/src/test/ui/impl-trait/nested-rpit-with-anonymous-lifetimes.rs new file mode 100644 index 00000000000..287a030cf87 --- /dev/null +++ b/src/test/ui/impl-trait/nested-rpit-with-anonymous-lifetimes.rs @@ -0,0 +1,23 @@ +// check-pass + +pub struct VecNumber<'s> { + pub vec_number: Vec<Number<'s>>, + pub auxiliary_object: &'s Vec<usize>, +} + +pub struct Number<'s> { + pub number: &'s usize, +} + +impl<'s> VecNumber<'s> { + pub fn vec_number_iterable_per_item_in_auxiliary_object( + &self, + ) -> impl Iterator<Item = (&'s usize, impl Iterator<Item = &Number<'s>>)> { + self.auxiliary_object.iter().map(move |n| { + let iter_number = self.vec_number.iter(); + (n, iter_number) + }) + } +} + +fn main() {} |
