Skip to content

Commit 56b14b1

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

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

Diff for: compiler/rustc_codegen_cranelift/src/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
513513
);
514514
}
515515

516-
let have_labels = if asm_macro.diverges(options) {
516+
let have_labels = if asm_macro.diverges(*options) {
517517
!targets.is_empty()
518518
} else {
519519
targets.len() > 1

Diff for: 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)]

Diff for: 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)