summaryrefslogtreecommitdiffstats
path: root/tests/ui/cast/cast-int-to-char.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/cast/cast-int-to-char.stderr
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/cast/cast-int-to-char.stderr')
-rw-r--r--tests/ui/cast/cast-int-to-char.stderr89
1 files changed, 89 insertions, 0 deletions
diff --git a/tests/ui/cast/cast-int-to-char.stderr b/tests/ui/cast/cast-int-to-char.stderr
new file mode 100644
index 000000000..ef606b6ae
--- /dev/null
+++ b/tests/ui/cast/cast-int-to-char.stderr
@@ -0,0 +1,89 @@
+error[E0308]: mismatched types
+ --> $DIR/cast-int-to-char.rs:4:16
+ |
+LL | foo::<u32>('0');
+ | ---------- ^^^ expected `u32`, found `char`
+ | |
+ | arguments to this function are incorrect
+ |
+note: function defined here
+ --> $DIR/cast-int-to-char.rs:1:4
+ |
+LL | fn foo<T>(_t: T) {}
+ | ^^^ -----
+help: you can cast a `char` to a `u32`, since a `char` always occupies 4 bytes
+ |
+LL | foo::<u32>('0' as u32);
+ | ++++++
+
+error[E0308]: mismatched types
+ --> $DIR/cast-int-to-char.rs:5:16
+ |
+LL | foo::<i32>('0');
+ | ---------- ^^^ expected `i32`, found `char`
+ | |
+ | arguments to this function are incorrect
+ |
+note: function defined here
+ --> $DIR/cast-int-to-char.rs:1:4
+ |
+LL | fn foo<T>(_t: T) {}
+ | ^^^ -----
+help: you can cast a `char` to an `i32`, since a `char` always occupies 4 bytes
+ |
+LL | foo::<i32>('0' as i32);
+ | ++++++
+
+error[E0308]: mismatched types
+ --> $DIR/cast-int-to-char.rs:6:16
+ |
+LL | foo::<u64>('0');
+ | ---------- ^^^ expected `u64`, found `char`
+ | |
+ | arguments to this function are incorrect
+ |
+note: function defined here
+ --> $DIR/cast-int-to-char.rs:1:4
+ |
+LL | fn foo<T>(_t: T) {}
+ | ^^^ -----
+help: you can cast a `char` to a `u64`, since a `char` always occupies 4 bytes
+ |
+LL | foo::<u64>('0' as u64);
+ | ++++++
+
+error[E0308]: mismatched types
+ --> $DIR/cast-int-to-char.rs:7:16
+ |
+LL | foo::<i64>('0');
+ | ---------- ^^^ expected `i64`, found `char`
+ | |
+ | arguments to this function are incorrect
+ |
+note: function defined here
+ --> $DIR/cast-int-to-char.rs:1:4
+ |
+LL | fn foo<T>(_t: T) {}
+ | ^^^ -----
+help: you can cast a `char` to an `i64`, since a `char` always occupies 4 bytes
+ |
+LL | foo::<i64>('0' as i64);
+ | ++++++
+
+error[E0308]: mismatched types
+ --> $DIR/cast-int-to-char.rs:8:17
+ |
+LL | foo::<char>(0u32);
+ | ----------- ^^^^ expected `char`, found `u32`
+ | |
+ | arguments to this function are incorrect
+ |
+note: function defined here
+ --> $DIR/cast-int-to-char.rs:1:4
+ |
+LL | fn foo<T>(_t: T) {}
+ | ^^^ -----
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0308`.