summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/type-mismatch-byte-literal.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/suggestions/type-mismatch-byte-literal.rs')
-rw-r--r--tests/ui/suggestions/type-mismatch-byte-literal.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/suggestions/type-mismatch-byte-literal.rs b/tests/ui/suggestions/type-mismatch-byte-literal.rs
index 34199f8c3..80cd2ca7d 100644
--- a/tests/ui/suggestions/type-mismatch-byte-literal.rs
+++ b/tests/ui/suggestions/type-mismatch-byte-literal.rs
@@ -12,7 +12,19 @@ fn main() {
//~^ ERROR: mismatched types [E0308]
//~| HELP: if you meant to write a byte literal, prefix with `b`
+ let _a: u8 = '\x20';
+ //~^ ERROR: mismatched types [E0308]
+ //~| HELP: if you meant to write a byte literal, prefix with `b`
+
+ // Do not issue the suggestion if the char literal is a Unicode escape
+ foo('\u{0080}');
+ //~^ ERROR: mismatched types [E0308]
+
// Do not issue the suggestion if the char literal isn't ASCII
let _t: u8 = '€';
//~^ ERROR: mismatched types [E0308]
+
+ // Do not issue the suggestion if the char literal isn't ASCII
+ foo('\u{1f980}');
+ //~^ ERROR: mismatched types [E0308]
}