diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-01-02 02:21:05 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-01-13 14:17:19 +0300 |
| commit | 41c65992c52113699451a6236148d408894f89ef (patch) | |
| tree | 1b65f3b9dccc290bdc875bbd5f3e3e670f739158 /src/test/ui/parser | |
| parent | 75a369c5b11459baa6bf7734eeb6135998a0a7de (diff) | |
| download | rust-41c65992c52113699451a6236148d408894f89ef.tar.gz rust-41c65992c52113699451a6236148d408894f89ef.zip | |
Implement basic input validation for built-in attributes
Diffstat (limited to 'src/test/ui/parser')
| -rw-r--r-- | src/test/ui/parser/attr.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/parser/attr.stderr | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/test/ui/parser/attr.rs b/src/test/ui/parser/attr.rs index 041f30cd242..91a4abbd038 100644 --- a/src/test/ui/parser/attr.rs +++ b/src/test/ui/parser/attr.rs @@ -2,5 +2,6 @@ fn main() {} -#![lang(foo)] //~ ERROR an inner attribute is not permitted in this context +#![lang = "foo"] //~ ERROR an inner attribute is not permitted in this context + //~| ERROR definition of an unknown language item: `foo` fn foo() {} diff --git a/src/test/ui/parser/attr.stderr b/src/test/ui/parser/attr.stderr index 44714dc56ee..8151bd7cdd7 100644 --- a/src/test/ui/parser/attr.stderr +++ b/src/test/ui/parser/attr.stderr @@ -1,10 +1,17 @@ error: an inner attribute is not permitted in this context --> $DIR/attr.rs:5:3 | -LL | #![lang(foo)] //~ ERROR an inner attribute is not permitted in this context +LL | #![lang = "foo"] //~ ERROR an inner attribute is not permitted in this context | ^ | = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them. -error: aborting due to previous error +error[E0522]: definition of an unknown language item: `foo` + --> $DIR/attr.rs:5:1 + | +LL | #![lang = "foo"] //~ ERROR an inner attribute is not permitted in this context + | ^^^^^^^^^^^^^^^^ definition of unknown language item `foo` + +error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0522`. |
