/// lints elsewhere in the compiler should call
/// `Session::add_lint()` instead.
pub fn raw_emit_lint(sess: &Session,
+ lints: &LintStore,
lint: &'static Lint,
lvlsrc: LevelSource,
span: Option<Span>,
msg: &str) {
- raw_struct_lint(sess, lint, lvlsrc, span, msg).emit();
+ raw_struct_lint(sess, lints, lint, lvlsrc, span, msg).emit();
}
pub fn raw_struct_lint<'a>(sess: &'a Session,
+ lints: &LintStore,
lint: &'static Lint,
lvlsrc: LevelSource,
span: Option<Span>,
_ => sess.bug("impossible level in raw_emit_lint"),
};
+ // Check for future incompatibility lints and issue a stronger warning.
+ let future_incompat_lints = &lints.lint_groups[builtin::FUTURE_INCOMPATIBLE];
+ let this_id = LintId::of(lint);
+ if future_incompat_lints.0.iter().any(|&id| id == this_id) {
+ let msg = "this lint will become a HARD ERROR in a future release!";
+ if let Some(sp) = span {
+ err.span_note(sp, msg);
+ } else {
+ err.note(msg);
+ }
+ }
+
if let Some(span) = def {
err.span_note(span, "lint level defined here");
}
Some(pair) => pair,
};
- raw_emit_lint(&self.sess(), lint, (level, src), span, msg);
+ raw_emit_lint(&self.sess(), self.lints(), lint, (level, src), span, msg);
}
fn lookup(&self,
Some(pair) => pair,
};
- raw_struct_lint(&self.sess(), lint, (level, src), span, msg)
+ raw_struct_lint(&self.sess(), self.lints(), lint, (level, src), span, msg)
}
/// Emit a lint at the appropriate level, for a particular span.