Skip to content
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

Calling a static method on a type with no static methods results in "module wasn't actually a module!" error #14225

Closed
huonw opened this issue May 15, 2014 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-resolve Area: Path resolution

Comments

@huonw
Copy link
Member

huonw commented May 15, 2014

struct Foo;
fn main() {
    Foo::bar();
}
ERROR:rustc::middle::resolve: !!! (resolving module in lexical scope) module wasn't actually a module!
<anon>:18:21: 18:29 error: unresolved name
<anon>:18         struct Foo; Foo::bar()
                              ^~~~~~~~
<anon>:18:21: 18:29 error: use of undeclared module `Foo`
<anon>:18         struct Foo; Foo::bar()
                              ^~~~~~~~
ERROR:rustc::middle::resolve: !!! (resolving module in lexical scope) module wasn't actually a module!
<anon>:18:21: 18:29 error: unresolved name `Foo::bar`.
<anon>:18         struct Foo; Foo::bar()
                              ^~~~~~~~
error: aborting due to 3 previous errors
playpen: application terminated with error code 101

If there is some other static method, then calling a non-existent method gives a sensible "cannot resolve method Foo::bar" error.

alexcrichton added a commit to alexcrichton/rust that referenced this issue May 15, 2014
These are taken care of with compiler errors later on, no need to spam with
extra unformatted information unconditionally.

Closes rust-lang#14225
bors added a commit that referenced this issue May 16, 2014
These are taken care of with compiler errors later on, no need to spam with
extra unformatted information unconditionally.

Closes #14225
bors added a commit that referenced this issue May 17, 2014
These are taken care of with compiler errors later on, no need to spam with
extra unformatted information unconditionally.

Closes #14225
lnicola pushed a commit to lnicola/rust that referenced this issue Mar 13, 2023
Support removing nested `dbg!()`s in `remove_dbg`

Closes rust-lang#13901
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-resolve Area: Path resolution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants