diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-02-11 01:37:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-11 01:37:56 +0100 |
| commit | 09bbcd6667631e31c63e9f8d1c930e2bab5ebeb3 (patch) | |
| tree | 3dd2836d5ffdfc3c422abb9c54688f5c06842fea /compiler/rustc_const_eval/src | |
| parent | e82e087582112a4a6082afc9b826392438a8b324 (diff) | |
| parent | d56f3b6a5ddbdf6af0c2fb6b7a8327d698e2e228 (diff) | |
| download | rust-09bbcd6667631e31c63e9f8d1c930e2bab5ebeb3.tar.gz rust-09bbcd6667631e31c63e9f8d1c930e2bab5ebeb3.zip | |
Rollup merge of #120883 - RalfJung:extern-static-err, r=oli-obk
interpret: rename ReadExternStatic → ExternStatic This error shows up for reads and writes, so `ReadExternStatic` is misleading.
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/errors.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/memory.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/errors.rs b/compiler/rustc_const_eval/src/errors.rs index 5f7c78b0b96..a649526c196 100644 --- a/compiler/rustc_const_eval/src/errors.rs +++ b/compiler/rustc_const_eval/src/errors.rs @@ -799,7 +799,7 @@ impl ReportErrorExt for UnsupportedOpInfo { UnsupportedOpInfo::ReadPartialPointer(_) => const_eval_partial_pointer_copy, UnsupportedOpInfo::ReadPointerAsInt(_) => const_eval_read_pointer_as_int, UnsupportedOpInfo::ThreadLocalStatic(_) => const_eval_thread_local_static, - UnsupportedOpInfo::ReadExternStatic(_) => const_eval_read_extern_static, + UnsupportedOpInfo::ExternStatic(_) => const_eval_extern_static, } } fn add_args<G: EmissionGuarantee>(self, _: &DiagCtxt, builder: &mut DiagnosticBuilder<'_, G>) { @@ -818,7 +818,7 @@ impl ReportErrorExt for UnsupportedOpInfo { OverwritePartialPointer(ptr) | ReadPartialPointer(ptr) => { builder.arg("ptr", ptr); } - ThreadLocalStatic(did) | ReadExternStatic(did) => { + ThreadLocalStatic(did) | ExternStatic(did) => { builder.arg("did", format!("{did:?}")); } } diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs index 38ad8cbf3a6..4acf4ed893c 100644 --- a/compiler/rustc_const_eval/src/interpret/memory.rs +++ b/compiler/rustc_const_eval/src/interpret/memory.rs @@ -557,7 +557,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { if self.tcx.is_foreign_item(def_id) { // This is unreachable in Miri, but can happen in CTFE where we actually *do* support // referencing arbitrary (declared) extern statics. - throw_unsup!(ReadExternStatic(def_id)); + throw_unsup!(ExternStatic(def_id)); } // We don't give a span -- statics don't need that, they cannot be generic or associated. |
