]> git.lizzy.rs Git - rust.git/commitdiff
rustup (rustc 1.0.0-nightly (00978a987 2015-04-18) (built 2015-04-19))
authorManish Goregaokar <manishsmail@gmail.com>
Mon, 20 Apr 2015 10:48:35 +0000 (16:18 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Mon, 20 Apr 2015 10:48:35 +0000 (16:18 +0530)
src/lib.rs
src/misc.rs

index b3f395e5a135c784d425e270785282c30abc6b7e..ee137230f5ce12f8695f3de9abb16f86701ac7b9 100644 (file)
@@ -1,5 +1,5 @@
 #![feature(plugin_registrar, box_syntax)]
-#![feature(rustc_private, core, collections)]
+#![feature(rustc_private, collections)]
 
 #![allow(unused_imports)]
 
index 3fb88e431da78f55a1e259c58dff4d5687a2f2ca..04accaaa8bc394feecc7a85d795e5571a53a0d78 100644 (file)
@@ -37,9 +37,9 @@ fn check_expr(&mut self, cx: &Context, expr: &Expr) {
                         let map = cx.sess().codemap();
                         span_note_and_lint(cx, SINGLE_MATCH, expr.span,
                               "You seem to be trying to use match for destructuring a single type. Did you mean to use `if let`?",
-                              format!("Try if let {} = {} {{ ... }}",
-                                      map.span_to_snippet(arms[0].pats[0].span).unwrap_or("..".to_string()),
-                                      map.span_to_snippet(ex.span).unwrap_or("..".to_string())).as_slice()
+                              &*format!("Try if let {} = {} {{ ... }}",
+                                      &*map.span_to_snippet(arms[0].pats[0].span).unwrap_or("..".to_string()),
+                                      &*map.span_to_snippet(ex.span).unwrap_or("..".to_string()))
                         );
                     }
                 }