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

impl Trait for module yields weird error message #8763

Closed
jdm opened this issue Aug 26, 2013 · 2 comments
Closed

impl Trait for module yields weird error message #8763

jdm opened this issue Aug 26, 2013 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@jdm
Copy link
Contributor

jdm commented Aug 26, 2013

mod a {
}

trait A {
}

impl A for a {
}

fn main() {
}
/tmp/foo.rs:7:11: 7:12 error: found value name used as a type: def_mod({crate: 0, node: 1})
/tmp/foo.rs:7 impl A for a {
                         ^

We could do better here.

astrieanna added a commit to astrieanna/rust that referenced this issue Nov 24, 2013
* added case & better error message for "impl trait for module"
* used better way to print the module
* switched from //error-pattern to //~ ERROR
* added compile-fail test trait-impl-for-module.rs
* revised compile-fail test trait-or-new-type-instead
    (the error message for the modified test is still unclear, but that's a different bug)
* added FIXME to trait-or-new-type-instead
bors added a commit that referenced this issue Nov 24, 2013
Issue #8763 is about improving a particular error message.

* added case & better error message for "impl trait for module"
* added compile-fail test trait-impl-for-module.rs
* updated copyright dates
* revised compile-fail test trait-or-new-type-instead
   (the error message for the modified test is still unclear, but that's a different bug #8767)
@jfager
Copy link
Contributor

jfager commented Feb 1, 2014

This looks like it can be closed.

@JustAPerson
Copy link
Contributor

Perhaps this issue should be closed, as it now gives a much more useful error:

8763.rs:7:12: 7:13 error: found module name used as a type: mod a::a (id=4)
8763.rs:7 impl A for a {
                     ^
$ rustc -v
rustc 0.10-pre (7bda3df 2014-04-02 17:51:48 -0700)
host: x86_64-unknown-linux-gnu

@jdm jdm closed this as completed Apr 4, 2014
xFrednet pushed a commit to xFrednet/rust that referenced this issue May 21, 2022
Support negative ints in manual_range_contains

fixes: rust-lang#8721
changelog: Fixes issue where ranges containing ints with different signs would be
incorrect due to comparing as unsigned.
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 E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants