rust/tests/ui/nll/user-annotations/inherent-associated-constants.rs

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

16 lines
248 B
Rust
Raw Normal View History

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() {}