2023-01-05 02:45:44 -06:00
|
|
|
// originally from rustc ./tests/ui/regions/issue-78262.rs
|
2020-11-05 07:29:48 -06:00
|
|
|
// ICE: to get the signature of a closure, use substs.as_closure().sig() not fn_sig()
|
2021-01-30 11:06:34 -06:00
|
|
|
#![allow(clippy::upper_case_acronyms)]
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
trait TT {}
|
|
|
|
|
|
|
|
impl dyn TT {
|
|
|
|
fn func(&self) {}
|
|
|
|
}
|
|
|
|
|
2021-03-12 08:30:50 -06:00
|
|
|
#[rustfmt::skip]
|
2020-11-05 07:29:48 -06:00
|
|
|
fn main() {
|
|
|
|
let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types
|
|
|
|
//[nll]~^ ERROR: borrowed data escapes outside of closure
|
|
|
|
}
|