Skip to content

Commit

Permalink
Rollup merge of rust-lang#5523 - phansch:add-new-ret-no-self-testcase…
Browse files Browse the repository at this point in the history
…, r=flip1995

Add lifetime test case for `new_ret_no_self`

cc rust-lang/rust-clippy#734 (comment)

changelog: none
  • Loading branch information
flip1995 committed Apr 25, 2020
2 parents abbc618 + bf73d51 commit 9b882ba
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/ui/new_ret_no_self.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!();
}
}

0 comments on commit 9b882ba

Please sign in to comment.