From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- third_party/rust/proc-macro-hack/tests/ui/private.rs | 8 ++++++++ third_party/rust/proc-macro-hack/tests/ui/private.stderr | 5 +++++ third_party/rust/proc-macro-hack/tests/ui/unexpected-arg.rs | 8 ++++++++ third_party/rust/proc-macro-hack/tests/ui/unexpected-arg.stderr | 5 +++++ third_party/rust/proc-macro-hack/tests/ui/unexpected.rs | 6 ++++++ third_party/rust/proc-macro-hack/tests/ui/unexpected.stderr | 5 +++++ third_party/rust/proc-macro-hack/tests/ui/unknown-arg.rs | 6 ++++++ third_party/rust/proc-macro-hack/tests/ui/unknown-arg.stderr | 5 +++++ 8 files changed, 48 insertions(+) create mode 100644 third_party/rust/proc-macro-hack/tests/ui/private.rs create mode 100644 third_party/rust/proc-macro-hack/tests/ui/private.stderr create mode 100644 third_party/rust/proc-macro-hack/tests/ui/unexpected-arg.rs create mode 100644 third_party/rust/proc-macro-hack/tests/ui/unexpected-arg.stderr create mode 100644 third_party/rust/proc-macro-hack/tests/ui/unexpected.rs create mode 100644 third_party/rust/proc-macro-hack/tests/ui/unexpected.stderr create mode 100644 third_party/rust/proc-macro-hack/tests/ui/unknown-arg.rs create mode 100644 third_party/rust/proc-macro-hack/tests/ui/unknown-arg.stderr (limited to 'third_party/rust/proc-macro-hack/tests/ui') diff --git a/third_party/rust/proc-macro-hack/tests/ui/private.rs b/third_party/rust/proc-macro-hack/tests/ui/private.rs new file mode 100644 index 0000000000..1ab84446c7 --- /dev/null +++ b/third_party/rust/proc-macro-hack/tests/ui/private.rs @@ -0,0 +1,8 @@ +use proc_macro_hack::proc_macro_hack; + +#[proc_macro_hack] +fn my_macro(input: TokenStream) -> TokenStream { + unimplemented!() +} + +fn main() {} diff --git a/third_party/rust/proc-macro-hack/tests/ui/private.stderr b/third_party/rust/proc-macro-hack/tests/ui/private.stderr new file mode 100644 index 0000000000..d3a3ea7ed4 --- /dev/null +++ b/third_party/rust/proc-macro-hack/tests/ui/private.stderr @@ -0,0 +1,5 @@ +error: functions tagged with `#[proc_macro_hack]` must be `pub` + --> tests/ui/private.rs:4:1 + | +4 | fn my_macro(input: TokenStream) -> TokenStream { + | ^^ diff --git a/third_party/rust/proc-macro-hack/tests/ui/unexpected-arg.rs b/third_party/rust/proc-macro-hack/tests/ui/unexpected-arg.rs new file mode 100644 index 0000000000..376fc0d986 --- /dev/null +++ b/third_party/rust/proc-macro-hack/tests/ui/unexpected-arg.rs @@ -0,0 +1,8 @@ +use proc_macro_hack::proc_macro_hack; + +#[proc_macro_hack(fake_call_site)] +pub fn my_macro(input: TokenStream) -> TokenStream { + unimplemented!() +} + +fn main() {} diff --git a/third_party/rust/proc-macro-hack/tests/ui/unexpected-arg.stderr b/third_party/rust/proc-macro-hack/tests/ui/unexpected-arg.stderr new file mode 100644 index 0000000000..f32f05a1cd --- /dev/null +++ b/third_party/rust/proc-macro-hack/tests/ui/unexpected-arg.stderr @@ -0,0 +1,5 @@ +error: unexpected argument to proc_macro_hack macro implementation; args are only accepted on the macro declaration (the `pub use`) + --> tests/ui/unexpected-arg.rs:3:19 + | +3 | #[proc_macro_hack(fake_call_site)] + | ^^^^^^^^^^^^^^ diff --git a/third_party/rust/proc-macro-hack/tests/ui/unexpected.rs b/third_party/rust/proc-macro-hack/tests/ui/unexpected.rs new file mode 100644 index 0000000000..122ded5191 --- /dev/null +++ b/third_party/rust/proc-macro-hack/tests/ui/unexpected.rs @@ -0,0 +1,6 @@ +use proc_macro_hack::proc_macro_hack; + +#[proc_macro_hack] +pub struct What; + +fn main() {} diff --git a/third_party/rust/proc-macro-hack/tests/ui/unexpected.stderr b/third_party/rust/proc-macro-hack/tests/ui/unexpected.stderr new file mode 100644 index 0000000000..60761b5149 --- /dev/null +++ b/third_party/rust/proc-macro-hack/tests/ui/unexpected.stderr @@ -0,0 +1,5 @@ +error: unexpected input to #[proc_macro_hack] + --> tests/ui/unexpected.rs:4:5 + | +4 | pub struct What; + | ^^^^^^ diff --git a/third_party/rust/proc-macro-hack/tests/ui/unknown-arg.rs b/third_party/rust/proc-macro-hack/tests/ui/unknown-arg.rs new file mode 100644 index 0000000000..aa9b82c8f4 --- /dev/null +++ b/third_party/rust/proc-macro-hack/tests/ui/unknown-arg.rs @@ -0,0 +1,6 @@ +use proc_macro_hack::proc_macro_hack; + +#[proc_macro_hack(fake_call_site, support_nexted)] +pub use demo::some_macro; + +fn main() {} diff --git a/third_party/rust/proc-macro-hack/tests/ui/unknown-arg.stderr b/third_party/rust/proc-macro-hack/tests/ui/unknown-arg.stderr new file mode 100644 index 0000000000..772e6673d0 --- /dev/null +++ b/third_party/rust/proc-macro-hack/tests/ui/unknown-arg.stderr @@ -0,0 +1,5 @@ +error: expected one of: `support_nested`, `internal_macro_calls`, `fake_call_site`, `only_hack_old_rustc` + --> tests/ui/unknown-arg.rs:3:35 + | +3 | #[proc_macro_hack(fake_call_site, support_nexted)] + | ^^^^^^^^^^^^^^ -- cgit v1.2.3