STR
#![cfg_attr(not(works), feature(nll))]
struct A<'a>(&'a ());
trait Y {
const X: i32;
}
impl Y for A<'static> {
const X: i32 = 10;
}
fn foo<'a>(x: i32) {
match x {
// this uses <A<'a> as Y>::X, but `A<'a>` does not implement `Y`
A::<'a>::X..=A::<'static>::X => (),
_ => (),
}
}
fn bar<'a>(x: i32) {
match x {
// this uses <A<'a> as Y>::X, but `A<'a>` does not implement `Y`
A::<'static>::X..=A::<'a>::X => (),
_ => (),
}
}
Tested on nightly 1.34, but should be present on other versions
Expected Result
Code behaves as with AST, causing an error because A::<'a> does not implement Y (only A<'static> does).
Actual Result
Code compiles.
STR
Tested on nightly 1.34, but should be present on other versions
Expected Result
Code behaves as with AST, causing an error because
A::<'a>does not implementY(onlyA<'static>does).Actual Result
Code compiles.