@@ -63,8 +63,9 @@ enum VarArgCompatible {
6363 /// `T` and `U` are compatible, e.g.
6464 ///
6565 /// - They're the same type.
66- /// - One is `usize`/`isize`, the other same-sized fixed-width integer on that target.
67- /// - They are compatible pointer types.
66+ /// - One is `usize`/`isize`, the other an integer type of the same width
67+ /// and sign on the current target.
68+ /// - They are compatible pointer types (see the exact rules below).
6869 Compatible ,
6970 /// `T` and `U` are definitely not compatible.
7071 Incompatible ,
@@ -838,11 +839,10 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
838839 /// Types `T` and `U` are compatible when:
839840 ///
840841 /// - `T` and `U` are the same type.
841- /// - `T` is a signed integer and `U` the corresponding unsigned integer,
842- /// - `T` is an unsigned integer and `U` the corresponding signed integer,
842+ /// - `T` and `U` are integer types of the same size. When the sign is different a further check
843+ /// is needed on the passed value, but that is not done here.
843844 /// - `T` and `U` are both pointers, and their target types are compatible.
844- /// - `T` is a pointer to `c_void` and `U` is a pointer to `i8` or `u8` (i.e., any "character type").
845- /// - `T` is a pointer to `i8` or `u8` and `U` is a pointer to `c_void`.
845+ /// - `T` is a pointer to [`c_void`] and `U` is a pointer to [`i8]` or [`u8`], or vice versa.
846846 fn validate_c_variadic_compatible_ty (
847847 & mut self ,
848848 caller_type : Ty < ' tcx > ,
0 commit comments