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

pub use into the top-level crate module does not work #6745

Closed
mzabaluev opened this issue May 26, 2013 · 2 comments
Closed

pub use into the top-level crate module does not work #6745

mzabaluev opened this issue May 26, 2013 · 2 comments

Comments

@mzabaluev
Copy link
Contributor

While #4202 has been fixed, a yet simpler case is still reproducible in current incoming.
If I have a crate def.rs with these definitions:

pub use inner::A;

mod inner {
    pub struct A;

    impl A {
        pub fn f() {
        }
    }
}

Then use.rs that uses the crate of def.rs:

extern mod def;

fn main() {
    def::A::f();
}

Compilation of use.rs fails:

use.rs:4:4: 4:13 error: not a module `A`
use.rs:4     def::A::f();
             ^~~~~~~~~
@thomaslee
Copy link
Contributor

Should be noted that the fix for #4202 applies specifically to static methods on traits. Impls providing static methods on structs may require similar juggling. I'll try to take a look this week if nobody beats me to it.

@thomaslee
Copy link
Contributor

Pretty sure the fix for this would be a generalization of #4202, but the change is a little more involved because we'll need to track the impls associated with exportable items (struct, trait, maybe enum?).

@bors bors closed this as completed in 24e85ac Jun 13, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Sep 28, 2021
…teffen

Improve accuracy of `mut_key`

Fixes rust-lang#6745.

Whilst writing the tests for this, I noticed what I believe is a false negative (the code in `@xFrednet's` [comment](rust-lang/rust-clippy#6745 (comment)) doesn't trigger the lint).  Currently the tests contain a case for this (which is blatantly ignored), but I'm not at all sure how to implement this (since the lint currently behaves completely differently for ADTs).  I'm not sure what should be done - on the one hand the extra test cases are misleading, but on the other hand they don't cause much harm and would save effort for anyone fixing that false negative.

---

changelog: Improve accuracy of `clippy::mutable_key_type`.
shepmaster added a commit to adwinwhite/rust-playground that referenced this issue Feb 1, 2023
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