-
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.
Hide foreign
#[doc(hidden)]
items in import suggestions
- Loading branch information
1 parent
f704f3b
commit 7e0a0b0
Showing
8 changed files
with
125 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#[doc(hidden)] | ||
pub mod hidden { | ||
pub struct Foo; | ||
} | ||
|
||
pub mod hidden1 { | ||
#[doc(hidden)] | ||
pub struct Foo; | ||
} | ||
|
||
|
||
#[doc(hidden)] | ||
pub(crate) mod hidden2 { | ||
pub struct Bar; | ||
} | ||
|
||
pub use hidden2::Bar; |
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 @@ | ||
// aux-build:hidden-struct.rs | ||
// compile-flags: --crate-type lib | ||
|
||
extern crate hidden_struct; | ||
|
||
#[doc(hidden)] | ||
mod local { | ||
pub struct Foo; | ||
} | ||
|
||
pub fn test(_: Foo) {} | ||
//~^ ERROR cannot find type `Foo` in this scope | ||
|
||
pub fn test2(_: Bar) {} |
25 changes: 25 additions & 0 deletions
25
tests/ui/suggestions/dont-suggest-foreign-doc-hidden.stderr
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,25 @@ | ||
error[E0412]: cannot find type `Foo` in this scope | ||
--> $DIR/dont-suggest-foreign-doc-hidden.rs:11:16 | ||
| | ||
LL | pub fn test(_: Foo) {} | ||
| ^^^ not found in this scope | ||
| | ||
help: consider importing this struct | ||
| | ||
LL + use local::Foo; | ||
| | ||
|
||
error[E0412]: cannot find type `Bar` in this scope | ||
--> $DIR/dont-suggest-foreign-doc-hidden.rs:14:17 | ||
| | ||
LL | pub fn test2(_: Bar) {} | ||
| ^^^ not found in this scope | ||
| | ||
help: consider importing this struct | ||
| | ||
LL + use hidden_struct::Bar; | ||
| | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0412`. |
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
24 changes: 12 additions & 12 deletions
24
tests/ui/type-alias-impl-trait/nested-impl-trait-in-tait.stderr
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