diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-29861.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-29861.rs b/src/test/ui/issues/issue-29861.rs new file mode 100644 index 000000000..58f8eb536 --- /dev/null +++ b/src/test/ui/issues/issue-29861.rs @@ -0,0 +1,20 @@ +pub trait MakeRef<'a> { + type Ref; +} +impl<'a, T: 'a> MakeRef<'a> for T { + type Ref = &'a T; +} + +pub trait MakeRef2 { + type Ref2; +} +impl<'a, T: 'a> MakeRef2 for T { +//~^ ERROR the lifetime parameter `'a` is not constrained + type Ref2 = <T as MakeRef<'a>>::Ref; +} + +fn foo() -> <String as MakeRef2>::Ref2 { &String::from("foo") } + +fn main() { + println!("{}", foo()); +} |