From b721c1a885537de960733a54f86ba7a6f24a4857 Mon Sep 17 00:00:00 2001
From: Yuki Okushi <huyuumi.dev@gmail.com>
Date: Fri, 18 Jan 2019 05:24:17 +0900
Subject: [PATCH] Fix tests

---
 src/test/ui/parser/lex-bad-char-literals-3.rs |  5 ++++-
 .../ui/parser/lex-bad-char-literals-3.stderr  | 22 ++++++++++++++++++-
 src/test/ui/parser/lex-bad-char-literals-5.rs |  5 ++++-
 .../ui/parser/lex-bad-char-literals-5.stderr  | 22 ++++++++++++++++++-
 src/test/ui/str/str-as-char.fixed             |  4 ++--
 src/test/ui/str/str-as-char.rs                |  4 ++--
 src/test/ui/str/str-as-char.stderr            | 16 +++++++++++---
 7 files changed, 67 insertions(+), 11 deletions(-)

diff --git a/src/test/ui/parser/lex-bad-char-literals-3.rs b/src/test/ui/parser/lex-bad-char-literals-3.rs
index d14ec1cc515..10a8cd4a53e 100644
--- a/src/test/ui/parser/lex-bad-char-literals-3.rs
+++ b/src/test/ui/parser/lex-bad-char-literals-3.rs
@@ -3,4 +3,7 @@ static c: char =
     '●●' //~ ERROR: character literal may only contain one codepoint
 ;
 
-fn main() {}
+fn main() {
+    let ch: &str = '●●'; //~ ERROR: character literal may only contain one codepoint
+    //~^ ERROR: mismatched types
+}
diff --git a/src/test/ui/parser/lex-bad-char-literals-3.stderr b/src/test/ui/parser/lex-bad-char-literals-3.stderr
index dde4a7db3aa..9b4e69870ca 100644
--- a/src/test/ui/parser/lex-bad-char-literals-3.stderr
+++ b/src/test/ui/parser/lex-bad-char-literals-3.stderr
@@ -8,5 +8,25 @@ help: if you meant to write a `str` literal, use double quotes
 LL |     "●●" //~ ERROR: character literal may only contain one codepoint
    |     ^^^^
 
-error: aborting due to previous error
+error: character literal may only contain one codepoint
+  --> $DIR/lex-bad-char-literals-3.rs:7:20
+   |
+LL |     let ch: &str = '●●'; //~ ERROR: character literal may only contain one codepoint
+   |                    ^^^^
+help: if you meant to write a `str` literal, use double quotes
+   |
+LL |     let ch: &str = "●●"; //~ ERROR: character literal may only contain one codepoint
+   |                    ^^^^
 
+error[E0308]: mismatched types
+  --> $DIR/lex-bad-char-literals-3.rs:7:20
+   |
+LL |     let ch: &str = '●●'; //~ ERROR: character literal may only contain one codepoint
+   |                    ^^^^ expected &str, found char
+   |
+   = note: expected type `&str`
+              found type `char`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/parser/lex-bad-char-literals-5.rs b/src/test/ui/parser/lex-bad-char-literals-5.rs
index 1236e76de42..964099c3fa9 100644
--- a/src/test/ui/parser/lex-bad-char-literals-5.rs
+++ b/src/test/ui/parser/lex-bad-char-literals-5.rs
@@ -4,4 +4,7 @@ static c: char =
     '\x10\x10'  //~ ERROR: character literal may only contain one codepoint
 ;
 
-fn main() {}
+fn main() {
+    let ch: &str = '\x10\x10'; //~ ERROR: character literal may only contain one codepoint
+    //~^ ERROR: mismatched types
+}
diff --git a/src/test/ui/parser/lex-bad-char-literals-5.stderr b/src/test/ui/parser/lex-bad-char-literals-5.stderr
index 4f734eaeff3..177d8c599a8 100644
--- a/src/test/ui/parser/lex-bad-char-literals-5.stderr
+++ b/src/test/ui/parser/lex-bad-char-literals-5.stderr
@@ -8,5 +8,25 @@ help: if you meant to write a `str` literal, use double quotes
 LL |     "/x10/x10"  //~ ERROR: character literal may only contain one codepoint
    |     ^^^^^^^^^^
 
-error: aborting due to previous error
+error: character literal may only contain one codepoint
+  --> $DIR/lex-bad-char-literals-5.rs:8:20
+   |
+LL |     let ch: &str = '/x10/x10'; //~ ERROR: character literal may only contain one codepoint
+   |                    ^^^^^^^^^^
+help: if you meant to write a `str` literal, use double quotes
+   |
+LL |     let ch: &str = "/x10/x10"; //~ ERROR: character literal may only contain one codepoint
+   |                    ^^^^^^^^^^
 
+error[E0308]: mismatched types
+  --> $DIR/lex-bad-char-literals-5.rs:8:20
+   |
+LL |     let ch: &str = '/x10/x10'; //~ ERROR: character literal may only contain one codepoint
+   |                    ^^^^^^^^^^ expected &str, found char
+   |
+   = note: expected type `&str`
+              found type `char`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/str/str-as-char.fixed b/src/test/ui/str/str-as-char.fixed
index 9d4297b55c8..accead5c850 100644
--- a/src/test/ui/str/str-as-char.fixed
+++ b/src/test/ui/str/str-as-char.fixed
@@ -1,6 +1,6 @@
 // run-rustfix
 
 fn main() {
-    println!("●●");
-    //~^ ERROR character literal may only contain one codepoint
+    println!("{}", "●●"); //~ ERROR character literal may only contain one codepoint
+    //~^ ERROR format argument must be a string literal
 }
diff --git a/src/test/ui/str/str-as-char.rs b/src/test/ui/str/str-as-char.rs
index 710fa74a32a..fb179ec7245 100644
--- a/src/test/ui/str/str-as-char.rs
+++ b/src/test/ui/str/str-as-char.rs
@@ -1,6 +1,6 @@
 // run-rustfix
 
 fn main() {
-    println!('●●');
-    //~^ ERROR character literal may only contain one codepoint
+    println!('●●'); //~ ERROR character literal may only contain one codepoint
+    //~^ ERROR format argument must be a string literal
 }
diff --git a/src/test/ui/str/str-as-char.stderr b/src/test/ui/str/str-as-char.stderr
index 540a1b55376..4ca430a4cde 100644
--- a/src/test/ui/str/str-as-char.stderr
+++ b/src/test/ui/str/str-as-char.stderr
@@ -1,12 +1,22 @@
 error: character literal may only contain one codepoint
   --> $DIR/str-as-char.rs:4:14
    |
-LL |     println!('●●');
+LL |     println!('●●'); //~ ERROR character literal may only contain one codepoint
    |              ^^^^
 help: if you meant to write a `str` literal, use double quotes
    |
-LL |     println!("●●");
+LL |     println!("●●"); //~ ERROR character literal may only contain one codepoint
    |              ^^^^
 
-error: aborting due to previous error
+error: format argument must be a string literal
+  --> $DIR/str-as-char.rs:4:14
+   |
+LL |     println!('●●'); //~ ERROR character literal may only contain one codepoint
+   |              ^^^^
+help: you might be missing a string literal to format with
+   |
+LL |     println!("{}", '●●'); //~ ERROR character literal may only contain one codepoint
+   |              ^^^^^
+
+error: aborting due to 2 previous errors