-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should not be able to declare mod item and type item (e.g. an enum) in same scope #15205
Comments
Nominating for 1.0, P-backcompat-lang. |
(This is relevant to rust-lang/rfcs#94 ) |
Assigning P-backcompat-lang, to the 1.0 milestone. |
pcwalton
added a commit
to pcwalton/rust
that referenced
this issue
Jul 7, 2014
This will break code that looks like: struct Foo { ... } mod Foo { ... } Change this code to: struct Foo { ... } impl Foo { ... } Or rename the module. Closes rust-lang#15205. [breaking-change]
bors
added a commit
that referenced
this issue
Jul 8, 2014
…r=nick29581 This will break code that looks like: struct Foo { ... } mod Foo { ... } Change this code to: struct Foo { ... } impl Foo { ... } Or rename the module. Closes #15205. [breaking-change] r? @nick29581
This isn't fully fixed in 0.12: This generates an error: #[deriving(Show)]
mod Foo {
pub static X: int = 42;
}
type Foo = u32;
fn main() {
println!("{}", Foo::X);
} While this doesn't: (all that changed is the order of type and mod) type Foo = u32;
#[deriving(Show)]
mod Foo {
pub static X: int = 42;
}
fn main() {
println!("{}", Foo::X);
} (I'm not too sure if the first example is intended to generate errors or not, but the inconsistency is definitely unexpected) |
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jul 17, 2023
Split out project loading capabilities from rust-analyzer crate External tools currently depend on the entire lsp infra for no good reason so let's lift that out so those tools have something better to depend on
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Illustrative code provided by cmr:
The above should not be legal: one should not be able to declare the
mod Foo
item in the same scope as theenum Foo
item.But the following playpen appears to accept it, at the moment.
The text was updated successfully, but these errors were encountered: