Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test-macro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Run Macro Tests
jobs:
testing:
name: testing
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

steps:
- name: Checkout sources
Expand All @@ -16,10 +16,10 @@ jobs:
with:
profile: minimal
toolchain: nightly
override: true
component: rust-src

- name: Test macro library
uses: actions-rs/cargo@v1
with:
command: test
args: -p msp430-rt-macros --features device
args: -Zbuild-std -p msp430-rt-macros --target=x86_64-unknown-linux-gnu --features device
3 changes: 3 additions & 0 deletions macros/tests/compiletest.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#[test]
fn ui() {
std::env::set_var("CARGO_BUILD_TARGET", "msp430-none-elf");
std::env::set_var("CARGO_UNSTABLE_BUILD_STD", "std");

let t = trybuild::TestCases::new();
t.compile_fail("tests/ui/*.rs");
}
10 changes: 10 additions & 0 deletions macros/tests/ui/entry_preinterrupt_mismatch.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,14 @@ note: function defined here
|
10 | #[entry(interrupt_enable(pre_interrupt = init))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 | fn main(_i: bool) -> ! {
| --------
= note: this error originates in the attribute macro `entry` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: unused variable: `cs`
--> tests/ui/entry_preinterrupt_mismatch.rs:6:9
|
6 | fn init(cs: CriticalSection) -> u32 {
| ^^ help: if this is intentional, prefix it with an underscore: `_cs`
|
= note: `#[warn(unused_variables)]` on by default
6 changes: 1 addition & 5 deletions macros/tests/ui/entry_preinterrupt_no_arg.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
--> tests/ui/entry_preinterrupt_no_arg.rs:7:42
|
7 | #[entry(interrupt_enable(pre_interrupt = init))]
| -----------------------------------------^^^^--- argument of type `CriticalSection<'_>` unexpected
| -----------------------------------------^^^^--- unexpected argument of type `CriticalSection<'_>`
|
note: function defined here
--> tests/ui/entry_preinterrupt_no_arg.rs:5:4
|
5 | fn init() {}
| ^^^^
help: remove the extra argument
|
7 | init()
|
5 changes: 2 additions & 3 deletions macros/tests/ui/entry_preinterrupt_return_cs.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
error[E0597]: `cs` does not live long enough
error[E0597]: value does not live long enough
--> tests/ui/entry_preinterrupt_return_cs.rs:10:1
|
10 | #[entry(interrupt_enable(pre_interrupt = init))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| | |
| | `cs` dropped here while still borrowed
| | value dropped here while still borrowed
| borrowed value does not live long enough
| borrow later stored here
|
= note: this error originates in the attribute macro `entry` (in Nightly builds, run with -Z macro-backtrace for more info)
5 changes: 2 additions & 3 deletions macros/tests/ui/entry_preinterrupt_return_cs2.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
error[E0597]: `cs` does not live long enough
error[E0597]: value does not live long enough
--> tests/ui/entry_preinterrupt_return_cs2.rs:10:1
|
10 | #[entry(interrupt_enable(pre_interrupt = init))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| | |
| | `cs` dropped here while still borrowed
| | value dropped here while still borrowed
| borrowed value does not live long enough
| borrow later stored here
|
= note: this error originates in the attribute macro `entry` (in Nightly builds, run with -Z macro-backtrace for more info)
5 changes: 2 additions & 3 deletions macros/tests/ui/entry_preinterrupt_return_cs3.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
error[E0597]: `cs` does not live long enough
error[E0597]: value does not live long enough
--> tests/ui/entry_preinterrupt_return_cs3.rs:10:1
|
10 | #[entry(interrupt_enable(pre_interrupt = init))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| | |
| | `cs` dropped here while still borrowed
| | value dropped here while still borrowed
| borrowed value does not live long enough
| borrow later stored here
|
= note: this error originates in the attribute macro `entry` (in Nightly builds, run with -Z macro-backtrace for more info)
5 changes: 2 additions & 3 deletions macros/tests/ui/entry_preinterrupt_return_cs_cloned.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
error[E0597]: `cs` does not live long enough
error[E0597]: value does not live long enough
--> tests/ui/entry_preinterrupt_return_cs_cloned.rs:10:1
|
10 | #[entry(interrupt_enable(pre_interrupt = init))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| | |
| | `cs` dropped here while still borrowed
| | value dropped here while still borrowed
| borrowed value does not live long enough
| borrow later stored here
|
= note: this error originates in the attribute macro `entry` (in Nightly builds, run with -Z macro-backtrace for more info)
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error[E0597]: `cs` does not live long enough
error[E0597]: value does not live long enough
--> tests/ui/entry_preinterrupt_return_cs_cloned_static.rs:10:1
|
10 | #[entry(interrupt_enable(pre_interrupt = init))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| | |
| | `cs` dropped here while still borrowed
| | value dropped here while still borrowed
| borrowed value does not live long enough
| argument requires that `cs` is borrowed for `'static`
|
Expand Down
4 changes: 2 additions & 2 deletions macros/tests/ui/entry_preinterrupt_return_cs_static.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error[E0597]: `cs` does not live long enough
error[E0597]: value does not live long enough
--> tests/ui/entry_preinterrupt_return_cs_static.rs:10:1
|
10 | #[entry(interrupt_enable(pre_interrupt = init))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| | |
| | `cs` dropped here while still borrowed
| | value dropped here while still borrowed
| borrowed value does not live long enough
| argument requires that `cs` is borrowed for `'static`
|
Expand Down
2 changes: 1 addition & 1 deletion macros/tests/ui/interrupt_args.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: this attribute accepts no arguments
error: this attribute accepts only 'wake_cpu' as an argument
--> tests/ui/interrupt_args.rs:10:1
|
10 | #[interrupt(arg)]
Expand Down
15 changes: 8 additions & 7 deletions macros/tests/ui/interrupt_wrong_import.stderr
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
error[E0433]: failed to resolve: use of undeclared crate or module `interrupt`
error[E0658]: the extern "msp430-interrupt" ABI is experimental and subject to change
--> tests/ui/interrupt_wrong_import.rs:11:1
|
11 | #[interrupt]
| ^^^^^^^^^^^^ use of undeclared crate or module `interrupt`
| ^^^^^^^^^^^^
|
= note: see issue #38487 <https://github.com/rust-lang/rust/issues/38487> for more information
= help: add `#![feature(abi_msp430_interrupt)]` to the crate attributes to enable
= note: this error originates in the attribute macro `interrupt` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: msp430-interrupt ABI is experimental and subject to change
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
--> tests/ui/interrupt_wrong_import.rs:11:1
|
11 | #[interrupt]
| ^^^^^^^^^^^^
|
= note: see issue #38487 <https://github.com/rust-lang/rust/issues/38487> for more information
= help: add `#![feature(abi_msp430_interrupt)]` to the crate attributes to enable
= note: this error originates in the attribute macro `interrupt` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `interrupt`
--> tests/ui/interrupt_wrong_import.rs:11:1
|
11 | #[interrupt]
| ^^^^^^^^^^^^
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `interrupt`
|
= help: if you wanted to use a crate named `interrupt`, use `cargo add interrupt` to add it to your `Cargo.toml`
= note: this error originates in the attribute macro `interrupt` (in Nightly builds, run with -Z macro-backtrace for more info)
26 changes: 13 additions & 13 deletions macros/tests/ui/recursion.stderr
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
error[E0425]: cannot find function `main` in this scope
--> tests/ui/recursion.rs:7:5
|
7 | main(cs)
| ^^^^ not found in this scope

error[E0425]: cannot find function, tuple struct or tuple variant `DefaultHandler` in this scope
--> tests/ui/recursion.rs:12:5
|
12 | DefaultHandler(cs)
| ^^^^^^^^^^^^^^ not found in this scope

error[E0658]: msp430-interrupt ABI is experimental and subject to change
error[E0658]: the extern "msp430-interrupt" ABI is experimental and subject to change
--> tests/ui/recursion.rs:10:1
|
10 | #[interrupt]
Expand All @@ -20,10 +8,22 @@ error[E0658]: msp430-interrupt ABI is experimental and subject to change
= help: add `#![feature(abi_msp430_interrupt)]` to the crate attributes to enable
= note: this error originates in the attribute macro `interrupt` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0425]: cannot find function `main` in this scope
--> tests/ui/recursion.rs:7:5
|
7 | main(cs)
| ^^^^ not found in this scope

error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
--> tests/ui/recursion.rs:10:1
|
10 | #[interrupt]
| ^^^^^^^^^^^^
|
= note: this error originates in the attribute macro `interrupt` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0425]: cannot find function, tuple struct or tuple variant `DefaultHandler` in this scope
--> tests/ui/recursion.rs:12:5
|
12 | DefaultHandler(cs)
| ^^^^^^^^^^^^^^ not found in this scope
26 changes: 13 additions & 13 deletions macros/tests/ui/recursion2.stderr
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
error[E0425]: cannot find function `main` in this scope
--> tests/ui/recursion2.rs:7:5
|
7 | main()
| ^^^^ not found in this scope

error[E0425]: cannot find function, tuple struct or tuple variant `DefaultHandler` in this scope
--> tests/ui/recursion2.rs:12:5
|
12 | DefaultHandler()
| ^^^^^^^^^^^^^^ not found in this scope

error[E0658]: msp430-interrupt ABI is experimental and subject to change
error[E0658]: the extern "msp430-interrupt" ABI is experimental and subject to change
--> tests/ui/recursion2.rs:10:1
|
10 | #[interrupt]
Expand All @@ -20,10 +8,22 @@ error[E0658]: msp430-interrupt ABI is experimental and subject to change
= help: add `#![feature(abi_msp430_interrupt)]` to the crate attributes to enable
= note: this error originates in the attribute macro `interrupt` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0425]: cannot find function `main` in this scope
--> tests/ui/recursion2.rs:7:5
|
7 | main()
| ^^^^ not found in this scope

error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
--> tests/ui/recursion2.rs:10:1
|
10 | #[interrupt]
| ^^^^^^^^^^^^
|
= note: this error originates in the attribute macro `interrupt` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0425]: cannot find function, tuple struct or tuple variant `DefaultHandler` in this scope
--> tests/ui/recursion2.rs:12:5
|
12 | DefaultHandler()
| ^^^^^^^^^^^^^^ not found in this scope
Loading