rust-lang / rust-lang/rust

Test for #14082 doesn't test what it should

Open
#140,765 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-resolve A-testsuite C-bug T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

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 :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/ui/issues/issue-14082.rs and compare it with the intended scenario described here. Check that the test includes a glob reexport from d and an explicit Foo reexport from m inside foo, then confirm the test still passes and exercises the shadowing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.