Add lifetime test case for `new_ret_no_self`

This commit is contained in:
Philipp Hansch 2020-04-25 10:43:41 +02:00
parent 02c94352d4
commit bf73d51959
No known key found for this signature in database
GPG Key ID: 2B4399C4BF4DCBDE
1 changed files with 11 additions and 0 deletions

View File

@ -199,3 +199,14 @@ impl NestedReturnerOk3 {
unimplemented!();
}
}
struct WithLifetime<'a> {
cat: &'a str,
}
impl<'a> WithLifetime<'a> {
// should not trigger the lint, because the lifetimes are different
pub fn new<'b: 'a>(s: &'b str) -> WithLifetime<'b> {
unimplemented!();
}
}