parent
e2a9c04e19
commit
538288176a
10 changed files with 147 additions and 1 deletions
17
src/test/auxiliary/macro_reexport_1.rs
Normal file
17
src/test/auxiliary/macro_reexport_1.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// 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.
|
||||
|
||||
#![crate_type = "dylib"]
|
||||
#![feature(macro_rules)]
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! reexported {
|
||||
() => ( 3u )
|
||||
}
|
||||
17
src/test/auxiliary/macro_reexport_2.rs
Normal file
17
src/test/auxiliary/macro_reexport_2.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// 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.
|
||||
|
||||
#![crate_type = "dylib"]
|
||||
#![feature(phase)]
|
||||
|
||||
#![macro_reexport(reexported)]
|
||||
|
||||
#[phase(plugin)]
|
||||
extern crate macro_reexport_1;
|
||||
13
src/test/compile-fail/macro-reexport-malformed-1.rs
Normal file
13
src/test/compile-fail/macro-reexport-malformed-1.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// 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.
|
||||
|
||||
#![macro_reexport] //~ ERROR malformed macro_reexport attribute
|
||||
|
||||
fn main() { }
|
||||
13
src/test/compile-fail/macro-reexport-malformed-2.rs
Normal file
13
src/test/compile-fail/macro-reexport-malformed-2.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// 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.
|
||||
|
||||
#![macro_reexport="foo"] //~ ERROR malformed macro_reexport attribute
|
||||
|
||||
fn main() { }
|
||||
13
src/test/compile-fail/macro-reexport-malformed-3.rs
Normal file
13
src/test/compile-fail/macro-reexport-malformed-3.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// 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.
|
||||
|
||||
#![macro_reexport(foo="bar")] //~ ERROR malformed macro_reexport attribute
|
||||
|
||||
fn main() { }
|
||||
22
src/test/run-pass/macro-reexport.rs
Normal file
22
src/test/run-pass/macro-reexport.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// 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.
|
||||
|
||||
// aux-build:macro_reexport_1.rs
|
||||
// aux-build:macro_reexport_2.rs
|
||||
// ignore-stage1
|
||||
|
||||
#![feature(phase)]
|
||||
|
||||
#[phase(plugin)]
|
||||
extern crate macro_reexport_2;
|
||||
|
||||
fn main() {
|
||||
assert_eq!(reexported!(), 3u);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue