]> git.lizzy.rs Git - rust.git/commitdiff
librustc: Improve error message for missing feature attributes.
authorKevin Butler <haqkrs@gmail.com>
Fri, 11 Apr 2014 23:25:32 +0000 (00:25 +0100)
committerKevin Butler <haqkrs@gmail.com>
Fri, 11 Apr 2014 23:25:32 +0000 (00:25 +0100)
src/librustc/front/feature_gate.rs
src/librustc/middle/typeck/check/mod.rs

index 5c0b9c8956519b0a24eb16cb25531e645935ee31..4412093c6eb0563b9866cf0040ee92e833581861 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));
         }
index 3c28f2bac279ef2dae714ae634187faa5de59299..6898713c765d73b2a5149d1af1b12e7dcc2872b6 100644 (file)
@@ -3714,7 +3714,7 @@ pub fn instantiate_path(fcx: &FnCtxt,
             && !fcx.tcx().sess.features.default_type_params.get() {
             fcx.tcx().sess.span_err(pth.span, "default type parameters are \
                                                experimental and possibly buggy");
-            fcx.tcx().sess.span_note(pth.span, "add #[feature(default_type_params)] \
+            fcx.tcx().sess.span_note(pth.span, "add #![feature(default_type_params)] \
                                                 to the crate attributes to enable");
         }