Skip to content

Commit 9b882ba

Browse files
authored
Rollup merge of rust-lang#5523 - phansch:add-new-ret-no-self-testcase, r=flip1995
Add lifetime test case for `new_ret_no_self` cc rust-lang/rust-clippy#734 (comment) changelog: none
2 parents abbc618 + bf73d51 commit 9b882ba

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/ui/new_ret_no_self.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,14 @@ impl NestedReturnerOk3 {
199199
unimplemented!();
200200
}
201201
}
202+
203+
struct WithLifetime<'a> {
204+
cat: &'a str,
205+
}
206+
207+
impl<'a> WithLifetime<'a> {
208+
// should not trigger the lint, because the lifetimes are different
209+
pub fn new<'b: 'a>(s: &'b str) -> WithLifetime<'b> {
210+
unimplemented!();
211+
}
212+
}

0 commit comments

Comments
 (0)