forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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 rust-lang#119151 - Jules-Bertholet:no-foreign-doc-hidden-suggest, r=davidtwco Hide foreign `#[doc(hidden)]` paths in import suggestions Stops the compiler from suggesting to import foreign `#[doc(hidden)]` paths. ```@rustbot``` label A-suggestion-diagnostics
- Loading branch information
Showing
9 changed files
with
126 additions
and
35 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,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,15 @@ | ||
// 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) {} | ||
//~^ ERROR cannot find type `Bar` in this scope |
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