diff options
| author | Michael Goulet <michael@errs.io> | 2025-03-20 03:21:58 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-03-20 03:22:46 +0000 |
| commit | e6004ccb50880f9667015eea2f3d90f30517abd1 (patch) | |
| tree | 524645ff6e78aa2f83df317688060713a2b1fe73 /compiler/rustc_const_eval/src | |
| parent | 2947be7af8732d1c298a15030325cc50c8910061 (diff) | |
| download | rust-e6004ccb50880f9667015eea2f3d90f30517abd1.tar.gz rust-e6004ccb50880f9667015eea2f3d90f30517abd1.zip | |
Use def_path_str for def id arg in UnsupportedOpInfo
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -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)); + }), } } } |
