Closed
Description
STR
#![feature(associated_consts)]
trait Foo {
type Bar;
}
#[cfg(not(works))]
trait Baz {
type Fv: Foo = u8;
const C: <Self::Fv as Foo>::Bar = 6665;
}
#[cfg(works)]
trait Baz {
type Fv: Foo = u8;
const C: <Self::Fv as Foo>::Bar;
}
Results
<anon>:9:15: 9:23 error: failed to resolve. Use of undeclared type or module `Self`
<anon>:9 const C: <Self::Fv as Foo>::Bar = 6665;
^~~~~~~~
<anon>:9:15: 9:23 error: use of `Self` outside of an impl or trait
<anon>:9 const C: <Self::Fv as Foo>::Bar = 6665;
^~~~~~~~
error: aborting due to 2 previous errors
Removing the default (#[cfg(works)]
) removes the error. cc @quantheory