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

Fix issue #8763 #10475

Merged
merged 1 commit into from
Nov 24, 2013
Merged

Fix issue #8763 #10475

merged 1 commit into from
Nov 24, 2013

Conversation

astrieanna
Copy link
Contributor

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 Bogus error when creating for an impl for a nonexistent type #8767)

// option. This file may not be copied, modified, or distributed
// except according to those terms.

// error-pattern: found module name used as a type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use the "new" error pattern?

i.e. put //~ ERROR found module name used as a type on the line where the error should occur, and remove this.

@astrieanna
Copy link
Contributor Author

The error still isn't super great, but it does identify the thing it found as a module and print the name of said module.

For the compile-fail/trait-impl-for-module.rs test:
error: found module name used as a type: mod a (id=6)

@astrieanna
Copy link
Contributor Author

@alexcrichton @huonw is there anything else I need to fix here?

@alexcrichton
Copy link
Member

I'm uncomfortable with how it's still a bad error message for other types. I would be more comfortable if an issue were opened with a relevant tests case along with a FIXME in the test with impl Option<T>

@astrieanna
Copy link
Contributor Author

@alexcrichton You want a new issue in addition to #8767?

@alexcrichton
Copy link
Member

Ah, looks like one already exists, can you tag the code with a FIXME?

* 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
@astrieanna
Copy link
Contributor Author

@alexcrichton Ok. FIXME added. :)

bors added a commit that referenced this pull request 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)
@bors bors closed this Nov 24, 2013
@bors bors merged commit e1d1ad3 into rust-lang:master Nov 24, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Mar 24, 2023
Update changelog for beta-accepted labels

Roses are red
Violets are blue
r? `@xFrednet` is better at this
I can't rhyme.

rust-lang/rust-clippy#10423
rust-lang/rust-clippy#10265

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants