diff options
Diffstat (limited to 'tests/ui/impl-trait/multiple-lifetimes')
-rw-r--r-- | tests/ui/impl-trait/multiple-lifetimes/multiple-lifetimes.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/multiple-lifetimes/multiple-lifetimes.rs b/tests/ui/impl-trait/multiple-lifetimes/multiple-lifetimes.rs new file mode 100644 index 000000000..5407fb6dd --- /dev/null +++ b/tests/ui/impl-trait/multiple-lifetimes/multiple-lifetimes.rs @@ -0,0 +1,12 @@ +// Test that multiple lifetimes are allowed in impl trait types. +// build-pass (FIXME(62277): could be check-pass?) + +trait X<'x>: Sized {} + +impl<U> X<'_> for U {} + +fn multiple_lifeteimes<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl X<'b> + 'a { + x +} + +fn main() {} |