mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
23 lines
482 B
Rust
23 lines
482 B
Rust
// This was an ICE. See #110726.
|
|
|
|
//@ revisions: statik infer fixed
|
|
//@ [fixed] check-pass
|
|
#![allow(unconditional_recursion)]
|
|
|
|
fn foo<'a>() -> impl Sized + 'a {
|
|
#[cfg(statik)]
|
|
let i: i32 = foo::<'static>();
|
|
//[statik]~^ ERROR expected generic lifetime parameter, found `'static`
|
|
|
|
#[cfg(infer)]
|
|
let i: i32 = foo::<'_>();
|
|
//[infer]~^ ERROR expected generic lifetime parameter, found `'_`
|
|
|
|
#[cfg(fixed)]
|
|
let i: i32 = foo::<'a>();
|
|
|
|
i
|
|
}
|
|
|
|
fn main() {}
|