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
Metadata
Metadata
Assignees
Labels
Area: Associated items (types, constants & functions)Area: Type systemCategory: This is a bug.`#![feature(associated_type_defaults)]`Relevant to the compiler team, which will review and decide on the PR/issue.Relevant to the language team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.