about summary refs log tree commit diff
path: root/tests/ui/error-codes
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2024-11-30 12:56:54 +0800
committerGitHub <noreply@github.com>2024-11-30 12:56:54 +0800
commitc112195fec0084faf1ac375abd24ac5248dbf712 (patch)
tree48a50cb0f07311426abbbc047b22e56f838a0a4a /tests/ui/error-codes
parent46f826cff79e5b874a6158e35a63287feb561588 (diff)
parentce98bf3d798bf183d33d2e3fc2d07a94e86e006e (diff)
downloadrust-c112195fec0084faf1ac375abd24ac5248dbf712.tar.gz
rust-c112195fec0084faf1ac375abd24ac5248dbf712.zip
Rollup merge of #133620 - dev-ardi:simplify-hir_typeck_pass_to_variadic_function, r=compiler-errors
Simplify hir_typeck_pass_to_variadic_function

r? ``@compiler-errors``
This reworks a bit how the diagnostic is generated so that it does the same as #133538

The `help` is useless now so I removed it
Diffstat (limited to 'tests/ui/error-codes')
-rw-r--r--tests/ui/error-codes/E0617.stderr35
1 files changed, 30 insertions, 5 deletions
diff --git a/tests/ui/error-codes/E0617.stderr b/tests/ui/error-codes/E0617.stderr
index 7193463e028..b2eee129960 100644
--- a/tests/ui/error-codes/E0617.stderr
+++ b/tests/ui/error-codes/E0617.stderr
@@ -2,31 +2,56 @@ error[E0617]: can't pass `f32` to variadic function
   --> $DIR/E0617.rs:7:36
    |
 LL |         printf(::std::ptr::null(), 0f32);
-   |                                    ^^^^ help: cast the value to `c_double`: `0f32 as c_double`
+   |                                    ^^^^
+   |
+help: cast the value to `c_double`
+   |
+LL |         printf(::std::ptr::null(), 0f32 as c_double);
+   |                                         +++++++++++
 
 error[E0617]: can't pass `i8` to variadic function
   --> $DIR/E0617.rs:10:36
    |
 LL |         printf(::std::ptr::null(), 0i8);
-   |                                    ^^^ help: cast the value to `c_int`: `0i8 as c_int`
+   |                                    ^^^
+   |
+help: cast the value to `c_int`
+   |
+LL |         printf(::std::ptr::null(), 0i8 as c_int);
+   |                                        ++++++++
 
 error[E0617]: can't pass `i16` to variadic function
   --> $DIR/E0617.rs:13:36
    |
 LL |         printf(::std::ptr::null(), 0i16);
-   |                                    ^^^^ help: cast the value to `c_int`: `0i16 as c_int`
+   |                                    ^^^^
+   |
+help: cast the value to `c_int`
+   |
+LL |         printf(::std::ptr::null(), 0i16 as c_int);
+   |                                         ++++++++
 
 error[E0617]: can't pass `u8` to variadic function
   --> $DIR/E0617.rs:16:36
    |
 LL |         printf(::std::ptr::null(), 0u8);
-   |                                    ^^^ help: cast the value to `c_uint`: `0u8 as c_uint`
+   |                                    ^^^
+   |
+help: cast the value to `c_uint`
+   |
+LL |         printf(::std::ptr::null(), 0u8 as c_uint);
+   |                                        +++++++++
 
 error[E0617]: can't pass `u16` to variadic function
   --> $DIR/E0617.rs:19:36
    |
 LL |         printf(::std::ptr::null(), 0u16);
-   |                                    ^^^^ help: cast the value to `c_uint`: `0u16 as c_uint`
+   |                                    ^^^^
+   |
+help: cast the value to `c_uint`
+   |
+LL |         printf(::std::ptr::null(), 0u16 as c_uint);
+   |                                         +++++++++
 
 error[E0617]: can't pass a function item to a variadic function
   --> $DIR/E0617.rs:22:36