From 5c5c3c95276811d4ea72f6c4b45e7406ee8c6165 Mon Sep 17 00:00:00 2001 From: Tom Martin Date: Fri, 7 Apr 2023 04:22:43 +0100 Subject: [PATCH] Add more complex test cases for new suggestion --- tests/ui/macros/macro-path-prelude-fail-5.rs | 10 +++++++ .../macros/macro-path-prelude-fail-5.stderr | 30 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 tests/ui/macros/macro-path-prelude-fail-5.rs create mode 100644 tests/ui/macros/macro-path-prelude-fail-5.stderr diff --git a/tests/ui/macros/macro-path-prelude-fail-5.rs b/tests/ui/macros/macro-path-prelude-fail-5.rs new file mode 100644 index 00000000000..b82b6bc7878 --- /dev/null +++ b/tests/ui/macros/macro-path-prelude-fail-5.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug)] // OK +struct S; + +#[derive(Debug, inline)] //~ ERROR expected derive macro, found built-in attribute `inline` +struct T; + +#[derive(inline, Debug)] //~ ERROR expected derive macro, found built-in attribute `inline` +struct U; + +fn main() {} diff --git a/tests/ui/macros/macro-path-prelude-fail-5.stderr b/tests/ui/macros/macro-path-prelude-fail-5.stderr new file mode 100644 index 00000000000..105c59db674 --- /dev/null +++ b/tests/ui/macros/macro-path-prelude-fail-5.stderr @@ -0,0 +1,30 @@ +error: expected derive macro, found built-in attribute `inline` + --> $DIR/macro-path-prelude-fail-5.rs:4:17 + | +LL | #[derive(Debug, inline)] + | ^^^^^^ not a derive macro + | +help: remove from the surrounding `derive()` + --> $DIR/macro-path-prelude-fail-5.rs:4:17 + | +LL | #[derive(Debug, inline)] + | ^^^^^^ + = help: add as non-Derive macro + `#[inline]` + +error: expected derive macro, found built-in attribute `inline` + --> $DIR/macro-path-prelude-fail-5.rs:7:10 + | +LL | #[derive(inline, Debug)] + | ^^^^^^ not a derive macro + | +help: remove from the surrounding `derive()` + --> $DIR/macro-path-prelude-fail-5.rs:7:10 + | +LL | #[derive(inline, Debug)] + | ^^^^^^ + = help: add as non-Derive macro + `#[inline]` + +error: aborting due to 2 previous errors +