Skip to content

Test for #14082 doesn't test what it should #140765

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

Open
pvdrz opened this issue May 7, 2025 · 1 comment
Open

Test for #14082 doesn't test what it should #140765

pvdrz opened this issue May 7, 2025 · 1 comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@pvdrz
Copy link
Contributor

pvdrz commented May 7, 2025

Please, take this with a grain of salt as I might have misunderstood what #14082 is about.

The test added for this should check that a glob import is correctly shadowed by a non-glob import of a reexport from inside a non-pub module. Essentially:

// tests/ui/issues/issue-14082.rs
//@ check-pass

#![allow(unused_imports, dead_code)]

use foo::Foo;

mod foo {
    pub use d::*;   // This imports `d::Foo`.
    pub use m::Foo; // But this imports `m::Foo` explicitly, which shadows `d::Foo`.
}

mod m {
    pub struct Foo;
}

mod d {
    pub struct Foo;
}

fn main() {}

However this was changed on this bulk refactor which removed the d::* import.

Let me know if my understanding is correct. I'll submit a PR with a fix if that's the case.

Thanks :)

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 7, 2025
@lolbinarycat lolbinarycat added the A-testsuite Area: The testsuite used to check the correctness of rustc label May 8, 2025
@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. A-resolve Area: Name/path resolution done by `rustc_resolve` specifically and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 14, 2025
@jieyouxu
Copy link
Member

Yeah, that test is not testing what it claims to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants