summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/crashes/ice-6256.rs
blob: f9ee3e058c111470ba38775b7780044ae245e75e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// originally from rustc ./tests/ui/regions/issue-78262.rs
// ICE: to get the signature of a closure, use substs.as_closure().sig() not fn_sig()
#![allow(clippy::upper_case_acronyms)]

trait TT {}

impl dyn TT {
    fn func(&self) {}
}

#[rustfmt::skip]
fn main() {
    let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types
                                   //[nll]~^ ERROR: borrowed data escapes outside of closure
}