Skip to content

Commit 72e0e59

Browse files
committed
Updated librustc_lint/builtin.rs to use span_lint_note
1 parent 99ae898 commit 72e0e59

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/librustc_lint/builtin.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,15 +1255,12 @@ impl LateLintPass for DropWithReprExtern {
12551255
codemap::DUMMY_SP);
12561256
let self_defn_span = ctx.tcx.map.def_id_span(self_type_did,
12571257
codemap::DUMMY_SP);
1258-
ctx.span_lint(DROP_WITH_REPR_EXTERN,
1259-
drop_impl_span,
1260-
"implementing Drop adds hidden state to types, \
1261-
possibly conflicting with `#[repr(C)]`");
1262-
// FIXME #19668: could be span_lint_note instead of manual guard.
1263-
if ctx.current_level(DROP_WITH_REPR_EXTERN) != Level::Allow {
1264-
ctx.sess().span_note(self_defn_span,
1265-
"the `#[repr(C)]` attribute is attached here");
1266-
}
1258+
ctx.span_lint_note(DROP_WITH_REPR_EXTERN,
1259+
drop_impl_span,
1260+
"implementing Drop adds hidden state to types, \
1261+
possibly conflicting with `#[repr(C)]`",
1262+
self_defn_span,
1263+
"the `#[repr(C)]` attribute is attached here");
12671264
}
12681265
}
12691266
_ => {}

0 commit comments

Comments
 (0)