From: Arthur Cohen Date: Wed, 2 Aug 2023 10:56:03 +0000 (+0200) Subject: gccrs: nr2.0: Add macros 2.0 resolution testcase. X-Git-Tag: basepoints/gcc-15~2246 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e99ee91a959cd29e6776c2262512d424ddfeb027;p=thirdparty%2Fgcc.git gccrs: nr2.0: Add macros 2.0 resolution testcase. gcc/testsuite/ChangeLog: * rust/compile/name_resolution10.rs: New test. --- diff --git a/gcc/testsuite/rust/compile/name_resolution10.rs b/gcc/testsuite/rust/compile/name_resolution10.rs new file mode 100644 index 000000000000..33643bd1a147 --- /dev/null +++ b/gcc/testsuite/rust/compile/name_resolution10.rs @@ -0,0 +1,19 @@ +// { dg-options "-frust-name-resolution-2.0 -frust-compile-until=lowering" } + +#![feature(decl_macro)] + +pub mod foo { + pub mod bar { + pub mod baz { + // macros 2.0 get inserted in Ribs like items + pub macro boof() {} + } + } +} + +#[macro_export] +fn main() { + foo::bar::baz::boof!(); + crate::foo::bar::baz::boof!(); + self::foo::bar::baz::boof!(); +}