-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
collect doc alias as tips during resolution
- Loading branch information
Showing
6 changed files
with
231 additions
and
30 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
14 changes: 14 additions & 0 deletions
14
tests/ui/attributes/auxiliary/use-doc-alias-name-extern.rs
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 @@ | ||
#[doc(alias="DocAliasS1")] | ||
pub struct S1; | ||
|
||
#[doc(alias="DocAliasS2")] | ||
#[doc(alias("DocAliasS3", "DocAliasS4"))] | ||
pub struct S2; | ||
|
||
#[doc(alias("doc_alias_f1", "doc_alias_f2"))] | ||
pub fn f() {} | ||
|
||
pub mod m { | ||
#[doc(alias="DocAliasS5")] | ||
pub struct S5; | ||
} |
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,36 @@ | ||
//@ aux-build: use-doc-alias-name-extern.rs | ||
//@ error-pattern: `S1` has a name defined in the doc alias attribute as `DocAliasS1` | ||
//@ error-pattern: `S2` has a name defined in the doc alias attribute as `DocAliasS2` | ||
//@ error-pattern: `S2` has a name defined in the doc alias attribute as `DocAliasS3` | ||
//@ error-pattern: `S2` has a name defined in the doc alias attribute as `DocAliasS4` | ||
//@ error-pattern: `f` has a name defined in the doc alias attribute as `doc_alias_f1` | ||
//@ error-pattern: `f` has a name defined in the doc alias attribute as `doc_alias_f2` | ||
//@ error-pattern: `S5` has a name defined in the doc alias attribute as `DocAliasS5` | ||
|
||
// issue#124273 | ||
|
||
extern crate use_doc_alias_name_extern; | ||
|
||
use use_doc_alias_name_extern::*; | ||
|
||
#[doc(alias="LocalDocAliasS")] | ||
struct S; | ||
|
||
fn main() { | ||
LocalDocAliasS; | ||
//~^ ERROR: cannot find value `LocalDocAliasS` in this scope | ||
DocAliasS1; | ||
//~^ ERROR: cannot find value `DocAliasS1` in this scope | ||
DocAliasS2; | ||
//~^ ERROR: cannot find value `DocAliasS2` in this scope | ||
DocAliasS3; | ||
//~^ ERROR: cannot find value `DocAliasS3` in this scope | ||
DocAliasS4; | ||
//~^ ERROR: cannot find value `DocAliasS4` in this scope | ||
doc_alias_f1(); | ||
//~^ ERROR: cannot find function `doc_alias_f1` in this scope | ||
doc_alias_f2(); | ||
//~^ ERROR: cannot find function `doc_alias_f2` in this scope | ||
m::DocAliasS5; | ||
//~^ ERROR: cannot find value `DocAliasS5` in module `m` | ||
} |
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,86 @@ | ||
error[E0425]: cannot find value `LocalDocAliasS` in this scope | ||
--> $DIR/use-doc-alias-name.rs:20:5 | ||
| | ||
LL | LocalDocAliasS; | ||
| ^^^^^^^^^^^^^^ not found in this scope | ||
|
||
error[E0425]: cannot find value `DocAliasS1` in this scope | ||
--> $DIR/use-doc-alias-name.rs:22:5 | ||
| | ||
LL | DocAliasS1; | ||
| ^^^^^^^^^^ | ||
| | ||
::: $DIR/auxiliary/use-doc-alias-name-extern.rs:2:1 | ||
| | ||
LL | pub struct S1; | ||
| ------------- `S1` has a name defined in the doc alias attribute as `DocAliasS1` | ||
|
||
error[E0425]: cannot find value `DocAliasS2` in this scope | ||
--> $DIR/use-doc-alias-name.rs:24:5 | ||
| | ||
LL | DocAliasS2; | ||
| ^^^^^^^^^^ | ||
| | ||
::: $DIR/auxiliary/use-doc-alias-name-extern.rs:6:1 | ||
| | ||
LL | pub struct S2; | ||
| ------------- `S2` has a name defined in the doc alias attribute as `DocAliasS2` | ||
|
||
error[E0425]: cannot find value `DocAliasS3` in this scope | ||
--> $DIR/use-doc-alias-name.rs:26:5 | ||
| | ||
LL | DocAliasS3; | ||
| ^^^^^^^^^^ | ||
| | ||
::: $DIR/auxiliary/use-doc-alias-name-extern.rs:6:1 | ||
| | ||
LL | pub struct S2; | ||
| ------------- `S2` has a name defined in the doc alias attribute as `DocAliasS3` | ||
|
||
error[E0425]: cannot find value `DocAliasS4` in this scope | ||
--> $DIR/use-doc-alias-name.rs:28:5 | ||
| | ||
LL | DocAliasS4; | ||
| ^^^^^^^^^^ | ||
| | ||
::: $DIR/auxiliary/use-doc-alias-name-extern.rs:6:1 | ||
| | ||
LL | pub struct S2; | ||
| ------------- `S2` has a name defined in the doc alias attribute as `DocAliasS4` | ||
|
||
error[E0425]: cannot find value `DocAliasS5` in module `m` | ||
--> $DIR/use-doc-alias-name.rs:34:8 | ||
| | ||
LL | m::DocAliasS5; | ||
| ^^^^^^^^^^ | ||
| | ||
::: $DIR/auxiliary/use-doc-alias-name-extern.rs:13:5 | ||
| | ||
LL | pub struct S5; | ||
| ------------- `S5` has a name defined in the doc alias attribute as `DocAliasS5` | ||
|
||
error[E0425]: cannot find function `doc_alias_f1` in this scope | ||
--> $DIR/use-doc-alias-name.rs:30:5 | ||
| | ||
LL | doc_alias_f1(); | ||
| ^^^^^^^^^^^^ | ||
| | ||
::: $DIR/auxiliary/use-doc-alias-name-extern.rs:9:1 | ||
| | ||
LL | pub fn f() {} | ||
| ---------- `f` has a name defined in the doc alias attribute as `doc_alias_f1` | ||
|
||
error[E0425]: cannot find function `doc_alias_f2` in this scope | ||
--> $DIR/use-doc-alias-name.rs:32:5 | ||
| | ||
LL | doc_alias_f2(); | ||
| ^^^^^^^^^^^^ | ||
| | ||
::: $DIR/auxiliary/use-doc-alias-name-extern.rs:9:1 | ||
| | ||
LL | pub fn f() {} | ||
| ---------- `f` has a name defined in the doc alias attribute as `doc_alias_f2` | ||
|
||
error: aborting due to 8 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0425`. |