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));
}
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());
}
}
}