mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-30 15:03:36 +00:00
14 lines
380 B
Rust
14 lines
380 B
Rust
|
// originally from rustc ./src/test/ui/regions/issue-78262.rs
|
||
|
// ICE: to get the signature of a closure, use substs.as_closure().sig() not fn_sig()
|
||
|
|
||
|
trait TT {}
|
||
|
|
||
|
impl dyn TT {
|
||
|
fn func(&self) {}
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types
|
||
|
//[nll]~^ ERROR: borrowed data escapes outside of closure
|
||
|
}
|