Skip to content

Commit 11a1772

Browse files
committed
Auto merge of #141133 - matthiaskrgr:rollup-u8ndxyz, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #135808 (Implement Display for ``rustc_target::callconv::Conv``) - #137432 (Add as_ascii_unchecked() methods to char, u8, and str) - #139103 (deduplicate abort implementations) - #140917 (checktools.sh: fix bashism) - #141035 (turn lld warning on old gccs into info log) - #141118 (Enable rust-analyzer to go from query definition to the corresponding provider field) - #141121 (Only select true errors in `impossible_predicates`) - #141125 (check coroutines with `TypingMode::Borrowck` to avoid cyclic reasoning) - #141131 (Make some `match`es slightly more ergonomic in `librustdoc`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 5a7e23a + 20f3abb commit 11a1772

38 files changed

+65
-58
lines changed

src/helpers.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -932,12 +932,11 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
932932
self.read_c_str_with_char_size(ptr, wchar_t.size, wchar_t.align.abi)
933933
}
934934

935-
/// Check that the ABI is what we expect.
936-
fn check_abi<'a>(&self, fn_abi: &FnAbi<'tcx, Ty<'tcx>>, exp_abi: Conv) -> InterpResult<'a, ()> {
935+
/// Check that the calling convention is what we expect.
936+
fn check_callconv<'a>(&self, fn_abi: &FnAbi<'tcx, Ty<'tcx>>, exp_abi: Conv) -> InterpResult<'a, ()> {
937937
if fn_abi.conv != exp_abi {
938938
throw_ub_format!(
939-
"calling a function with ABI {:?} using caller ABI {:?}",
940-
exp_abi,
939+
"calling a function with calling convention {exp_abi} using caller calling convention {}",
941940
fn_abi.conv
942941
);
943942
}
@@ -973,7 +972,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
973972
exp_abi: Conv,
974973
link_name: Symbol,
975974
) -> InterpResult<'tcx, ()> {
976-
self.check_abi(abi, exp_abi)?;
975+
self.check_callconv(abi, exp_abi)?;
977976
if let Some((body, instance)) = self.eval_context_mut().lookup_exported_symbol(link_name)? {
978977
// If compiler-builtins is providing the symbol, then don't treat it as a clash.
979978
// We'll use our built-in implementation in `emulate_foreign_item_inner` for increased

tests/fail/alloc/alloc_error_handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@error-in-other-file: aborted
2-
//@normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
2+
//@normalize-stderr-test: "\|.*::abort\(\).*" -> "| ABORT()"
33
//@normalize-stderr-test: "\| +\^+" -> "| ^"
44
#![feature(allocator_api)]
55

tests/fail/alloc/alloc_error_handler.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ memory allocation of 4 bytes failed
22
error: abnormal termination: the program aborted execution
33
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
44
|
5-
LL | ABORT();
5+
LL | ABORT()
66
| ^ the program aborted execution
77
|
88
= note: BACKTRACE:

tests/fail/function_calls/check_arg_abi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ fn main() {
44
}
55

66
unsafe {
7-
let _ = malloc(0); //~ ERROR: calling a function with ABI C using caller ABI Rust
7+
let _ = malloc(0); //~ ERROR: calling a function with calling convention "C" using caller calling convention "Rust"
88
};
99
}

tests/fail/function_calls/check_arg_abi.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: calling a function with ABI C using caller ABI Rust
1+
error: Undefined Behavior: calling a function with calling convention "C" using caller calling convention "Rust"
22
--> tests/fail/function_calls/check_arg_abi.rs:LL:CC
33
|
44
LL | let _ = malloc(0);
5-
| ^^^^^^^^^ calling a function with ABI C using caller ABI Rust
5+
| ^^^^^^^^^ calling a function with calling convention "C" using caller calling convention "Rust"
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information

tests/fail/function_calls/check_callback_abi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn main() {
99
// Make sure we check the ABI when Miri itself invokes a function
1010
// as part of a shim implementation.
1111
std::intrinsics::catch_unwind(
12-
//~^ ERROR: calling a function with calling convention C using calling convention Rust
12+
//~^ ERROR: calling a function with calling convention "C" using calling convention "Rust"
1313
std::mem::transmute::<extern "C" fn(*mut u8), _>(try_fn),
1414
std::ptr::null_mut(),
1515
|_, _| unreachable!(),

tests/fail/function_calls/check_callback_abi.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Undefined Behavior: calling a function with calling convention C using calling convention Rust
1+
error: Undefined Behavior: calling a function with calling convention "C" using calling convention "Rust"
22
--> tests/fail/function_calls/check_callback_abi.rs:LL:CC
33
|
44
LL | / std::intrinsics::catch_unwind(
@@ -7,7 +7,7 @@ LL | | std::mem::transmute::<extern "C" fn(*mut u8), _>(try_fn),
77
LL | | std::ptr::null_mut(),
88
LL | | |_, _| unreachable!(),
99
LL | | );
10-
| |_________^ calling a function with calling convention C using calling convention Rust
10+
| |_________^ calling a function with calling convention "C" using calling convention "Rust"
1111
|
1212
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
1313
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information

tests/fail/function_calls/exported_symbol_abi_mismatch.cache.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: calling a function with calling convention Rust using calling convention C
1+
error: Undefined Behavior: calling a function with calling convention "Rust" using calling convention "C"
22
--> tests/fail/function_calls/exported_symbol_abi_mismatch.rs:LL:CC
33
|
44
LL | foo();
5-
| ^^^^^ calling a function with calling convention Rust using calling convention C
5+
| ^^^^^ calling a function with calling convention "Rust" using calling convention "C"
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information

tests/fail/function_calls/exported_symbol_abi_mismatch.fn_ptr.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: calling a function with calling convention Rust using calling convention C
1+
error: Undefined Behavior: calling a function with calling convention "Rust" using calling convention "C"
22
--> tests/fail/function_calls/exported_symbol_abi_mismatch.rs:LL:CC
33
|
44
LL | std::mem::transmute::<unsafe fn(), unsafe extern "C" fn()>(foo)();
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling a function with calling convention Rust using calling convention C
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling a function with calling convention "Rust" using calling convention "C"
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information

tests/fail/function_calls/exported_symbol_abi_mismatch.no_cache.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: calling a function with calling convention Rust using calling convention C
1+
error: Undefined Behavior: calling a function with calling convention "Rust" using calling convention "C"
22
--> tests/fail/function_calls/exported_symbol_abi_mismatch.rs:LL:CC
33
|
44
LL | foo();
5-
| ^^^^^ calling a function with calling convention Rust using calling convention C
5+
| ^^^^^ calling a function with calling convention "Rust" using calling convention "C"
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information

0 commit comments

Comments
 (0)