2014-02-05 16:33:10 -06:00
|
|
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2015-02-14 04:45:43 -06:00
|
|
|
#![feature(custom_attribute)]
|
|
|
|
|
2015-01-02 16:44:21 -06:00
|
|
|
macro_rules! test { ($nm:ident,
|
2014-03-26 18:14:07 -05:00
|
|
|
#[$a:meta],
|
2015-01-02 16:44:21 -06:00
|
|
|
$i:item) => (mod $nm { #![$a] $i }); }
|
2013-08-08 12:28:06 -05:00
|
|
|
|
|
|
|
test!(a,
|
|
|
|
#[cfg(qux)],
|
2014-11-14 11:18:10 -06:00
|
|
|
pub fn bar() { });
|
2013-08-08 12:28:06 -05:00
|
|
|
|
|
|
|
test!(b,
|
|
|
|
#[cfg(not(qux))],
|
2014-11-14 11:18:10 -06:00
|
|
|
pub fn bar() { });
|
2013-08-08 12:28:06 -05:00
|
|
|
|
|
|
|
#[qux]
|
|
|
|
fn main() {
|
|
|
|
a::bar();
|
2014-11-28 22:08:30 -06:00
|
|
|
//~^ ERROR failed to resolve. Use of undeclared type or module `a`
|
2013-08-08 12:28:06 -05:00
|
|
|
b::bar();
|
|
|
|
}
|