Closed
Description
main.rs:
#![feature(associated_consts)]
struct Foo;
impl Foo {
const SUP: &'static str = "sup";
}
use Foo::SUP;
fn main() {
let sup = SUP;
assert_eq!(sup, Foo::SUP);
}
rustc:
error: unresolved import `Foo::SUP`. Not a module `Foo` [--explain E0432]
--> <anon>:8:5
8 |> use Foo::SUP;
|> ^^^^^^^^
error: aborting due to previous error
I'm not sure if this is specifically not intended, but it seems to me that it would be convenient to mirror the behaviour of enums in this way. cc @quantheory