]> git.lizzy.rs Git - rust.git/commitdiff
Fix up some ‘help’ messages
authorP1start <rewi-github@whanau.org>
Tue, 20 Jan 2015 06:25:28 +0000 (19:25 +1300)
committerP1start <rewi-github@whanau.org>
Tue, 20 Jan 2015 06:51:44 +0000 (19:51 +1300)
src/librustc/middle/resolve_lifetime.rs
src/librustc_typeck/astconv.rs
src/librustc_typeck/check/closure.rs
src/libsyntax/parse/parser.rs
src/test/compile-fail/hrtb-precedence-of-plus-error-message.rs
src/test/compile-fail/require-parens-for-chained-comparison.rs
src/test/compile-fail/shadowed-lifetime.rs
src/test/compile-fail/unsized2.rs

index eff0018becc01c8fa822b0b03deae2ab571136b1..354c476cdd83ecf8eb6d883a0dd2817fc68d4c90 100644 (file)
@@ -462,11 +462,11 @@ fn check_lifetime_def_for_shadowing(&self,
                             format!("lifetime name `{}` shadows another \
                                     lifetime name that is already in scope",
                                     token::get_name(lifetime.name)).as_slice());
-                        self.sess.span_help(
+                        self.sess.span_note(
                             lifetime_def.span,
                             format!("shadowed lifetime `{}` declared here",
                                     token::get_name(lifetime.name)).as_slice());
-                        self.sess.span_help(
+                        self.sess.span_note(
                             lifetime.span,
                             "shadowed lifetimes are deprecated \
                              and will become a hard error before 1.0");
index 42b12c158664ae2247d1e2a60744bda4f08ad8fc..14f727cb5833af58029927788cc7f81e1fa18208 100644 (file)
@@ -893,14 +893,14 @@ fn ast_ty_to_trait_ref<'tcx>(this: &AstConv<'tcx>,
                       pprust::ty_to_string(ty));
             match ty.node {
                 ast::TyRptr(None, ref mut_ty) => {
-                    span_note!(this.tcx().sess, ty.span,
+                    span_help!(this.tcx().sess, ty.span,
                                "perhaps you meant `&{}({} +{})`? (per RFC 438)",
                                ppaux::mutability_to_string(mut_ty.mutbl),
                                pprust::ty_to_string(&*mut_ty.ty),
                                pprust::bounds_to_string(bounds));
                 }
                ast::TyRptr(Some(ref lt), ref mut_ty) => {
-                    span_note!(this.tcx().sess, ty.span,
+                    span_help!(this.tcx().sess, ty.span,
                                "perhaps you meant `&{} {}({} +{})`? (per RFC 438)",
                                pprust::lifetime_to_string(lt),
                                ppaux::mutability_to_string(mut_ty.mutbl),
@@ -909,7 +909,7 @@ fn ast_ty_to_trait_ref<'tcx>(this: &AstConv<'tcx>,
                 }
 
                 _ => {
-                    span_note!(this.tcx().sess, ty.span,
+                    span_help!(this.tcx().sess, ty.span,
                                "perhaps you forgot parentheses? (per RFC 438)");
                 }
             }
index bfe43086aab10205a38022dc89129dfce5712fb1..0847807c1c0a6b6d25b181bc127634936d962700 100644 (file)
@@ -52,7 +52,7 @@ pub fn check_expr_closure<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
 
                     fcx.ccx.tcx.sess.span_err(
                         expr.span,
-                        "can't infer the \"kind\" of the closure, explicitly annotate it. e.g. \
+                        "can't infer the \"kind\" of the closure; explicitly annotate it; e.g. \
                         `|&:| {}`");
                 },
                 Some((sig, kind)) => {
index 83a7504bc49848939cccbc71106f0875591c7bea..f5204478906f06c72f7163c4a2eb6d173ee4c2e7 100644 (file)
@@ -2921,7 +2921,7 @@ fn check_no_chained_comparison(&mut self, lhs: &Expr, outer_op: ast::BinOp) {
                     "Chained comparison operators require parentheses");
                 if op == BiLt && outer_op == BiGt {
                     self.span_help(op_span,
-                        "Use ::< instead of < if you meant to specify type arguments.");
+                        "use ::< instead of < if you meant to specify type arguments");
                 }
             }
             _ => {}
index 41a0be37add418a09afb8807c5bb6e9dc3c69c03..db67249bbd93aa11d8e9ede38b9154b0fdc09801 100644 (file)
@@ -19,17 +19,17 @@ fn dummy(&self) { }
 struct Foo<'a> {
     a: &'a Bar+'a,
         //~^ ERROR E0178
-        //~^^ NOTE perhaps you meant `&'a (Bar + 'a)`?
+        //~^^ HELP perhaps you meant `&'a (Bar + 'a)`?
 
     b: &'a mut Bar+'a,
         //~^ ERROR E0178
-        //~^^ NOTE perhaps you meant `&'a mut (Bar + 'a)`?
+        //~^^ HELP perhaps you meant `&'a mut (Bar + 'a)`?
 
     c: Box<Bar+'a>, // OK, no paren needed in this context
 
     d: fn() -> Bar+'a,
         //~^ ERROR E0178
-        //~^^ NOTE perhaps you forgot parentheses
+        //~^^ HELP perhaps you forgot parentheses
         //~^^^ WARN deprecated syntax
 }
 
index 7513815ad730c2b27ab2e8749e4531b4b3e527f2..f5d8c5748147ae3c3f75b737daf762c6f179def7 100644 (file)
@@ -19,5 +19,5 @@ fn main() {
 
     f<X>();
     //~^ ERROR: Chained comparison operators require parentheses
-    //~^^ HELP: Use ::< instead of < if you meant to specify type arguments.
+    //~^^ HELP: use ::< instead of < if you meant to specify type arguments
 }
index 57a2744d8f8834bafca3fd06a5f5cba7b92f0ceb..bf8a8f5046e7513f5f5f8825a4af762f9e5e3987 100644 (file)
 struct Foo<'a>(&'a isize);
 
 impl<'a> Foo<'a> {
-    //~^ HELP shadowed lifetime `'a` declared here
+    //~^ NOTE shadowed lifetime `'a` declared here
     fn shadow_in_method<'a>(&'a self) -> &'a isize {
         //~^ WARNING lifetime name `'a` shadows another lifetime name that is already in scope
-        //~| HELP deprecated
+        //~| NOTE deprecated
         self.0
     }
 
     fn shadow_in_type<'b>(&'b self) -> &'b isize {
-        //~^ HELP shadowed lifetime `'b` declared here
+        //~^ NOTE shadowed lifetime `'b` declared here
         let x: for<'b> fn(&'b isize) = panic!();
         //~^ WARNING lifetime name `'b` shadows another lifetime name that is already in scope
-        //~| HELP deprecated
+        //~| NOTE deprecated
         self.0
     }
 
index 604f7ba3255cd2410c3d04234722dc9f0633a7b9..a47d81e38ccba71b6cd34f029f7724cb4d40fa2e 100644 (file)
@@ -16,5 +16,5 @@ pub fn main() {
     f<type>();
     //~^ ERROR expected identifier, found keyword `type`
     //~^^ ERROR: Chained comparison operators require parentheses
-    //~^^^ HELP: Use ::< instead of < if you meant to specify type arguments.
+    //~^^^ HELP: use ::< instead of < if you meant to specify type arguments
 }