-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #103205 - spastorino:fix-rpits-lifetime-remapping, r=cj…
…gillot 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.
- Loading branch information
Showing
2 changed files
with
46 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/test/ui/impl-trait/nested-rpit-with-anonymous-lifetimes.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |