-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)T-langRelevant to the language teamRelevant to the language team
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
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)T-langRelevant to the language teamRelevant to the language team