Closed
Description
This would be a very minor change. To give an example of what this would do, the following code would work under this change:
use foo::Foo;
mod foo {
pub struct Foo(());
}
const Foo: () = ();
fn main() {
let x = Foo;
}
Currently, it doesn’t because the import at the top conflicts with the const Foo
, even though the tuple struct Foo
is unusable as a value (because it has private fields). This would be a very minor backwards-compatible change, but would make using tuple structs with private fields less bad (equivalent to a normal struct with private fields, I think). cc rust-lang/rust#22045