Skip to content

Commit d2aa0e0

Browse files
committed
remove suggestion that cannot always be applied
1 parent 7a0922c commit d2aa0e0

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

compiler/rustc_passes/src/errors.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1191,8 +1191,6 @@ impl<G: EmissionGuarantee> Diagnostic<'_, G> for NakedFunctionsAsmBlock {
11911191
pub(crate) struct NakedFunctionsMustNakedAsm {
11921192
#[primary_span]
11931193
pub span: Span,
1194-
#[suggestion(code = "naked_asm!", applicability = "machine-applicable")]
1195-
pub macro_span: Span,
11961194
}
11971195

11981196
#[derive(Diagnostic)]

compiler/rustc_passes/src/naked_functions.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_middle::query::Providers;
99
use rustc_middle::ty::TyCtxt;
1010
use rustc_session::lint::builtin::UNDEFINED_NAKED_FUNCTION_ABI;
1111
use rustc_span::symbol::sym;
12-
use rustc_span::{BytePos, Span};
12+
use rustc_span::Span;
1313
use rustc_target::spec::abi::Abi;
1414

1515
use crate::errors::{
@@ -133,10 +133,7 @@ fn check_asm<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId, body: &'tcx hir::Body<
133133
ItemKind::InlineAsm => {
134134
has_err = true;
135135

136-
// the span that contains the `asm!` call,
137-
// so tooling can replace it with `naked_asm!`
138-
let macro_span = span.with_hi(span.lo() + BytePos("asm!".len() as u32));
139-
tcx.dcx().emit_err(NakedFunctionsMustNakedAsm { span, macro_span });
136+
tcx.dcx().emit_err(NakedFunctionsMustNakedAsm { span });
140137
}
141138
ItemKind::NonAsm => {
142139
must_show_error = true;

0 commit comments

Comments
 (0)