Skip to content

Commit 5ff8417

Browse files
authored
Merge pull request #4500 from RalfJung/rustup
Rustup
2 parents 303dbdd + e38bb72 commit 5ff8417

19 files changed

+19
-18
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b56aaec52bc0fa35591a872fb4aac81f606e265c
1+
733dab558992d902d6d17576de1da768094e2cf3

src/shims/sig.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ fn check_shim_abi<'tcx>(
107107
{
108108
if !this.check_argument_compat(caller_arg, callee_arg)? {
109109
throw_ub!(AbiMismatchArgument {
110+
arg_idx: idx,
110111
caller_ty: caller_abi.args[idx].layout.ty,
111112
callee_ty: callee_abi.args[idx].layout.ty
112113
});

tests/fail/function_pointers/abi_mismatch_array_vs_struct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ fn main() {
1717
// These two types have the same size but are still not compatible.
1818
let g = unsafe { std::mem::transmute::<fn(S), fn(A)>(f) };
1919

20-
g(Default::default()) //~ ERROR: calling a function with argument of type S passing data of type [i32; 4]
20+
g(Default::default()) //~ ERROR: type S passing argument of type [i32; 4]
2121
}

tests/fail/function_pointers/abi_mismatch_array_vs_struct.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Undefined Behavior: calling a function with argument of type S passing data of type [i32; 4]
1+
error: Undefined Behavior: calling a function whose parameter #1 has type S passing argument of type [i32; 4]
22
--> tests/fail/function_pointers/abi_mismatch_array_vs_struct.rs:LL:CC
33
|
44
LL | g(Default::default())

tests/fail/function_pointers/abi_mismatch_int_vs_float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ fn main() {
33

44
let g = unsafe { std::mem::transmute::<fn(f32), fn(i32)>(f) };
55

6-
g(42) //~ ERROR: calling a function with argument of type f32 passing data of type i32
6+
g(42) //~ ERROR: type f32 passing argument of type i32
77
}

tests/fail/function_pointers/abi_mismatch_int_vs_float.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Undefined Behavior: calling a function with argument of type f32 passing data of type i32
1+
error: Undefined Behavior: calling a function whose parameter #1 has type f32 passing argument of type i32
22
--> tests/fail/function_pointers/abi_mismatch_int_vs_float.rs:LL:CC
33
|
44
LL | g(42)

tests/fail/function_pointers/abi_mismatch_raw_pointer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ fn main() {
33

44
let g = unsafe { std::mem::transmute::<fn(*const [i32]), fn(*const i32)>(f) };
55

6-
g(&42 as *const i32) //~ ERROR: calling a function with argument of type *const [i32] passing data of type *const i32
6+
g(&42 as *const i32) //~ ERROR: type *const [i32] passing argument of type *const i32
77
}

tests/fail/function_pointers/abi_mismatch_raw_pointer.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Undefined Behavior: calling a function with argument of type *const [i32] passing data of type *const i32
1+
error: Undefined Behavior: calling a function whose parameter #1 has type *const [i32] passing argument of type *const i32
22
--> tests/fail/function_pointers/abi_mismatch_raw_pointer.rs:LL:CC
33
|
44
LL | g(&42 as *const i32)

tests/fail/function_pointers/abi_mismatch_repr_C.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ fn main() {
1212
let fnptr: fn(S2) = callee;
1313
let fnptr: fn(S1) = unsafe { std::mem::transmute(fnptr) };
1414
fnptr(S1(NonZero::new(1).unwrap()));
15-
//~^ ERROR: calling a function with argument of type S2 passing data of type S1
15+
//~^ ERROR: type S2 passing argument of type S1
1616
}

tests/fail/function_pointers/abi_mismatch_repr_C.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Undefined Behavior: calling a function with argument of type S2 passing data of type S1
1+
error: Undefined Behavior: calling a function whose parameter #1 has type S2 passing argument of type S1
22
--> tests/fail/function_pointers/abi_mismatch_repr_C.rs:LL:CC
33
|
44
LL | fnptr(S1(NonZero::new(1).unwrap()));

0 commit comments

Comments
 (0)