-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avoid overlapping privacy suggestion for single nested imports
- Loading branch information
Showing
7 changed files
with
114 additions
and
45 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
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,14 @@ | ||
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/issue-114884.rs:11:12 | ||
| | ||
LL | use mod2::{sub_mod::TraitA}; | ||
| ^^^^^^^ private module | ||
| | ||
help: consider importing this trait instead: | ||
mod1::TraitA | ||
--> $DIR/issue-114884.rs:11:12 | ||
| | ||
LL | use mod2::{sub_mod::TraitA}; | ||
| ^^^^^^^^^^^^^^^ | ||
note: the module `sub_mod` is defined here | ||
--> $DIR/issue-114884.rs:6:5 | ||
| | ||
LL | mod sub_mod { | ||
| ^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0603`. |