]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/crashes/ice-6256.rs
Rollup merge of #78769 - est31:remove_lifetimes, r=KodrAus
[rust.git] / src / tools / clippy / tests / ui / crashes / ice-6256.rs
1 // originally from rustc ./src/test/ui/regions/issue-78262.rs
2 // ICE: to get the signature of a closure, use substs.as_closure().sig() not fn_sig()
3
4 trait TT {}
5
6 impl dyn TT {
7     fn func(&self) {}
8 }
9
10 fn main() {
11     let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types
12                                    //[nll]~^ ERROR: borrowed data escapes outside of closure
13 }