Skip to content

Commit

Permalink
Add regression test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jseyfried committed Aug 12, 2016
1 parent 9b9aae8 commit 9794fe5
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/test/compile-fail/cfg_attr_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 9794fe5

Please sign in to comment.