diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-10-27 17:24:38 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-10-27 19:04:48 +0000 |
| commit | cb1e7d96767525fde3965f86bace8a5acf0dc643 (patch) | |
| tree | 6f51e4935239e14888abc4f78f91c13676886b6a /src/test/ui/lifetimes | |
| parent | 47704bbcc063c2a8f3e88b06cf2f54f6b64b5ae7 (diff) | |
Only ban duplication across parameters.
Diffstat (limited to 'src/test/ui/lifetimes')
| -rw-r--r-- | src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.rs b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.rs index ba769a4bcc0..d0a8fe795ef 100644 --- a/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.rs +++ b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.rs @@ -45,4 +45,7 @@ fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &isize { fn l<'a>(_: &'a str, _: &'a str) -> &str { "" } //~^ ERROR missing lifetime specifier +// This is ok because both `'a` are for the same parameter. +fn m<'a>(_: &'a Foo<'a>) -> &str { "" } + fn main() {} |
