Skip to content

Commit c95b515

Browse files
committed
Fix clippy tests
1 parent d7f0bdd commit c95b515

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// originally from rustc ./tests/ui/regions/issue-78262.rs
2+
// ICE: to get the signature of a closure, use args.as_closure().sig() not fn_sig()
3+
#![allow(clippy::upper_case_acronyms)]
4+
5+
trait TT {}
6+
7+
impl dyn TT + '_ {
8+
fn func(&self) {}
9+
}
10+
11+
#[rustfmt::skip]
12+
fn main() {
13+
let f = |x: &dyn TT| x.func();
14+
//~^ ERROR: borrowed data escapes outside of closure
15+
}

src/tools/clippy/tests/ui/crashes/ice-6256.stderr

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ LL | let f = |x: &dyn TT| x.func();
88
| | | argument requires that `'1` must outlive `'static`
99
| | let's call the lifetime of this reference `'1`
1010
| `x` is a reference that is only valid in the closure body
11+
|
12+
help: consider relaxing the implicit `'static` requirement on the impl
13+
|
14+
LL | impl dyn TT + '_ {
15+
| ++++
1116

1217
error: aborting due to 1 previous error
1318

0 commit comments

Comments
 (0)