]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/front/feature_gate.rs
Replace all ~"" with "".to_owned()
[rust.git] / src / librustc / front / feature_gate.rs
index 5c0b9c8956519b0a24eb16cb25531e645935ee31..3ab39dd121f082aca119f359f69293b8863e4b42 100644 (file)
@@ -96,7 +96,7 @@ impl<'a> Context<'a> {
     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));
         }
@@ -260,8 +260,7 @@ fn visit_foreign_item(&mut self, i: &ast::ForeignItem, _: ()) {
 
     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");
@@ -340,7 +339,7 @@ pub fn check_crate(sess: &Session, krate: &ast::Crate) {
                             sess.add_lint(lint::UnknownFeatures,
                                           ast::CRATE_NODE_ID,
                                           mi.span,
-                                          ~"unknown feature");
+                                          "unknown feature".to_owned());
                         }
                     }
                 }