-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #121190 - bvanjoi:fix-114884, r=petrochenkov
avoid overlapping privacy suggestion for single nested imports Fixes #114884 This PR aims to avoid confusion inside braces for import suggestions. r? ``@petrochenkov``
- Loading branch information
Showing
6 changed files
with
81 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// https://github.com/rust-lang/rust/issues/114884 | ||
|
||
mod mod1 { | ||
pub trait TraitA {} | ||
} | ||
|
||
mod mod2 { | ||
mod sub_mod { | ||
use super::super::mod1::TraitA; | ||
} | ||
} | ||
|
||
use mod2::{sub_mod::TraitA}; | ||
//~^ ERROR: module `sub_mod` is private | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
error[E0603]: module `sub_mod` is private | ||
--> $DIR/append-import-suggestion.rs:13:12 | ||
| | ||
LL | use mod2::{sub_mod::TraitA}; | ||
| ^^^^^^^ private module | ||
| | ||
help: consider importing this trait instead: | ||
mod1::TraitA | ||
--> $DIR/append-import-suggestion.rs:13:12 | ||
| | ||
LL | use mod2::{sub_mod::TraitA}; | ||
| ^^^^^^^^^^^^^^^ | ||
note: the module `sub_mod` is defined here | ||
--> $DIR/append-import-suggestion.rs:8:5 | ||
| | ||
LL | mod sub_mod { | ||
| ^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0603`. |