We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a2a432b + a7f61ca commit 0fd8709Copy full SHA for 0fd8709
tests/ui/impl-trait/rpit/inherits-lifetime.rs
@@ -0,0 +1,24 @@
1
+//! Check that lifetimes are inherited in RPIT.
2
+//! Previously, the hidden lifetime of T::Bar would be overlooked
3
+//! and would instead end up as <T as Foo<'static>>::Bar.
4
+//!
5
+//! Regression test for <https://github.com/rust-lang/rust/issues/51525>.
6
+
7
+//@ check-pass
8
9
+trait Foo<'a> {
10
+ type Bar;
11
+}
12
13
+impl<'a> Foo<'a> for u32 {
14
+ type Bar = &'a ();
15
16
17
+fn baz<'a, T>() -> impl IntoIterator<Item = T::Bar>
18
+where
19
+ T: Foo<'a>,
20
+{
21
+ None
22
23
24
+fn main() {}
0 commit comments