Skip to content

Commit 5d82c0f

Browse files
committed
rollup merge of #21411: P1start/help-tweaks
Conflicts: src/librustc_typeck/check/closure.rs
2 parents 1646707 + ed769bf commit 5d82c0f

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

src/librustc/middle/resolve_lifetime.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,11 @@ impl<'a> LifetimeContext<'a> {
457457
format!("lifetime name `{}` shadows another \
458458
lifetime name that is already in scope",
459459
token::get_name(lifetime.name)).as_slice());
460-
self.sess.span_help(
460+
self.sess.span_note(
461461
lifetime_def.span,
462462
format!("shadowed lifetime `{}` declared here",
463463
token::get_name(lifetime.name)).as_slice());
464-
self.sess.span_help(
464+
self.sess.span_note(
465465
lifetime.span,
466466
"shadowed lifetimes are deprecated \
467467
and will become a hard error before 1.0");

src/librustc_typeck/astconv.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -886,14 +886,14 @@ fn ast_ty_to_trait_ref<'tcx>(this: &AstConv<'tcx>,
886886
pprust::ty_to_string(ty));
887887
match ty.node {
888888
ast::TyRptr(None, ref mut_ty) => {
889-
span_note!(this.tcx().sess, ty.span,
889+
span_help!(this.tcx().sess, ty.span,
890890
"perhaps you meant `&{}({} +{})`? (per RFC 438)",
891891
ppaux::mutability_to_string(mut_ty.mutbl),
892892
pprust::ty_to_string(&*mut_ty.ty),
893893
pprust::bounds_to_string(bounds));
894894
}
895895
ast::TyRptr(Some(ref lt), 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
pprust::lifetime_to_string(lt),
899899
ppaux::mutability_to_string(mut_ty.mutbl),
@@ -902,7 +902,7 @@ fn ast_ty_to_trait_ref<'tcx>(this: &AstConv<'tcx>,
902902
}
903903

904904
_ => {
905-
span_note!(this.tcx().sess, ty.span,
905+
span_help!(this.tcx().sess, ty.span,
906906
"perhaps you forgot parentheses? (per RFC 438)");
907907
}
908908
}

src/librustc_typeck/check/closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub fn check_expr_closure<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
5151
check_unboxed_closure(fcx, expr, kind, decl, body, None);
5252

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

src/libsyntax/parse/parser.rs

+1-1
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

+3-3
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

+1-1
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

+4-4
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

+1-1
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)