for (lint_id, level, span) in v {
let (now, now_source) = self.lints().get_level_source(lint_id);
if now == Forbid && level != Forbid {
- let lint_name = lint_id.as_str();
+ let lint_name = lint_id.to_string();
let mut diag_builder = struct_span_err!(self.sess(), span, E0453,
"{}({}) overruled by outer forbid({})",
level.as_str(), lint_name,
lint_name);
+ diag_builder.span_label(span, &format!("overruled by previous forbid"));
match now_source {
LintSource::Default => &mut diag_builder,
LintSource::Node(forbid_source_span) => {
- diag_builder.span_note(forbid_source_span,
- "`forbid` lint level set here")
+ diag_builder.span_label(forbid_source_span,
+ &format!("`forbid` level set here"))
},
LintSource::CommandLine => {
diag_builder.note("`forbid` lint level was set on command line")
for &(lint, span, ref msg) in v {
span_bug!(span,
"unprocessed lint {} at {}: {}",
- lint.as_str(), tcx.map.node_to_string(*id), *msg)
+ lint.to_string(), tcx.map.node_to_string(*id), *msg)
}
}
// in the iteration code.
for (_, v) in sess.lints.borrow().iter() {
for &(lint, span, ref msg) in v {
- span_bug!(span, "unprocessed lint {}: {}", lint.as_str(), *msg)
+ span_bug!(span, "unprocessed lint {}: {}", lint.to_string(), *msg)
}
}
}