Change span field accesses to method calls

This commit is contained in:
Jana Dönszelmann 2025-02-09 22:49:28 +01:00
parent f43e549b88
commit 115b3b03b0
No known key found for this signature in database
27 changed files with 264 additions and 202 deletions

View file

@ -62,18 +62,18 @@ impl SymbolNamesTest<'_> {
);
let mangled = tcx.symbol_name(instance);
tcx.dcx().emit_err(TestOutput {
span: attr.span,
span: attr.span(),
kind: Kind::SymbolName,
content: format!("{mangled}"),
});
if let Ok(demangling) = rustc_demangle::try_demangle(mangled.name) {
tcx.dcx().emit_err(TestOutput {
span: attr.span,
span: attr.span(),
kind: Kind::Demangling,
content: format!("{demangling}"),
});
tcx.dcx().emit_err(TestOutput {
span: attr.span,
span: attr.span(),
kind: Kind::DemanglingAlt,
content: format!("{demangling:#}"),
});
@ -82,7 +82,7 @@ impl SymbolNamesTest<'_> {
for attr in tcx.get_attrs(def_id, DEF_PATH) {
tcx.dcx().emit_err(TestOutput {
span: attr.span,
span: attr.span(),
kind: Kind::DefPath,
content: with_no_trimmed_paths!(tcx.def_path_str(def_id)),
});