rust/tests/crashes/125992.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
326 B
Rust
Raw Normal View History

2024-06-08 11:36:21 -05:00
//@ known-bug: rust-lang/rust#125992
//@ compile-flags: -Zpolonius=next
#![feature(inherent_associated_types)]
type Function = for<'a> fn(&'a i32) -> S<'a>::P;
struct S<'a>(&'a ());
impl<'a> S {
type P = &'a i32;
}
fn ret_ref_local<'e>() -> &'e i32 {
let f: Function = |x| x;
let local = 0;
f(&local)
}