librustc: Improve error message for missing feature attributes.
This commit is contained in:
parent
8b6091e8f1
commit
c48a3efb17
@ -96,7 +96,7 @@ impl<'a> Context<'a> {
|
|||||||
fn gate_feature(&self, feature: &str, span: Span, explain: &str) {
|
fn gate_feature(&self, feature: &str, span: Span, explain: &str) {
|
||||||
if !self.has_feature(feature) {
|
if !self.has_feature(feature) {
|
||||||
self.sess.span_err(span, explain);
|
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",
|
crate attributes to enable",
|
||||||
feature));
|
feature));
|
||||||
}
|
}
|
||||||
|
@ -3714,7 +3714,7 @@ pub fn instantiate_path(fcx: &FnCtxt,
|
|||||||
&& !fcx.tcx().sess.features.default_type_params.get() {
|
&& !fcx.tcx().sess.features.default_type_params.get() {
|
||||||
fcx.tcx().sess.span_err(pth.span, "default type parameters are \
|
fcx.tcx().sess.span_err(pth.span, "default type parameters are \
|
||||||
experimental and possibly buggy");
|
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");
|
to the crate attributes to enable");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user