2020-10-28 08:45:21 -05:00
|
|
|
// 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()
|
2020-12-19 07:50:45 -06:00
|
|
|
#![allow(clippy::upper_case_acronyms)]
|
2020-10-28 08:45:21 -05:00
|
|
|
|
|
|
|
trait TT {}
|
|
|
|
|
|
|
|
impl dyn TT {
|
|
|
|
fn func(&self) {}
|
|
|
|
}
|
|
|
|
|
2021-03-01 11:53:33 -06:00
|
|
|
#[rustfmt::skip]
|
2020-10-28 08:45:21 -05:00
|
|
|
fn main() {
|
|
|
|
let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types
|
|
|
|
//[nll]~^ ERROR: borrowed data escapes outside of closure
|
|
|
|
}
|