Skip to content

Commit 947f6ca

Browse files
committed
Feature gate macro_reexport. Fixes #20906
1 parent c5961ad commit 947f6ca

File tree

8 files changed

+18
-1
lines changed

8 files changed

+18
-1
lines changed

src/libstd/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@
114114
#![feature(old_impl_check)]
115115
#![feature(optin_builtin_traits)]
116116
#![feature(int_uint)]
117-
#![feature(int_uint)]
118117
#![feature(core)]
119118
#![feature(libc)]
120119
#![feature(alloc)]
@@ -123,6 +122,7 @@
123122
#![feature(rand)]
124123
#![feature(hash)]
125124
#![cfg_attr(test, feature(test))]
125+
#![feature(macro_reexport)]
126126

127127
// Don't link to std. We are std.
128128
#![no_std]

src/libsyntax/feature_gate.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ static KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[
109109
// int and uint are now deprecated
110110
("int_uint", "1.0.0", Active),
111111

112+
// macro reexport needs more discusion and stabilization
113+
("macro_reexport", Active),
114+
112115
// These are used to test this portion of the compiler, they don't actually
113116
// mean anything
114117
("test_accepted_feature", "1.0.0", Accepted),
@@ -272,6 +275,10 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
272275
self.gate_feature("plugin", i.span,
273276
"compiler plugins are experimental \
274277
and possibly buggy");
278+
} else if attr::contains_name(&i.attrs[], "macro_reexport") {
279+
self.gate_feature("macro_reexport", i.span,
280+
"macros reexports are experimental \
281+
and possibly buggy");
275282
}
276283
}
277284

src/test/auxiliary/macro_reexport_2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
#![crate_type = "dylib"]
12+
#![feature(macro_reexport)]
1213

1314
#[macro_reexport(reexported)]
1415
#[macro_use] #[no_link]

src/test/auxiliary/macro_reexport_2_no_use.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
#![crate_type = "dylib"]
12+
#![feature(macro_reexport)]
1213

1314
#[macro_reexport(reexported)]
1415
#[no_link]

src/test/compile-fail/macro-reexport-malformed-1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(macro_reexport)]
12+
1113
#[macro_reexport] //~ ERROR bad macro reexport
1214
extern crate std;
1315

src/test/compile-fail/macro-reexport-malformed-2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(macro_reexport)]
12+
1113
#[macro_reexport="foo"] //~ ERROR bad macro reexport
1214
extern crate std;
1315

src/test/compile-fail/macro-reexport-malformed-3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(macro_reexport)]
12+
1113
#[macro_reexport(foo="bar")] //~ ERROR bad macro reexport
1214
extern crate std;
1315

src/test/compile-fail/macro-reexport-not-locally-visible.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
// aux-build:macro_reexport_1.rs
1212
// ignore-stage1
1313

14+
#![feature(macro_reexport)]
15+
1416
#[macro_reexport(reexported)]
1517
#[no_link]
1618
extern crate macro_reexport_1;

0 commit comments

Comments
 (0)