improves outer mod attribute test
This commit is contained in:
parent
9fb94b32df
commit
9f06585c0e
2 changed files with 16 additions and 25 deletions
16
tests/ui/attributes/outer-mod-attr-applies-only-to-first.rs
Normal file
16
tests/ui/attributes/outer-mod-attr-applies-only-to-first.rs
Normal 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() {}
|
|
@ -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() {}
|
Loading…
Add table
Add a link
Reference in a new issue