mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 11:34:11 +00:00
16 lines
248 B
Rust
16 lines
248 B
Rust
struct A<'a>(&'a ());
|
|
|
|
impl A<'static> {
|
|
const IC: i32 = 10;
|
|
}
|
|
|
|
fn non_wf_associated_const<'a>(x: i32) {
|
|
A::<'a>::IC; //~ ERROR lifetime may not live long enough
|
|
}
|
|
|
|
fn wf_associated_const<'a>(x: i32) {
|
|
A::<'static>::IC;
|
|
}
|
|
|
|
fn main() {}
|