From c48a3efb17f20453a44260411f87a6818cbcf8dd Mon Sep 17 00:00:00 2001 From: Kevin Butler Date: Sat, 12 Apr 2014 00:25:32 +0100 Subject: [PATCH] librustc: Improve error message for missing feature attributes. --- src/librustc/front/feature_gate.rs | 2 +- src/librustc/middle/typeck/check/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc/front/feature_gate.rs b/src/librustc/front/feature_gate.rs index 5c0b9c89565..4412093c6eb 100644 --- a/src/librustc/front/feature_gate.rs +++ b/src/librustc/front/feature_gate.rs @@ -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)); } diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index 3c28f2bac27..6898713c765 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -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"); }