1
Fork 0

improves outer mod attribute test

This commit is contained in:
Spencer 2025-03-12 22:22:20 -06:00
parent 9fb94b32df
commit 9f06585c0e
2 changed files with 16 additions and 25 deletions

View file

@ -0,0 +1,16 @@
//! Regression test to check that outer attributes applied to the first module item is applied to
//! its attached module item only, and not also to other subsequent module items
//!
//! Commit: <https://github.com/rust-lang/rust/commit/7aee9f7b56f8d96f9444ebb1d06e32e024b81974>
//@ check-pass
//@ compile-flags: --cfg=first
//@ no-auto-check-cfg
#[cfg(first)]
mod hello {}
#[cfg(not_set)]
mod hello {}
fn main() {}

View file

@ -1,25 +0,0 @@
//@ run-pass
// Regression test for a problem with the first mod attribute
// being applied to every mod
#[cfg(target_os = "linux")]
mod hello {}
#[cfg(target_os = "macos")]
mod hello {}
#[cfg(target_os = "windows")]
mod hello {}
#[cfg(target_os = "freebsd")]
mod hello {}
#[cfg(target_os = "dragonfly")]
mod hello {}
#[cfg(target_os = "android")]
mod hello {}
fn main() {}