rust/tests/ui/crashes/ice-6256.rs

16 lines
360 B
Rust
Raw Normal View History

// 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() {
2023-04-20 10:19:36 -05:00
let f = |x: &dyn TT| x.func();
//~^ ERROR: borrowed data escapes outside of closure
}