Skip to content

Commit 3b24de3

Browse files
committed
documents/fixes modules/mod-cfg-multiple-targets.rs
1 parent 98a1663 commit 3b24de3

File tree

1 file changed

+9
-33
lines changed

1 file changed

+9
-33
lines changed
+9-33
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,17 @@
1-
//@ run-pass
2-
3-
//! This test was to solve a bug as the rust notation for attributes on modules was transitioning
4-
//! from
5-
//!
6-
//! ```
7-
//! mod foo = "foo.rs";
8-
//! ```
9-
//!
10-
//! to
1+
//! Regression test to check that attributes for the first module get applied to the first module
2+
//! only and not to subsequent modules
113
//!
12-
//! ```
13-
//! #[path = "foo.rs"]
14-
//! mod foo;
15-
//! ```
16-
//!
17-
//! This specifically was testing when an attribute was being applied to all modules instead of the
18-
//! first one
19-
//!
20-
//! Added in commit: https://github.com/rust-lang/rust/commit/7aee9f7b56f8d96f9444ebb1d06e32e024b81974
21-
//! Issue : https://github.com/rust-lang/rust/issues/906
22-
23-
#[cfg(target_os = "linux")]
24-
mod hello {}
25-
26-
#[cfg(target_os = "macos")]
27-
mod hello {}
4+
//! Added in commit: <https://github.com/rust-lang/rust/commit/7aee9f7b56f8d96f9444ebb1d06e32e024b81974>
5+
//! Issue : <https://github.com/rust-lang/rust/issues/906>
286
29-
#[cfg(target_os = "windows")]
30-
mod hello {}
31-
32-
#[cfg(target_os = "freebsd")]
33-
mod hello {}
7+
//@ check-pass
8+
//@ compile-flags: --cfg=first
9+
//@ no-auto-check-cfg
3410

35-
#[cfg(target_os = "dragonfly")]
11+
#[cfg(first)]
3612
mod hello {}
3713

38-
#[cfg(target_os = "android")]
14+
#[cfg(not_set)]
3915
mod hello {}
4016

4117
fn main() {}

0 commit comments

Comments
 (0)