diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-02-19 13:04:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-19 13:04:34 +0100 |
| commit | 3fe809b38de2597f211a149e87eee15ea8f5ccdd (patch) | |
| tree | 21fbe40c9db81a544cac201fa47f44619146bdc0 | |
| parent | c2cc066761a50bb6f72f32076345beba723822cb (diff) | |
| parent | 9f614cb1a08611df0a6c8d3b47de632904d7626e (diff) | |
| download | rust-3fe809b38de2597f211a149e87eee15ea8f5ccdd.tar.gz rust-3fe809b38de2597f211a149e87eee15ea8f5ccdd.zip | |
Rollup merge of #121275 - tshepang:test-panicking-proc-macros, r=nnethercote
add test for panicking attribute macros
| -rw-r--r-- | tests/ui/proc-macro/custom-attr-panic.rs | 8 | ||||
| -rw-r--r-- | tests/ui/proc-macro/custom-attr-panic.stderr | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/proc-macro/custom-attr-panic.rs b/tests/ui/proc-macro/custom-attr-panic.rs new file mode 100644 index 00000000000..23bcb66319d --- /dev/null +++ b/tests/ui/proc-macro/custom-attr-panic.rs @@ -0,0 +1,8 @@ +//@ aux-build: test-macros.rs + +extern crate test_macros; + +#[test_macros::panic_attr] //~ ERROR custom attribute panicked +fn foo() {} + +fn main() {} diff --git a/tests/ui/proc-macro/custom-attr-panic.stderr b/tests/ui/proc-macro/custom-attr-panic.stderr new file mode 100644 index 00000000000..e436162bcc1 --- /dev/null +++ b/tests/ui/proc-macro/custom-attr-panic.stderr @@ -0,0 +1,10 @@ +error: custom attribute panicked + --> $DIR/custom-attr-panic.rs:5:1 + | +LL | #[test_macros::panic_attr] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: message: panic-attr + +error: aborting due to 1 previous error + |
