diff --git a/rust-version b/rust-version index bdf2416a20..ad3a534b7e 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -94807670a6a3834cc9b71b0b803d49d307c9ba5d +3deb9bbf84f6431ebcbb7cbdbe3d89bc2636bc1b diff --git a/src/bin/miri.rs b/src/bin/miri.rs index aead55a699..e8e10f64ad 100644 --- a/src/bin/miri.rs +++ b/src/bin/miri.rs @@ -165,7 +165,6 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls { level: SymbolExportLevel::C, kind: SymbolExportKind::Text, used: false, - used_compiler: false, }, )) }), diff --git a/src/diagnostics.rs b/src/diagnostics.rs index d3d4490f30..bf3284df59 100644 --- a/src/diagnostics.rs +++ b/src/diagnostics.rs @@ -455,7 +455,7 @@ pub fn report_msg<'tcx>( let sess = machine.tcx.sess; let level = match diag_level { DiagLevel::Error => Level::Error, - DiagLevel::Warning => Level::Warning(None), + DiagLevel::Warning => Level::Warning, DiagLevel::Note => Level::Note, }; let mut err = DiagnosticBuilder::<()>::new(sess.dcx(), level, title); @@ -499,14 +499,12 @@ pub fn report_msg<'tcx>( err.note(if extra_span { "BACKTRACE (of the first span):" } else { "BACKTRACE:" }); } - let (mut err, handler) = err.into_diagnostic().unwrap(); - // Add backtrace for (idx, frame_info) in stacktrace.iter().enumerate() { let is_local = machine.is_local(frame_info); // No span for non-local frames and the first frame (which is the error site). if is_local && idx > 0 { - err.eager_subdiagnostic(handler, frame_info.as_note(machine.tcx)); + err.eager_subdiagnostic(err.dcx, frame_info.as_note(machine.tcx)); } else { let sm = sess.source_map(); let span = sm.span_to_embeddable_string(frame_info.span); @@ -514,7 +512,7 @@ pub fn report_msg<'tcx>( } } - handler.emit_diagnostic(err); + err.emit(); } impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> { diff --git a/src/helpers.rs b/src/helpers.rs index 14ba69b898..6423ce0b79 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -25,7 +25,7 @@ use rand::RngCore; use crate::*; // This mapping should match `decode_error_kind` in -// . +// . const UNIX_IO_ERROR_TABLE: &[(&str, std::io::ErrorKind)] = { use std::io::ErrorKind::*; &[ @@ -217,7 +217,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { /// Helper function to get a `windows` constant as a `Scalar`. fn eval_windows(&self, module: &str, name: &str) -> Scalar { - self.eval_context_ref().eval_path_scalar(&["std", "sys", "windows", module, name]) + self.eval_context_ref().eval_path_scalar(&["std", "sys", "pal", "windows", module, name]) } /// Helper function to get a `windows` constant as a `u32`. @@ -249,7 +249,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { fn windows_ty_layout(&self, name: &str) -> TyAndLayout<'tcx> { let this = self.eval_context_ref(); let ty = this - .resolve_path(&["std", "sys", "windows", "c", name], Namespace::TypeNS) + .resolve_path(&["std", "sys", "pal", "windows", "c", name], Namespace::TypeNS) .ty(*this.tcx, ty::ParamEnv::reveal_all()); this.layout_of(ty).unwrap() } diff --git a/src/shims/foreign_items.rs b/src/shims/foreign_items.rs index e7b2a6823e..a002f2aad0 100644 --- a/src/shims/foreign_items.rs +++ b/src/shims/foreign_items.rs @@ -342,7 +342,7 @@ trait EvalContextExtPriv<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> { /// Returns the minimum alignment for the target architecture for allocations of the given size. fn min_align(&self, size: u64, kind: MiriMemoryKind) -> Align { let this = self.eval_context_ref(); - // List taken from `library/std/src/sys/common/alloc.rs`. + // List taken from `library/std/src/sys/pal/common/alloc.rs`. // This list should be kept in sync with the one from libstd. let min_align = match this.tcx.sess.target.arch.as_ref() { "x86" | "arm" | "mips" | "mips32r6" | "powerpc" | "powerpc64" | "wasm32" => 8, diff --git a/tests/compiletest.rs b/tests/compiletest.rs index 074808b112..8bed321e65 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -192,13 +192,13 @@ regexes! { // erase thread caller ids r"call [0-9]+" => "call ID", // erase platform module paths - "sys::[a-z]+::" => "sys::PLATFORM::", + "sys::pal::[a-z]+::" => "sys::pal::PLATFORM::", // Windows file paths r"\\" => "/", // erase Rust stdlib path "[^ \n`]*/(rust[^/]*|checkout)/library/" => "RUSTLIB/", // erase platform file paths - "sys/[a-z]+/" => "sys/PLATFORM/", + "sys/pal/[a-z]+/" => "sys/pal/PLATFORM/", // erase paths into the crate registry r"[^ ]*/\.?cargo/registry/.*/(.*\.rs)" => "CARGO_REGISTRY/.../$1", } diff --git a/tests/fail-dep/concurrency/windows_join_detached.stderr b/tests/fail-dep/concurrency/windows_join_detached.stderr index 651c2eba0d..19bfe56395 100644 --- a/tests/fail-dep/concurrency/windows_join_detached.stderr +++ b/tests/fail-dep/concurrency/windows_join_detached.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: trying to join a detached thread - --> RUSTLIB/std/src/sys/PLATFORM/thread.rs:LL:CC + --> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC | LL | let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle(), c::INFINITE) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join a detached thread @@ -7,7 +7,7 @@ LL | let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle( = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `std::sys::PLATFORM::thread::Thread::join` at RUSTLIB/std/src/sys/PLATFORM/thread.rs:LL:CC + = note: inside `std::sys::pal::PLATFORM::thread::Thread::join` at RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC = note: inside `std::thread::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC note: inside `main` diff --git a/tests/fail/alloc/global_system_mixup.stderr b/tests/fail/alloc/global_system_mixup.stderr index de76e925c1..7006b96ee1 100644 --- a/tests/fail/alloc/global_system_mixup.stderr +++ b/tests/fail/alloc/global_system_mixup.stderr @@ -1,5 +1,5 @@ error: Undefined Behavior: deallocating ALLOC, which is Rust heap memory, using PLATFORM heap deallocation operation - --> RUSTLIB/std/src/sys/PLATFORM/alloc.rs:LL:CC + --> RUSTLIB/std/src/sys/pal/PLATFORM/alloc.rs:LL:CC | LL | FREE(); | ^ deallocating ALLOC, which is Rust heap memory, using PLATFORM heap deallocation operation @@ -7,7 +7,7 @@ LL | FREE(); = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: BACKTRACE: - = note: inside `std::sys::PLATFORM::alloc::::dealloc` at RUSTLIB/std/src/sys/PLATFORM/alloc.rs:LL:CC + = note: inside `std::sys::pal::PLATFORM::alloc::::dealloc` at RUSTLIB/std/src/sys/pal/PLATFORM/alloc.rs:LL:CC = note: inside `::deallocate` at RUSTLIB/std/src/alloc.rs:LL:CC note: inside `main` --> $DIR/global_system_mixup.rs:LL:CC diff --git a/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr b/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr index 2be02100a3..bccd532fac 100644 --- a/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr +++ b/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr @@ -6,12 +6,12 @@ panic in a function that cannot unwind stack backtrace: thread caused non-unwinding panic. aborting. error: abnormal termination: the program aborted execution - --> RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC + --> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC | LL | ABORT(); | ^ the program aborted execution | - = note: inside `std::sys::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC + = note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC = note: inside `std::panicking::rust_panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC = note: inside `std::sys_common::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC diff --git a/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr b/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr index 2be02100a3..bccd532fac 100644 --- a/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr +++ b/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr @@ -6,12 +6,12 @@ panic in a function that cannot unwind stack backtrace: thread caused non-unwinding panic. aborting. error: abnormal termination: the program aborted execution - --> RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC + --> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC | LL | ABORT(); | ^ the program aborted execution | - = note: inside `std::sys::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC + = note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC = note: inside `std::panicking::rust_panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC = note: inside `std::sys_common::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC diff --git a/tests/fail/intrinsics/uninit_uninhabited_type.stderr b/tests/fail/intrinsics/uninit_uninhabited_type.stderr index 2196673c39..5d4ea01158 100644 --- a/tests/fail/intrinsics/uninit_uninhabited_type.stderr +++ b/tests/fail/intrinsics/uninit_uninhabited_type.stderr @@ -3,12 +3,12 @@ aborted execution: attempted to instantiate uninhabited type `!` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread caused non-unwinding panic. aborting. error: abnormal termination: the program aborted execution - --> RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC + --> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC | LL | ABORT(); | ^ the program aborted execution | - = note: inside `std::sys::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC + = note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC = note: inside `std::panicking::rust_panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC = note: inside `std::sys_common::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC diff --git a/tests/fail/intrinsics/zero_fn_ptr.stderr b/tests/fail/intrinsics/zero_fn_ptr.stderr index 90ba5995ce..935e79dfd8 100644 --- a/tests/fail/intrinsics/zero_fn_ptr.stderr +++ b/tests/fail/intrinsics/zero_fn_ptr.stderr @@ -3,12 +3,12 @@ aborted execution: attempted to zero-initialize type `fn()`, which is invalid note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread caused non-unwinding panic. aborting. error: abnormal termination: the program aborted execution - --> RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC + --> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC | LL | ABORT(); | ^ the program aborted execution | - = note: inside `std::sys::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC + = note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC = note: inside `std::panicking::rust_panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC = note: inside `std::sys_common::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC diff --git a/tests/fail/panic/double_panic.stderr b/tests/fail/panic/double_panic.stderr index 75ca0901bc..2eb9354a4d 100644 --- a/tests/fail/panic/double_panic.stderr +++ b/tests/fail/panic/double_panic.stderr @@ -8,12 +8,12 @@ thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC: panic in a destructor during cleanup thread caused non-unwinding panic. aborting. error: abnormal termination: the program aborted execution - --> RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC + --> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC | LL | ABORT(); | ^ the program aborted execution | - = note: inside `std::sys::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC + = note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC = note: inside `std::panicking::rust_panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC = note: inside `std::sys_common::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC diff --git a/tests/fail/shims/fs/isolated_file.stderr b/tests/fail/shims/fs/isolated_file.stderr index e1b1800086..ec670c4a39 100644 --- a/tests/fail/shims/fs/isolated_file.stderr +++ b/tests/fail/shims/fs/isolated_file.stderr @@ -1,5 +1,5 @@ error: unsupported operation: `open` not available when isolation is enabled - --> RUSTLIB/std/src/sys/PLATFORM/fs.rs:LL:CC + --> RUSTLIB/std/src/sys/pal/PLATFORM/fs.rs:LL:CC | LL | let fd = cvt_r(|| unsafe { open64(path.as_ptr(), flags, opts.mode as c_int) })?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `open` not available when isolation is enabled @@ -7,13 +7,13 @@ LL | let fd = cvt_r(|| unsafe { open64(path.as_ptr(), flags, opts.mode a = help: pass the flag `-Zmiri-disable-isolation` to disable isolation; = help: or pass `-Zmiri-isolation-error=warn` to configure Miri to return an error code from isolated operations (if supported for that operation) and continue with a warning = note: BACKTRACE: - = note: inside closure at RUSTLIB/std/src/sys/PLATFORM/fs.rs:LL:CC - = note: inside `std::sys::PLATFORM::cvt_r::` at RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC - = note: inside `std::sys::PLATFORM::fs::File::open_c` at RUSTLIB/std/src/sys/PLATFORM/fs.rs:LL:CC - = note: inside closure at RUSTLIB/std/src/sys/PLATFORM/fs.rs:LL:CC - = note: inside `std::sys::PLATFORM::small_c_string::run_with_cstr::` at RUSTLIB/std/src/sys/PLATFORM/small_c_string.rs:LL:CC - = note: inside `std::sys::PLATFORM::small_c_string::run_path_with_cstr::` at RUSTLIB/std/src/sys/PLATFORM/small_c_string.rs:LL:CC - = note: inside `std::sys::PLATFORM::fs::File::open` at RUSTLIB/std/src/sys/PLATFORM/fs.rs:LL:CC + = note: inside closure at RUSTLIB/std/src/sys/pal/PLATFORM/fs.rs:LL:CC + = note: inside `std::sys::pal::PLATFORM::cvt_r::` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC + = note: inside `std::sys::pal::PLATFORM::fs::File::open_c` at RUSTLIB/std/src/sys/pal/PLATFORM/fs.rs:LL:CC + = note: inside closure at RUSTLIB/std/src/sys/pal/PLATFORM/fs.rs:LL:CC + = note: inside `std::sys::pal::PLATFORM::small_c_string::run_with_cstr::` at RUSTLIB/std/src/sys/pal/PLATFORM/small_c_string.rs:LL:CC + = note: inside `std::sys::pal::PLATFORM::small_c_string::run_path_with_cstr::` at RUSTLIB/std/src/sys/pal/PLATFORM/small_c_string.rs:LL:CC + = note: inside `std::sys::pal::PLATFORM::fs::File::open` at RUSTLIB/std/src/sys/pal/PLATFORM/fs.rs:LL:CC = note: inside `std::fs::OpenOptions::_open` at RUSTLIB/std/src/fs.rs:LL:CC = note: inside `std::fs::OpenOptions::open::<&std::path::Path>` at RUSTLIB/std/src/fs.rs:LL:CC = note: inside `std::fs::File::open::<&str>` at RUSTLIB/std/src/fs.rs:LL:CC diff --git a/tests/fail/terminate-terminator.stderr b/tests/fail/terminate-terminator.stderr index be66bad6fc..44c04b3ae9 100644 --- a/tests/fail/terminate-terminator.stderr +++ b/tests/fail/terminate-terminator.stderr @@ -8,12 +8,12 @@ panic in a function that cannot unwind stack backtrace: thread caused non-unwinding panic. aborting. error: abnormal termination: the program aborted execution - --> RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC + --> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC | LL | ABORT(); | ^ the program aborted execution | - = note: inside `std::sys::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC + = note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC = note: inside `std::panicking::rust_panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC = note: inside `std::sys_common::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC diff --git a/tests/fail/unwind-action-terminate.stderr b/tests/fail/unwind-action-terminate.stderr index a7543df340..adb2967fea 100644 --- a/tests/fail/unwind-action-terminate.stderr +++ b/tests/fail/unwind-action-terminate.stderr @@ -6,12 +6,12 @@ panic in a function that cannot unwind stack backtrace: thread caused non-unwinding panic. aborting. error: abnormal termination: the program aborted execution - --> RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC + --> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC | LL | ABORT(); | ^ the program aborted execution | - = note: inside `std::sys::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC + = note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC = note: inside `std::panicking::rust_panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC = note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC = note: inside `std::sys_common::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC