summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/type-mismatch-byte-literal.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/suggestions/type-mismatch-byte-literal.stderr')
-rw-r--r--tests/ui/suggestions/type-mismatch-byte-literal.stderr42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/ui/suggestions/type-mismatch-byte-literal.stderr b/tests/ui/suggestions/type-mismatch-byte-literal.stderr
new file mode 100644
index 000000000..c9c2e7498
--- /dev/null
+++ b/tests/ui/suggestions/type-mismatch-byte-literal.stderr
@@ -0,0 +1,42 @@
+error[E0308]: mismatched types
+ --> $DIR/type-mismatch-byte-literal.rs:7:18
+ |
+LL | let _x: u8 = 'X';
+ | -- ^^^ expected `u8`, found `char`
+ | |
+ | expected due to this
+ |
+help: if you meant to write a byte literal, prefix with `b`
+ |
+LL | let _x: u8 = b'X';
+ | ~~~~
+
+error[E0308]: mismatched types
+ --> $DIR/type-mismatch-byte-literal.rs:11:9
+ |
+LL | foo('#');
+ | --- ^^^ expected `u8`, found `char`
+ | |
+ | arguments to this function are incorrect
+ |
+note: function defined here
+ --> $DIR/type-mismatch-byte-literal.rs:4:4
+ |
+LL | fn foo(_t: u8) {}
+ | ^^^ ------
+help: if you meant to write a byte literal, prefix with `b`
+ |
+LL | foo(b'#');
+ | ~~~~
+
+error[E0308]: mismatched types
+ --> $DIR/type-mismatch-byte-literal.rs:16:18
+ |
+LL | let _t: u8 = '€';
+ | -- ^^^ expected `u8`, found `char`
+ | |
+ | expected due to this
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0308`.