diff options
| author | xd009642 <danielmckenna93@gmail.com> | 2020-10-08 23:23:27 +0100 |
|---|---|---|
| committer | xd009642 <danielmckenna93@gmail.com> | 2020-10-08 23:32:20 +0100 |
| commit | a6e2b636e658ca7346ffb32bf11301d92b72a1de (patch) | |
| tree | 6542609d14fcfd59a5500e0fb3fa6b3a699c4760 /src | |
| parent | 4437b4b1509c3c15b41a05489c4bddd2fe30e33f (diff) | |
Implement the instruction_set attribute
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/error-codes/E0778.rs | 8 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0778.stderr | 9 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0779.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0779.stderr | 9 | ||||
| -rw-r--r-- | src/test/ui/feature-gate-isa_attribute.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/feature-gate-isa_attribute.stderr | 25 |
6 files changed, 63 insertions, 0 deletions
diff --git a/src/test/ui/error-codes/E0778.rs b/src/test/ui/error-codes/E0778.rs new file mode 100644 index 00000000000..60e5c2598f1 --- /dev/null +++ b/src/test/ui/error-codes/E0778.rs @@ -0,0 +1,8 @@ +#![feature(isa_attribute)] + +#[instruction_set()] //~ ERROR +fn no_isa_defined() { +} + +fn main() { +} diff --git a/src/test/ui/error-codes/E0778.stderr b/src/test/ui/error-codes/E0778.stderr new file mode 100644 index 00000000000..6ecae792423 --- /dev/null +++ b/src/test/ui/error-codes/E0778.stderr @@ -0,0 +1,9 @@ +error[E0778]: `#[instruction_set]` requires an argument + --> $DIR/E0778.rs:3:1 + | +LL | #[instruction_set()] + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0778`. diff --git a/src/test/ui/error-codes/E0779.rs b/src/test/ui/error-codes/E0779.rs new file mode 100644 index 00000000000..1b4dbce2036 --- /dev/null +++ b/src/test/ui/error-codes/E0779.rs @@ -0,0 +1,6 @@ +#![feature(isa_attribute)] + +#[instruction_set(arm::magic)] //~ ERROR +fn main() { + +} diff --git a/src/test/ui/error-codes/E0779.stderr b/src/test/ui/error-codes/E0779.stderr new file mode 100644 index 00000000000..4abe0c02636 --- /dev/null +++ b/src/test/ui/error-codes/E0779.stderr @@ -0,0 +1,9 @@ +error[E0779]: Invalid instruction set specified + --> $DIR/E0779.rs:3:1 + | +LL | #[instruction_set(arm::magic)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0779`. diff --git a/src/test/ui/feature-gate-isa_attribute.rs b/src/test/ui/feature-gate-isa_attribute.rs new file mode 100644 index 00000000000..cb02a0955e9 --- /dev/null +++ b/src/test/ui/feature-gate-isa_attribute.rs @@ -0,0 +1,6 @@ +#[instruction_set] +//~^ ERROR the `#[instruction_set]` attribute is an experimental feature [E0658] +//~| ERROR malformed `instruction_set` attribute input +//~| ERROR must specify an instruction set [E0778] +fn main() { +} diff --git a/src/test/ui/feature-gate-isa_attribute.stderr b/src/test/ui/feature-gate-isa_attribute.stderr new file mode 100644 index 00000000000..2a95a80ca61 --- /dev/null +++ b/src/test/ui/feature-gate-isa_attribute.stderr @@ -0,0 +1,25 @@ +error: malformed `instruction_set` attribute input + --> $DIR/feature-gate-isa_attribute.rs:1:1 + | +LL | #[instruction_set] + | ^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[instruction_set(set)]` + +error[E0658]: the `#[instruction_set]` attribute is an experimental feature + --> $DIR/feature-gate-isa_attribute.rs:1:1 + | +LL | #[instruction_set] + | ^^^^^^^^^^^^^^^^^^ + | + = note: see issue #74727 <https://github.com/rust-lang/rust/issues/74727> for more information + = help: add `#![feature(isa_attribute)]` to the crate attributes to enable + +error[E0778]: must specify an instruction set + --> $DIR/feature-gate-isa_attribute.rs:1:1 + | +LL | #[instruction_set] + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0658, E0778. +For more information about an error, try `rustc --explain E0658`. |
