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

15 lines
419 B
Rust
Raw Normal View History

// 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 14:50:45 +01:00
#![allow(clippy::upper_case_acronyms)]
trait TT {}
impl dyn TT {
fn func(&self) {}
}
fn main() {
let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types
//[nll]~^ ERROR: borrowed data escapes outside of closure
}