diff options
Diffstat (limited to 'tests/ui/suggestions/return-without-lifetime.rs')
-rw-r--r-- | tests/ui/suggestions/return-without-lifetime.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/suggestions/return-without-lifetime.rs b/tests/ui/suggestions/return-without-lifetime.rs new file mode 100644 index 000000000..9bfce11be --- /dev/null +++ b/tests/ui/suggestions/return-without-lifetime.rs @@ -0,0 +1,10 @@ +struct Thing<'a>(&'a ()); +struct Foo<'a>(&usize); +//~^ ERROR missing lifetime specifier + +fn func1<'a>(_arg: &'a Thing) -> &() { unimplemented!() } +//~^ ERROR missing lifetime specifier +fn func2<'a>(_arg: &Thing<'a>) -> &() { unimplemented!() } +//~^ ERROR missing lifetime specifier + +fn main() {} |