From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/attributes/main-removed-2/auxiliary/tokyo.rs | 12 ++++++++++++ src/test/ui/attributes/main-removed-2/main.rs | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/test/ui/attributes/main-removed-2/auxiliary/tokyo.rs create mode 100644 src/test/ui/attributes/main-removed-2/main.rs (limited to 'src/test/ui/attributes/main-removed-2') diff --git a/src/test/ui/attributes/main-removed-2/auxiliary/tokyo.rs b/src/test/ui/attributes/main-removed-2/auxiliary/tokyo.rs new file mode 100644 index 000000000..196b5be2d --- /dev/null +++ b/src/test/ui/attributes/main-removed-2/auxiliary/tokyo.rs @@ -0,0 +1,12 @@ +// force-host +// no-prefer-dynamic + +#![crate_type = "proc-macro"] + +extern crate proc_macro; +use proc_macro::TokenStream; + +#[proc_macro_attribute] +pub fn main(_: TokenStream, input: TokenStream) -> TokenStream { + "fn main() { println!(\"Hello Tokyo!\"); }".parse().unwrap() +} diff --git a/src/test/ui/attributes/main-removed-2/main.rs b/src/test/ui/attributes/main-removed-2/main.rs new file mode 100644 index 000000000..e8fecf825 --- /dev/null +++ b/src/test/ui/attributes/main-removed-2/main.rs @@ -0,0 +1,11 @@ +// run-pass +// aux-build:tokyo.rs +// compile-flags:--extern tokyo +// edition:2021 + +use tokyo::main; + +#[main] +fn main() { + panic!("the #[main] macro should replace this with non-panicking code") +} -- cgit v1.2.3