From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/cast/cast-int-to-char.stderr | 89 ++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 src/test/ui/cast/cast-int-to-char.stderr (limited to 'src/test/ui/cast/cast-int-to-char.stderr') diff --git a/src/test/ui/cast/cast-int-to-char.stderr b/src/test/ui/cast/cast-int-to-char.stderr new file mode 100644 index 000000000..ef606b6ae --- /dev/null +++ b/src/test/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::('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) {} + | ^^^ ----- +help: you can cast a `char` to a `u32`, since a `char` always occupies 4 bytes + | +LL | foo::('0' as u32); + | ++++++ + +error[E0308]: mismatched types + --> $DIR/cast-int-to-char.rs:5:16 + | +LL | foo::('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) {} + | ^^^ ----- +help: you can cast a `char` to an `i32`, since a `char` always occupies 4 bytes + | +LL | foo::('0' as i32); + | ++++++ + +error[E0308]: mismatched types + --> $DIR/cast-int-to-char.rs:6:16 + | +LL | foo::('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) {} + | ^^^ ----- +help: you can cast a `char` to a `u64`, since a `char` always occupies 4 bytes + | +LL | foo::('0' as u64); + | ++++++ + +error[E0308]: mismatched types + --> $DIR/cast-int-to-char.rs:7:16 + | +LL | foo::('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) {} + | ^^^ ----- +help: you can cast a `char` to an `i64`, since a `char` always occupies 4 bytes + | +LL | foo::('0' as i64); + | ++++++ + +error[E0308]: mismatched types + --> $DIR/cast-int-to-char.rs:8:17 + | +LL | foo::(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) {} + | ^^^ ----- + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0308`. -- cgit v1.2.3