lint: port asm labels diagnostics

Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
David Wood 2022-06-28 15:16:49 +01:00
parent 5524ca1a1d
commit fedd4c63f8
2 changed files with 3 additions and 3 deletions

View file

@ -396,3 +396,5 @@ lint-builtin-clashing-extern-diff-name = `{$this_fi}` redeclares `{$orig}` with
lint-builtin-deref-nullptr = dereferencing a null pointer
.label = this code causes undefined behavior when executed
lint-builtin-asm-labels = avoid using named labels in inline assembly

View file

@ -3182,9 +3182,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) {
NAMED_ASM_LABELS,
Some(target_spans),
|diag| {
let mut err =
diag.build("avoid using named labels in inline assembly");
err.emit();
diag.build(fluent::lint::builtin_asm_labels).emit();
},
BuiltinLintDiagnostics::NamedAsmLabel(
"only local labels of the form `<number>:` should be used in inline asm"