提交 72e0e595 编写于 作者: N nxnfufunezn

Updated librustc_lint/builtin.rs to use span_lint_note

上级 99ae898c
......@@ -1255,15 +1255,12 @@ fn check_crate(&mut self, ctx: &LateContext, _: &hir::Crate) {
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");
}
}
_ => {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册