Updated librustc_lint/builtin.rs to use span_lint_note

This commit is contained in:
nxnfufunezn 2015-10-17 02:14:26 +05:30
parent 99ae898c57
commit 72e0e59574

View File

@ -1255,15 +1255,12 @@ impl LateLintPass for DropWithReprExtern {
codemap::DUMMY_SP);
let self_defn_span = ctx.tcx.map.def_id_span(self_type_did,
codemap::DUMMY_SP);
ctx.span_lint(DROP_WITH_REPR_EXTERN,
drop_impl_span,
"implementing Drop adds hidden state to types, \
possibly conflicting with `#[repr(C)]`");
// FIXME #19668: could be span_lint_note instead of manual guard.
if ctx.current_level(DROP_WITH_REPR_EXTERN) != Level::Allow {
ctx.sess().span_note(self_defn_span,
"the `#[repr(C)]` attribute is attached here");
}
ctx.span_lint_note(DROP_WITH_REPR_EXTERN,
drop_impl_span,
"implementing Drop adds hidden state to types, \
possibly conflicting with `#[repr(C)]`",
self_defn_span,
"the `#[repr(C)]` attribute is attached here");
}
}
_ => {}