diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-08-12 08:30:48 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-08-13 20:08:45 +0000 |
| commit | 4943e96a0c62338a15ad4cc8533d3d4e78ace5b0 (patch) | |
| tree | 4fbdb2e45422733de76379606b7939d968839602 | |
| parent | b08043ee69d45ebe048d1a3d48bce8c52ccffc60 (diff) | |
| download | rust-4943e96a0c62338a15ad4cc8533d3d4e78ace5b0.tar.gz rust-4943e96a0c62338a15ad4cc8533d3d4e78ace5b0.zip | |
Add regression test.
| -rw-r--r-- | src/test/compile-fail/cfg_attr_path.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/test/compile-fail/cfg_attr_path.rs b/src/test/compile-fail/cfg_attr_path.rs index 502768cc44e..7d799850a65 100644 --- a/src/test/compile-fail/cfg_attr_path.rs +++ b/src/test/compile-fail/cfg_attr_path.rs @@ -8,5 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[cfg_attr(all(), path = "nonexistent_file.rs")] mod foo; -//~^ ERROR nonexistent_file.rs +#![feature(rustc_attrs)] +#![allow(dead_code)] +#![deny(unused_attributes)] // c.f #35584 + +mod auxiliary { + #[cfg_attr(any(), path = "nonexistent_file.rs")] pub mod namespaced_enums; + #[cfg_attr(all(), path = "namespaced_enums.rs")] pub mod nonexistent_file; +} + +#[rustc_error] +fn main() { //~ ERROR compilation successful + let _ = auxiliary::namespaced_enums::Foo::A; + let _ = auxiliary::nonexistent_file::Foo::A; +} |
