From 72e0e59574a6b1abfdeb723e844d425c893647de Mon Sep 17 00:00:00 2001 From: nxnfufunezn Date: Sat, 17 Oct 2015 02:14:26 +0530 Subject: [PATCH] Updated librustc_lint/builtin.rs to use span_lint_note --- src/librustc_lint/builtin.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index f5a58656080..0726d9ca259 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -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"); } } _ => {} -- GitLab