Skip to content

Confusing error message for impl of a nonexistent type #10779

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

Closed
kmcallister opened this issue Dec 2, 2013 · 1 comment
Closed

Confusing error message for impl of a nonexistent type #10779

kmcallister opened this issue Dec 2, 2013 · 1 comment

Comments

@kmcallister
Copy link
Contributor

Compiling

impl Foo { }

gives

foo.rs:1:5: 1:8 error: found value name used as a type: DefMod(syntax::ast::DefId{crate: 0, node: 5})
foo.rs:1 impl Foo { }
              ^~~

on

rustc 0.9-pre (67d7be0 2013-10-29 12:02:59 -0700)
host: x86_64-unknown-linux-gnu
@alexcrichton
Copy link
Member

Closing as a dupe of #8767, but thanks for the report!

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 2, 2023
Add new lint `ptr_cast_constness`

This adds a new lint which functions as the opposite side of the coin to `ptr_as_ptr`. Rather than linting only as casts that don't change constness, this lints only constness; suggesting to use `pointer::cast_const` or `pointer::cast_mut` instead.

changelog: new lint [`ptr_cast_constness`]
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

No branches or pull requests

2 participants