about summary refs log tree commit diff
path: root/tests/ui/c-variadic
diff options
context:
space:
mode:
authorOrion Gonzalez <ardi@ardis.dev>2024-11-29 11:15:15 +0100
committerOrion Gonzalez <ardi@ardis.dev>2024-11-29 20:49:06 +0100
commitce98bf3d798bf183d33d2e3fc2d07a94e86e006e (patch)
treeb42d81411d6660f93b2dfab2258e0396b5a9a66c /tests/ui/c-variadic
parent0c4f3a45b86c77b0a89ff06703aa6097af35d924 (diff)
downloadrust-ce98bf3d798bf183d33d2e3fc2d07a94e86e006e.tar.gz
rust-ce98bf3d798bf183d33d2e3fc2d07a94e86e006e.zip
simplify how the `hir_typeck_pass_to_variadic_function` diagnostic is created
Diffstat (limited to 'tests/ui/c-variadic')
-rw-r--r--tests/ui/c-variadic/variadic-ffi-1.stderr42
1 files changed, 36 insertions, 6 deletions
diff --git a/tests/ui/c-variadic/variadic-ffi-1.stderr b/tests/ui/c-variadic/variadic-ffi-1.stderr
index 72d60a1439a..194710dfd21 100644
--- a/tests/ui/c-variadic/variadic-ffi-1.stderr
+++ b/tests/ui/c-variadic/variadic-ffi-1.stderr
@@ -62,37 +62,67 @@ error[E0617]: can't pass `f32` to variadic function
   --> $DIR/variadic-ffi-1.rs:28:19
    |
 LL |         foo(1, 2, 3f32);
-   |                   ^^^^ help: cast the value to `c_double`: `3f32 as c_double`
+   |                   ^^^^
+   |
+help: cast the value to `c_double`
+   |
+LL |         foo(1, 2, 3f32 as c_double);
+   |                        +++++++++++
 
 error[E0617]: can't pass `bool` to variadic function
   --> $DIR/variadic-ffi-1.rs:29:19
    |
 LL |         foo(1, 2, true);
-   |                   ^^^^ help: cast the value to `c_int`: `true as c_int`
+   |                   ^^^^
+   |
+help: cast the value to `c_int`
+   |
+LL |         foo(1, 2, true as c_int);
+   |                        ++++++++
 
 error[E0617]: can't pass `i8` to variadic function
   --> $DIR/variadic-ffi-1.rs:30:19
    |
 LL |         foo(1, 2, 1i8);
-   |                   ^^^ help: cast the value to `c_int`: `1i8 as c_int`
+   |                   ^^^
+   |
+help: cast the value to `c_int`
+   |
+LL |         foo(1, 2, 1i8 as c_int);
+   |                       ++++++++
 
 error[E0617]: can't pass `u8` to variadic function
   --> $DIR/variadic-ffi-1.rs:31:19
    |
 LL |         foo(1, 2, 1u8);
-   |                   ^^^ help: cast the value to `c_uint`: `1u8 as c_uint`
+   |                   ^^^
+   |
+help: cast the value to `c_uint`
+   |
+LL |         foo(1, 2, 1u8 as c_uint);
+   |                       +++++++++
 
 error[E0617]: can't pass `i16` to variadic function
   --> $DIR/variadic-ffi-1.rs:32:19
    |
 LL |         foo(1, 2, 1i16);
-   |                   ^^^^ help: cast the value to `c_int`: `1i16 as c_int`
+   |                   ^^^^
+   |
+help: cast the value to `c_int`
+   |
+LL |         foo(1, 2, 1i16 as c_int);
+   |                        ++++++++
 
 error[E0617]: can't pass `u16` to variadic function
   --> $DIR/variadic-ffi-1.rs:33:19
    |
 LL |         foo(1, 2, 1u16);
-   |                   ^^^^ help: cast the value to `c_uint`: `1u16 as c_uint`
+   |                   ^^^^
+   |
+help: cast the value to `c_uint`
+   |
+LL |         foo(1, 2, 1u16 as c_uint);
+   |                        +++++++++
 
 error: aborting due to 11 previous errors