-
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.
- Loading branch information
1 parent
09fff50
commit 83f553c
Showing
14 changed files
with
140 additions
and
10 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
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 @@ | ||
// edition:2018 | ||
|
||
#![feature(register_attr)] | ||
#![feature(register_tool)] | ||
|
||
#![register_attr(attr)] | ||
#![register_tool(tool)] | ||
|
||
use attr as renamed_attr; // OK | ||
use tool as renamed_tool; // OK | ||
|
||
#[renamed_attr] //~ ERROR cannot use an explicitly registered attribute through an import | ||
#[renamed_tool::attr] //~ ERROR cannot use a tool module through an import | ||
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,26 @@ | ||
error: cannot use an explicitly registered attribute through an import | ||
--> $DIR/register-attr-tool-import.rs:12:3 | ||
| | ||
LL | #[renamed_attr] | ||
| ^^^^^^^^^^^^ | ||
| | ||
note: the explicitly registered attribute imported here | ||
--> $DIR/register-attr-tool-import.rs:9:5 | ||
| | ||
LL | use attr as renamed_attr; // OK | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: cannot use a tool module through an import | ||
--> $DIR/register-attr-tool-import.rs:13:3 | ||
| | ||
LL | #[renamed_tool::attr] | ||
| ^^^^^^^^^^^^ | ||
| | ||
note: the tool module imported here | ||
--> $DIR/register-attr-tool-import.rs:10:5 | ||
| | ||
LL | use tool as renamed_tool; // OK | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
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 @@ | ||
#![feature(register_attr)] | ||
#![feature(register_tool)] | ||
|
||
#![register_attr(attr)] | ||
#![register_tool(tool)] | ||
|
||
#[no_implicit_prelude] | ||
mod m { | ||
#[attr] //~ ERROR cannot find attribute `attr` in this scope | ||
#[tool::attr] //~ ERROR failed to resolve: use of undeclared type or module `tool` | ||
fn check() {} | ||
} | ||
|
||
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,15 @@ | ||
error[E0433]: failed to resolve: use of undeclared type or module `tool` | ||
--> $DIR/register-attr-tool-prelude.rs:10:7 | ||
| | ||
LL | #[tool::attr] | ||
| ^^^^ use of undeclared type or module `tool` | ||
|
||
error: cannot find attribute `attr` in this scope | ||
--> $DIR/register-attr-tool-prelude.rs:9:7 | ||
| | ||
LL | #[attr] | ||
| ^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0433`. |
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,10 @@ | ||
#![deny(unused)] | ||
|
||
#![feature(register_attr)] | ||
#![feature(register_tool)] | ||
|
||
#[register_attr(attr)] //~ ERROR crate-level attribute should be an inner attribute | ||
//~| ERROR unused attribute | ||
#[register_tool(tool)] //~ ERROR crate-level attribute should be an inner attribute | ||
//~| ERROR unused attribute | ||
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,33 @@ | ||
error: unused attribute | ||
--> $DIR/register-attr-tool-unused.rs:6:1 | ||
| | ||
LL | #[register_attr(attr)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: lint level defined here | ||
--> $DIR/register-attr-tool-unused.rs:1:9 | ||
| | ||
LL | #![deny(unused)] | ||
| ^^^^^^ | ||
= note: `#[deny(unused_attributes)]` implied by `#[deny(unused)]` | ||
|
||
error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` | ||
--> $DIR/register-attr-tool-unused.rs:6:1 | ||
| | ||
LL | #[register_attr(attr)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: unused attribute | ||
--> $DIR/register-attr-tool-unused.rs:8:1 | ||
| | ||
LL | #[register_tool(tool)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` | ||
--> $DIR/register-attr-tool-unused.rs:8:1 | ||
| | ||
LL | #[register_tool(tool)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 4 previous errors | ||
|
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