Skip to content

Commit be974bf

Browse files
committed
auto merge of #11842 : xales/rust/feature-gates, r=cmr
Fixes #11631
2 parents b0280ac + b23fd08 commit be974bf

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

src/librustc/front/feature_gate.rs

+5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
4646
("phase", Active),
4747
("macro_registrar", Active),
4848
("log_syntax", Active),
49+
("trace_macros", Active),
4950

5051
// These are used to test this portion of the compiler, they don't actually
5152
// mean anything
@@ -193,6 +194,10 @@ impl Visitor<()> for Context {
193194
self.gate_feature("log_syntax", path.span, "`log_syntax!` is not \
194195
stable enough for use and is subject to change");
195196
}
197+
else if path.segments.last().unwrap().identifier == self.sess.ident_of("trace_macros") {
198+
self.gate_feature("trace_macros", path.span, "`trace_macros` is not \
199+
stable enough for use and is subject to change");
200+
}
196201
}
197202

198203
fn visit_ty(&mut self, t: &ast::Ty, _: ()) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// xfail-fast feature doesn't work.
12+
13+
fn main() {
14+
trace_macros!(true); //~ ERROR: `trace_macros` is not stable
15+
}

src/test/compile-fail/macros-nonfatal-errors.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// immediately, so that we get more errors listed at a time.
1313

1414
#[feature(asm)];
15+
#[feature(trace_macros)];
1516

1617
#[deriving(Default, //~ ERROR
1718
Rand, //~ ERROR

0 commit comments

Comments
 (0)