Merge from rustc
This commit is contained in:
commit
650294cdc2
306 changed files with 2398 additions and 1415 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 2cc50bc0b63ad20da193e002ba11d391af0104b7
|
||||
Subproject commit 925280f028db3a322935e040719a0754703947cf
|
||||
|
|
@ -6,7 +6,6 @@ second
|
|||
stack backtrace:
|
||||
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
|
||||
panic in a destructor during cleanup
|
||||
stack backtrace:
|
||||
thread caused non-unwinding panic. aborting.
|
||||
error: abnormal termination: the program aborted execution
|
||||
--> RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC
|
||||
|
|
@ -19,7 +18,7 @@ LL | ABORT();
|
|||
= 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
|
||||
= note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
|
||||
= note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC
|
||||
= note: inside `core::panicking::panic_nounwind_nobacktrace` at RUSTLIB/core/src/panicking.rs:LL:CC
|
||||
= note: inside `core::panicking::panic_in_cleanup` at RUSTLIB/core/src/panicking.rs:LL:CC
|
||||
note: inside `main`
|
||||
--> $DIR/double_panic.rs:LL:CC
|
||||
|
|
|
|||
27
src/tools/miri/tests/pass/function_calls/abi_compat.rs
Normal file
27
src/tools/miri/tests/pass/function_calls/abi_compat.rs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
use std::num;
|
||||
use std::mem;
|
||||
|
||||
fn test_abi_compat<T, U>(t: T, u: U) {
|
||||
fn id<T>(x: T) -> T { x }
|
||||
|
||||
// This checks ABI compatibility both for arguments and return values,
|
||||
// in both directions.
|
||||
let f: fn(T) -> T = id;
|
||||
let f: fn(U) -> U = unsafe { std::mem::transmute(f) };
|
||||
drop(f(u));
|
||||
|
||||
let f: fn(U) -> U = id;
|
||||
let f: fn(T) -> T = unsafe { std::mem::transmute(f) };
|
||||
drop(f(t));
|
||||
}
|
||||
|
||||
fn main() {
|
||||
test_abi_compat(0u32, 'x');
|
||||
test_abi_compat(&0u32, &([true; 4], [0u32; 0]));
|
||||
test_abi_compat(0u32, mem::MaybeUninit::new(0u32));
|
||||
test_abi_compat(42u32, num::NonZeroU32::new(1).unwrap());
|
||||
test_abi_compat(0u32, Some(num::NonZeroU32::new(1).unwrap()));
|
||||
test_abi_compat(0u32, 0i32);
|
||||
// Note that `bool` and `u8` are *not* compatible!
|
||||
// One of them has `arg_ext: Zext`, the other does not.
|
||||
}
|
||||
|
|
@ -354,7 +354,12 @@ fn check_error_codes_used(
|
|||
|
||||
for code in error_codes {
|
||||
if !found_codes.contains(code) && !no_longer_emitted.contains(code) {
|
||||
errors.push(format!("Error code `{code}` exists, but is not emitted by the compiler!"))
|
||||
errors.push(format!(
|
||||
"Error code `{code}` exists, but is not emitted by the compiler!\n\
|
||||
Please mark the code as no longer emitted by adding the following note to the top of the `EXXXX.md` file:\n\
|
||||
`#### Note: this error code is no longer emitted by the compiler`\n\
|
||||
Also, do not forget to mark doctests that no longer apply as `ignore (error is no longer emitted)`."
|
||||
));
|
||||
}
|
||||
|
||||
if found_codes.contains(code) && no_longer_emitted.contains(code) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue