diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-03-20 22:34:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-20 22:34:06 +0100 |
| commit | 73ed8b3ace71b8d5deef993e78b936d352d29348 (patch) | |
| tree | a14cb8541ec51418db352663d8a3a4c0dbba19e1 /compiler/rustc_const_eval/src/errors.rs | |
| parent | 7df0170fc4c285e0876fd398ceaff05f84164ce3 (diff) | |
| parent | e6004ccb50880f9667015eea2f3d90f30517abd1 (diff) | |
| download | rust-73ed8b3ace71b8d5deef993e78b936d352d29348.tar.gz rust-73ed8b3ace71b8d5deef993e78b936d352d29348.zip | |
Rollup merge of #138732 - compiler-errors:did, r=jieyouxu
Use `def_path_str` for def id arg in `UnsupportedOpInfo` We could alternatively just omit the def path from the label, but I think it's fine to keep around Fixes #138730
Diffstat (limited to 'compiler/rustc_const_eval/src/errors.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/errors.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/errors.rs b/compiler/rustc_const_eval/src/errors.rs index b020eeccf71..e2675e2f4c9 100644 --- a/compiler/rustc_const_eval/src/errors.rs +++ b/compiler/rustc_const_eval/src/errors.rs @@ -898,6 +898,7 @@ impl ReportErrorExt for UnsupportedOpInfo { UnsupportedOpInfo::ExternStatic(_) => const_eval_extern_static, } } + fn add_args<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) { use UnsupportedOpInfo::*; @@ -917,9 +918,9 @@ impl ReportErrorExt for UnsupportedOpInfo { OverwritePartialPointer(ptr) | ReadPartialPointer(ptr) => { diag.arg("ptr", ptr); } - ThreadLocalStatic(did) | ExternStatic(did) => { - diag.arg("did", format!("{did:?}")); - } + ThreadLocalStatic(did) | ExternStatic(did) => rustc_middle::ty::tls::with(|tcx| { + diag.arg("did", tcx.def_path_str(did)); + }), } } } |
