use driver::session::Session;
use std::cell::Cell;
-use std::vec_ng::Vec;
/// This is a list of all known features since the beginning of time. This list
/// can never shrink, it may only be expanded (in order to prevent old programs
("macro_registrar", Active),
("log_syntax", Active),
("trace_macros", Active),
+ ("concat_idents", Active),
+
("simd", Active),
("default_type_params", Active),
("quote", Active),
/// A set of features to be used by later passes.
pub struct Features {
- default_type_params: Cell<bool>
+ pub default_type_params: Cell<bool>
}
impl Features {
fn gate_feature(&self, feature: &str, span: Span, explain: &str) {
if !self.has_feature(feature) {
self.sess.span_err(span, explain);
- self.sess.span_note(span, format!("add \\#[feature({})] to the \
+ self.sess.span_note(span, format!("add \\#![feature({})] to the \
crate attributes to enable",
feature));
}
stable enough for use and is subject to change");
}
+ else if id == token::str_to_ident("concat_idents") {
+ self.gate_feature("concat_idents", path.span, "`concat_idents` is not \
+ stable enough for use and is subject to change");
+ }
+
else {
for "e in quotes.iter() {
if id == token::str_to_ident(quote) {
fn visit_ty(&mut self, t: &ast::Ty, _: ()) {
match t.node {
- ast::TyClosure(closure) if closure.onceness == ast::Once &&
- closure.sigil != ast::OwnedSigil => {
+ ast::TyClosure(closure, _) if closure.onceness == ast::Once => {
self.gate_feature("once_fns", t.span,
"once functions are \
experimental and likely to be removed");
sess.add_lint(lint::UnknownFeatures,
ast::CRATE_NODE_ID,
mi.span,
- ~"unknown feature");
+ "unknown feature".to_owned());
}
}
}