Skip to content

Commit ed769bf

Browse files
committed
Fix up some ‘help’ messages
1 parent 7f8c687 commit ed769bf

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

src/librustc/middle/resolve_lifetime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,11 @@ impl<'a> LifetimeContext<'a> {
462462
format!("lifetime name `{}` shadows another \
463463
lifetime name that is already in scope",
464464
token::get_name(lifetime.name)).as_slice());
465-
self.sess.span_help(
465+
self.sess.span_note(
466466
lifetime_def.span,
467467
format!("shadowed lifetime `{}` declared here",
468468
token::get_name(lifetime.name)).as_slice());
469-
self.sess.span_help(
469+
self.sess.span_note(
470470
lifetime.span,
471471
"shadowed lifetimes are deprecated \
472472
and will become a hard error before 1.0");

src/librustc_typeck/astconv.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -893,14 +893,14 @@ fn ast_ty_to_trait_ref<'tcx>(this: &AstConv<'tcx>,
893893
pprust::ty_to_string(ty));
894894
match ty.node {
895895
ast::TyRptr(None, ref mut_ty) => {
896-
span_note!(this.tcx().sess, ty.span,
896+
span_help!(this.tcx().sess, ty.span,
897897
"perhaps you meant `&{}({} +{})`? (per RFC 438)",
898898
ppaux::mutability_to_string(mut_ty.mutbl),
899899
pprust::ty_to_string(&*mut_ty.ty),
900900
pprust::bounds_to_string(bounds));
901901
}
902902
ast::TyRptr(Some(ref lt), ref mut_ty) => {
903-
span_note!(this.tcx().sess, ty.span,
903+
span_help!(this.tcx().sess, ty.span,
904904
"perhaps you meant `&{} {}({} +{})`? (per RFC 438)",
905905
pprust::lifetime_to_string(lt),
906906
ppaux::mutability_to_string(mut_ty.mutbl),
@@ -909,7 +909,7 @@ fn ast_ty_to_trait_ref<'tcx>(this: &AstConv<'tcx>,
909909
}
910910

911911
_ => {
912-
span_note!(this.tcx().sess, ty.span,
912+
span_help!(this.tcx().sess, ty.span,
913913
"perhaps you forgot parentheses? (per RFC 438)");
914914
}
915915
}

src/librustc_typeck/check/closure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn check_expr_closure<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
5252

5353
fcx.ccx.tcx.sess.span_err(
5454
expr.span,
55-
"can't infer the \"kind\" of the closure, explicitly annotate it. e.g. \
55+
"can't infer the \"kind\" of the closure; explicitly annotate it; e.g. \
5656
`|&:| {}`");
5757
},
5858
Some((sig, kind)) => {

src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2921,7 +2921,7 @@ impl<'a> Parser<'a> {
29212921
"Chained comparison operators require parentheses");
29222922
if op == BiLt && outer_op == BiGt {
29232923
self.span_help(op_span,
2924-
"Use ::< instead of < if you meant to specify type arguments.");
2924+
"use ::< instead of < if you meant to specify type arguments");
29252925
}
29262926
}
29272927
_ => {}

src/test/compile-fail/hrtb-precedence-of-plus-error-message.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ trait Bar {
1919
struct Foo<'a> {
2020
a: &'a Bar+'a,
2121
//~^ ERROR E0178
22-
//~^^ NOTE perhaps you meant `&'a (Bar + 'a)`?
22+
//~^^ HELP perhaps you meant `&'a (Bar + 'a)`?
2323

2424
b: &'a mut Bar+'a,
2525
//~^ ERROR E0178
26-
//~^^ NOTE perhaps you meant `&'a mut (Bar + 'a)`?
26+
//~^^ HELP perhaps you meant `&'a mut (Bar + 'a)`?
2727

2828
c: Box<Bar+'a>, // OK, no paren needed in this context
2929

3030
d: fn() -> Bar+'a,
3131
//~^ ERROR E0178
32-
//~^^ NOTE perhaps you forgot parentheses
32+
//~^^ HELP perhaps you forgot parentheses
3333
//~^^^ WARN deprecated syntax
3434
}
3535

src/test/compile-fail/require-parens-for-chained-comparison.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ fn main() {
1919

2020
f<X>();
2121
//~^ ERROR: Chained comparison operators require parentheses
22-
//~^^ HELP: Use ::< instead of < if you meant to specify type arguments.
22+
//~^^ HELP: use ::< instead of < if you meant to specify type arguments
2323
}

src/test/compile-fail/shadowed-lifetime.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
struct Foo<'a>(&'a isize);
1414

1515
impl<'a> Foo<'a> {
16-
//~^ HELP shadowed lifetime `'a` declared here
16+
//~^ NOTE shadowed lifetime `'a` declared here
1717
fn shadow_in_method<'a>(&'a self) -> &'a isize {
1818
//~^ WARNING lifetime name `'a` shadows another lifetime name that is already in scope
19-
//~| HELP deprecated
19+
//~| NOTE deprecated
2020
self.0
2121
}
2222

2323
fn shadow_in_type<'b>(&'b self) -> &'b isize {
24-
//~^ HELP shadowed lifetime `'b` declared here
24+
//~^ NOTE shadowed lifetime `'b` declared here
2525
let x: for<'b> fn(&'b isize) = panic!();
2626
//~^ WARNING lifetime name `'b` shadows another lifetime name that is already in scope
27-
//~| HELP deprecated
27+
//~| NOTE deprecated
2828
self.0
2929
}
3030

src/test/compile-fail/unsized2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ pub fn main() {
1616
f<type>();
1717
//~^ ERROR expected identifier, found keyword `type`
1818
//~^^ ERROR: Chained comparison operators require parentheses
19-
//~^^^ HELP: Use ::< instead of < if you meant to specify type arguments.
19+
//~^^^ HELP: use ::< instead of < if you meant to specify type arguments
2020
}

0 commit comments

Comments
 (0)