summaryrefslogtreecommitdiffstats
path: root/src/test/ui/inference/str-as-char.fixed
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/inference/str-as-char.fixed8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/ui/inference/str-as-char.fixed b/src/test/ui/inference/str-as-char.fixed
new file mode 100644
index 000000000..09f3dec5a
--- /dev/null
+++ b/src/test/ui/inference/str-as-char.fixed
@@ -0,0 +1,8 @@
+// When a char literal is used where a str should be,
+// suggest changing to double quotes.
+
+// run-rustfix
+
+fn main() {
+ let _: &str = "a"; //~ ERROR mismatched types
+}