Reimplement lowering of sym operands for asm! so that it also works with global_asm!

This commit is contained in:
Amanieu d'Antras 2022-03-01 00:50:56 +00:00
parent f9d4d12b6a
commit dc345d8bff
28 changed files with 400 additions and 163 deletions

View file

@ -1012,6 +1012,12 @@ impl<'a> Resolver<'a> {
err.span_label(trait_item_span, "item in trait");
err
}
ResolutionError::InvalidAsmSym => {
let mut err = self.session.struct_span_err(span, "invalid `sym` operand");
err.span_label(span, &format!("is a local variable"));
err.help("`sym` operands must refer to either a function or a static");
err
}
}
}