Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c20a157

Browse files
authoredMay 23, 2017
Rollup merge of rust-lang#42033 - oli-obk:suggestions, r=petrochenkov
Change some notes into suggestions r? @petrochenkov since you commented on the same edits in rust-lang#39458
2 parents 5b13bff + 72eb010 commit c20a157

32 files changed

+392
-66
lines changed
 

‎src/librustc_borrowck/borrowck/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
10021002
.span_suggestion(err.span,
10031003
&format!("to force the closure to take ownership of {} \
10041004
(and any other referenced variables), \
1005-
use the `move` keyword, as shown:",
1005+
use the `move` keyword",
10061006
cmt_path_or_string),
10071007
suggestion)
10081008
.emit();

‎src/librustc_errors/diagnostic.rs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,18 @@ impl Diagnostic {
203203

204204
/// Prints out a message with a suggested edit of the code.
205205
///
206+
/// In case of short messages and a simple suggestion,
207+
/// rustc displays it as a label like
208+
///
209+
/// "try adding parentheses: `(tup.0).1`"
210+
///
211+
/// The message
212+
/// * should not end in any punctuation (a `:` is added automatically)
213+
/// * should not be a question
214+
/// * should not contain any parts like "the following", "as shown"
215+
/// * may look like "to do xyz, use" or "to do xyz, use abc"
216+
/// * may contain a name of a function, variable or type, but not whole expressions
217+
///
206218
/// See `diagnostic::CodeSuggestion` for more information.
207219
pub fn span_suggestion(&mut self, sp: Span, msg: &str, suggestion: String) -> &mut Self {
208220
self.suggestions.push(CodeSuggestion {

‎src/librustc_errors/emitter.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl Emitter for EmitterWriter {
4646
// don't display multiline suggestions as labels
4747
sugg.substitution_parts[0].substitutions[0].find('\n').is_none() {
4848
let substitution = &sugg.substitution_parts[0].substitutions[0];
49-
let msg = format!("help: {} `{}`", sugg.msg, substitution);
49+
let msg = format!("help: {}: `{}`", sugg.msg, substitution);
5050
primary_span.push_span_label(sugg.substitution_spans().next().unwrap(), msg);
5151
} else {
5252
// if there are multiple suggestions, print them all in full

‎src/librustc_resolve/lib.rs‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2307,13 +2307,15 @@ impl<'a> Resolver<'a> {
23072307
.map(|suggestion| import_candidate_to_paths(&suggestion)).collect::<Vec<_>>();
23082308
enum_candidates.sort();
23092309
for (sp, variant_path, enum_path) in enum_candidates {
2310-
let msg = format!("there is an enum variant `{}`, did you mean to use `{}`?",
2311-
variant_path,
2312-
enum_path);
23132310
if sp == DUMMY_SP {
2311+
let msg = format!("there is an enum variant `{}`, \
2312+
try using `{}`?",
2313+
variant_path,
2314+
enum_path);
23142315
err.help(&msg);
23152316
} else {
2316-
err.span_help(sp, &msg);
2317+
err.span_suggestion(span, "you can try using the variant's enum",
2318+
enum_path);
23172319
}
23182320
}
23192321
}
@@ -2322,18 +2324,20 @@ impl<'a> Resolver<'a> {
23222324
let self_is_available = this.self_value_is_available(path[0].ctxt, span);
23232325
match candidate {
23242326
AssocSuggestion::Field => {
2325-
err.span_label(span, format!("did you mean `self.{}`?", path_str));
2327+
err.span_suggestion(span, "try",
2328+
format!("self.{}", path_str));
23262329
if !self_is_available {
23272330
err.span_label(span, format!("`self` value is only available in \
23282331
methods with `self` parameter"));
23292332
}
23302333
}
23312334
AssocSuggestion::MethodWithSelf if self_is_available => {
2332-
err.span_label(span, format!("did you mean `self.{}(...)`?",
2333-
path_str));
2335+
err.span_suggestion(span, "try",
2336+
format!("self.{}", path_str));
23342337
}
23352338
AssocSuggestion::MethodWithSelf | AssocSuggestion::AssocItem => {
2336-
err.span_label(span, format!("did you mean `Self::{}`?", path_str));
2339+
err.span_suggestion(span, "try",
2340+
format!("Self::{}", path_str));
23372341
}
23382342
}
23392343
return err;

‎src/librustc_resolve/macros.rs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,10 @@ impl<'a> Resolver<'a> {
649649
if let Some(suggestion) = suggestion {
650650
if suggestion != name {
651651
if let MacroKind::Bang = kind {
652-
err.help(&format!("did you mean `{}!`?", suggestion));
652+
err.span_suggestion(span, "you could try the macro",
653+
format!("{}!", suggestion));
653654
} else {
654-
err.help(&format!("did you mean `{}`?", suggestion));
655+
err.span_suggestion(span, "try", suggestion.to_string());
655656
}
656657
} else {
657658
err.help("have you added the `#[macro_use]` on the module/import?");

‎src/librustc_typeck/check/cast.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
276276
match fcx.tcx.sess.codemap().span_to_snippet(self.cast_span) {
277277
Ok(s) => {
278278
err.span_suggestion(self.cast_span,
279-
"try casting to a reference instead:",
279+
"try casting to a reference instead",
280280
format!("&{}{}", mtstr, s));
281281
}
282282
Err(_) => {
@@ -295,7 +295,7 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
295295
match fcx.tcx.sess.codemap().span_to_snippet(self.cast_span) {
296296
Ok(s) => {
297297
err.span_suggestion(self.cast_span,
298-
"try casting to a `Box` instead:",
298+
"try casting to a `Box` instead",
299299
format!("Box<{}>", s));
300300
}
301301
Err(_) => span_help!(err, self.cast_span, "did you mean `Box<{}>`?", tstr),

‎src/librustc_typeck/check/op.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
290290
from a string reference. String concatenation \
291291
appends the string on the right to the string \
292292
on the left and may require reallocation. This \
293-
requires ownership of the string on the left."), suggestion);
293+
requires ownership of the string on the left"), suggestion);
294294
is_string_addition = true;
295295
}
296296

‎src/libsyntax/parse/parser.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,7 @@ impl<'a> Parser<'a> {
15071507
s.print_bounds(" +", &bounds)?;
15081508
s.pclose()
15091509
});
1510-
err.span_suggestion(sum_span, "try adding parentheses:", sum_with_parens);
1510+
err.span_suggestion(sum_span, "try adding parentheses", sum_with_parens);
15111511
}
15121512
TyKind::Ptr(..) | TyKind::BareFn(..) => {
15131513
err.span_label(sum_span, "perhaps you forgot parentheses?");
@@ -5180,7 +5180,7 @@ impl<'a> Parser<'a> {
51805180
`pub(in path::to::module)`: visible only on the specified path"##;
51815181
let path = self.parse_path(PathStyle::Mod)?;
51825182
let path_span = self.prev_span;
5183-
let help_msg = format!("make this visible only to module `{}` with `in`:", path);
5183+
let help_msg = format!("make this visible only to module `{}` with `in`", path);
51845184
self.expect(&token::CloseDelim(token::Paren))?; // `)`
51855185
let mut err = self.span_fatal_help(path_span, msg, suggestion);
51865186
err.span_suggestion(path_span, &help_msg, format!("in {}", path));
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// force-host
12+
// no-prefer-dynamic
13+
#![feature(proc_macro)]
14+
#![crate_type = "proc-macro"]
15+
16+
extern crate proc_macro;
17+
18+
use proc_macro::TokenStream;
19+
20+
#[proc_macro_attribute]
21+
pub fn attr_proc_macro(_: TokenStream, input: TokenStream) -> TokenStream {
22+
input
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// force-host
12+
// no-prefer-dynamic
13+
#![feature(proc_macro)]
14+
#![crate_type = "proc-macro"]
15+
16+
extern crate proc_macro;
17+
18+
use proc_macro::TokenStream;
19+
20+
#[proc_macro]
21+
pub fn bang_proc_macro(input: TokenStream) -> TokenStream {
22+
input
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// force-host
12+
// no-prefer-dynamic
13+
14+
#![crate_type = "proc-macro"]
15+
16+
extern crate proc_macro;
17+
18+
use proc_macro::TokenStream;
19+
20+
#[proc_macro_derive(Clona)]
21+
pub fn derive_clonea(input: TokenStream) -> TokenStream {
22+
"".parse().unwrap()
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// force-host
12+
// no-prefer-dynamic
13+
14+
#![crate_type = "proc-macro"]
15+
16+
extern crate proc_macro;
17+
18+
use proc_macro::TokenStream;
19+
20+
#[proc_macro_derive(FooWithLongName)]
21+
pub fn derive_foo(input: TokenStream) -> TokenStream {
22+
"".parse().unwrap()
23+
}

‎src/test/compile-fail-fulldeps/proc-macro/resolve-error.rs‎ renamed to ‎src/test/ui-fulldeps/resolve-error.rs‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,10 @@ macro_rules! attr_proc_mac {
3636

3737
#[derive(FooWithLongNan)]
3838
//~^ ERROR cannot find derive macro `FooWithLongNan` in this scope
39-
//~^^ HELP did you mean `FooWithLongName`?
4039
struct Foo;
4140

4241
#[attr_proc_macra]
4342
//~^ ERROR cannot find attribute macro `attr_proc_macra` in this scope
44-
//~^^ HELP did you mean `attr_proc_macro`?
4543
struct Bar;
4644

4745
#[FooWithLongNan]
@@ -50,12 +48,10 @@ struct Asdf;
5048

5149
#[derive(Dlone)]
5250
//~^ ERROR cannot find derive macro `Dlone` in this scope
53-
//~^^ HELP did you mean `Clone`?
5451
struct A;
5552

5653
#[derive(Dlona)]
5754
//~^ ERROR cannot find derive macro `Dlona` in this scope
58-
//~^^ HELP did you mean `Clona`?
5955
struct B;
6056

6157
#[derive(attr_proc_macra)]
@@ -65,16 +61,13 @@ struct C;
6561
fn main() {
6662
FooWithLongNama!();
6763
//~^ ERROR cannot find macro `FooWithLongNama!` in this scope
68-
//~^^ HELP did you mean `FooWithLongNam!`?
6964

7065
attr_proc_macra!();
7166
//~^ ERROR cannot find macro `attr_proc_macra!` in this scope
72-
//~^^ HELP did you mean `attr_proc_mac!`?
7367

7468
Dlona!();
7569
//~^ ERROR cannot find macro `Dlona!` in this scope
7670

7771
bang_proc_macrp!();
7872
//~^ ERROR cannot find macro `bang_proc_macrp!` in this scope
79-
//~^^ HELP did you mean `bang_proc_macro!`?
8073
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
error: cannot find derive macro `FooWithLongNan` in this scope
2+
--> $DIR/resolve-error.rs:37:10
3+
|
4+
37 | #[derive(FooWithLongNan)]
5+
| ^^^^^^^^^^^^^^ help: try: `FooWithLongName`
6+
7+
error: cannot find attribute macro `attr_proc_macra` in this scope
8+
--> $DIR/resolve-error.rs:41:3
9+
|
10+
41 | #[attr_proc_macra]
11+
| ^^^^^^^^^^^^^^^ help: try: `attr_proc_macro`
12+
13+
error: cannot find attribute macro `FooWithLongNan` in this scope
14+
--> $DIR/resolve-error.rs:45:3
15+
|
16+
45 | #[FooWithLongNan]
17+
| ^^^^^^^^^^^^^^
18+
19+
error: cannot find derive macro `Dlone` in this scope
20+
--> $DIR/resolve-error.rs:49:10
21+
|
22+
49 | #[derive(Dlone)]
23+
| ^^^^^ help: try: `Clone`
24+
25+
error: cannot find derive macro `Dlona` in this scope
26+
--> $DIR/resolve-error.rs:53:10
27+
|
28+
53 | #[derive(Dlona)]
29+
| ^^^^^ help: try: `Clona`
30+
31+
error: cannot find derive macro `attr_proc_macra` in this scope
32+
--> $DIR/resolve-error.rs:57:10
33+
|
34+
57 | #[derive(attr_proc_macra)]
35+
| ^^^^^^^^^^^^^^^
36+
37+
error: cannot find macro `FooWithLongNama!` in this scope
38+
--> $DIR/resolve-error.rs:62:5
39+
|
40+
62 | FooWithLongNama!();
41+
| ^^^^^^^^^^^^^^^ help: you could try the macro: `FooWithLongNam!`
42+
43+
error: cannot find macro `attr_proc_macra!` in this scope
44+
--> $DIR/resolve-error.rs:65:5
45+
|
46+
65 | attr_proc_macra!();
47+
| ^^^^^^^^^^^^^^^ help: you could try the macro: `attr_proc_mac!`
48+
49+
error: cannot find macro `Dlona!` in this scope
50+
--> $DIR/resolve-error.rs:68:5
51+
|
52+
68 | Dlona!();
53+
| ^^^^^
54+
55+
error: cannot find macro `bang_proc_macrp!` in this scope
56+
--> $DIR/resolve-error.rs:71:5
57+
|
58+
71 | bang_proc_macrp!();
59+
| ^^^^^^^^^^^^^^^ help: you could try the macro: `bang_proc_macro!`
60+
61+
error: aborting due to 10 previous errors
62+

‎src/test/compile-fail/cast-to-unsized-trait-object-suggestion.rs‎ renamed to ‎src/test/ui/cast-to-unsized-trait-object-suggestion.rs‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
fn main() {
1212
&1 as Send;
1313
//~^ ERROR cast to unsized type
14-
//~| HELP try casting to a reference instead:
15-
//~| SUGGESTION &1 as &Send;
1614
Box::new(1) as Send;
1715
//~^ ERROR cast to unsized type
18-
//~| HELP try casting to a `Box` instead:
19-
//~| SUGGESTION Box::new(1) as Box<Send>;
2016
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error: cast to unsized type: `&{integer}` as `std::marker::Send`
2+
--> $DIR/cast-to-unsized-trait-object-suggestion.rs:12:5
3+
|
4+
12 | &1 as Send;
5+
| ^^^^^^----
6+
| |
7+
| help: try casting to a reference instead: `&Send`
8+
9+
error: cast to unsized type: `std::boxed::Box<{integer}>` as `std::marker::Send`
10+
--> $DIR/cast-to-unsized-trait-object-suggestion.rs:14:5
11+
|
12+
14 | Box::new(1) as Send;
13+
| ^^^^^^^^^^^^^^^----
14+
| |
15+
| help: try casting to a `Box` instead: `Box<Send>`
16+
17+
error: aborting due to 2 previous errors
18+
File renamed without changes.

‎src/test/ui/issue-35675.stderr‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
error[E0412]: cannot find type `Apple` in this scope
2+
--> $DIR/issue-35675.rs:20:29
3+
|
4+
20 | fn should_return_fruit() -> Apple {
5+
| ^^^^^
6+
| |
7+
| not found in this scope
8+
| help: you can try using the variant's enum: `Fruit`
9+
10+
error[E0425]: cannot find function `Apple` in this scope
11+
--> $DIR/issue-35675.rs:23:5
12+
|
13+
23 | Apple(5)
14+
| ^^^^^ not found in this scope
15+
|
16+
help: possible candidate is found in another module, you can import it into scope
17+
| use Fruit::Apple;
18+
19+
error[E0573]: expected type, found variant `Fruit::Apple`
20+
--> $DIR/issue-35675.rs:28:33
21+
|
22+
28 | fn should_return_fruit_too() -> Fruit::Apple {
23+
| ^^^^^^^^^^^^
24+
| |
25+
| not a type
26+
| help: you can try using the variant's enum: `Fruit`
27+
28+
error[E0425]: cannot find function `Apple` in this scope
29+
--> $DIR/issue-35675.rs:31:5
30+
|
31+
31 | Apple(5)
32+
| ^^^^^ not found in this scope
33+
|
34+
help: possible candidate is found in another module, you can import it into scope
35+
| use Fruit::Apple;
36+
37+
error[E0573]: expected type, found variant `Ok`
38+
--> $DIR/issue-35675.rs:36:13
39+
|
40+
36 | fn foo() -> Ok {
41+
| ^^ not a type
42+
|
43+
= help: there is an enum variant `std::prelude::v1::Ok`, try using `std::prelude::v1`?
44+
= help: there is an enum variant `std::prelude::v1::Result::Ok`, try using `std::prelude::v1::Result`?
45+
46+
error[E0412]: cannot find type `Variant3` in this scope
47+
--> $DIR/issue-35675.rs:44:13
48+
|
49+
44 | fn bar() -> Variant3 {
50+
| ^^^^^^^^
51+
| |
52+
| not found in this scope
53+
| help: you can try using the variant's enum: `x::Enum`
54+
55+
error[E0573]: expected type, found variant `Some`
56+
--> $DIR/issue-35675.rs:49:13
57+
|
58+
49 | fn qux() -> Some {
59+
| ^^^^ not a type
60+
|
61+
= help: there is an enum variant `std::option::Option::Some`, try using `std::option::Option`?
62+
= help: there is an enum variant `std::prelude::v1::Some`, try using `std::prelude::v1`?
63+
64+
error: aborting due to 7 previous errors
65+

‎src/test/ui/issue-40402-ref-hints/issue-40402-1.stderr‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0507]: cannot move out of indexed content
44
19 | let e = f.v[0];
55
| ^^^^^^
66
| |
7-
| help: consider using a reference instead `&f.v[0]`
7+
| help: consider using a reference instead: `&f.v[0]`
88
| cannot move out of indexed content
99

1010
error: aborting due to previous error

‎src/test/compile-fail/macro-name-typo.rs‎ renamed to ‎src/test/ui/macros/macro-name-typo.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@
1111
fn main() {
1212
printlx!("oh noes!");
1313
//~^ ERROR cannot find macro
14-
//~^^ HELP did you mean `println!`?
1514
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: cannot find macro `printlx!` in this scope
2+
--> $DIR/macro-name-typo.rs:12:5
3+
|
4+
12 | printlx!("oh noes!");
5+
| ^^^^^^^ help: you could try the macro: `println!`
6+
7+
error: aborting due to previous error
8+

‎src/test/compile-fail/macro_undefined.rs‎ renamed to ‎src/test/ui/macros/macro_undefined.rs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ mod m {
2020
fn main() {
2121
k!();
2222
//~^ ERROR cannot find macro `k!` in this scope
23-
//~^^ HELP did you mean `kl!`?
2423
kl!();
2524
//~^ ERROR cannot find macro `kl!` in this scope
26-
//~^^ HELP have you added the `#[macro_use]` on the module/import?
2725
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error: cannot find macro `kl!` in this scope
2+
--> $DIR/macro_undefined.rs:23:5
3+
|
4+
23 | kl!();
5+
| ^^
6+
|
7+
= help: have you added the `#[macro_use]` on the module/import?
8+
9+
error: cannot find macro `k!` in this scope
10+
--> $DIR/macro_undefined.rs:21:5
11+
|
12+
21 | k!();
13+
| ^ help: you could try the macro: `kl!`
14+
15+
error: aborting due to 2 previous errors
16+

‎src/test/ui/resolve-error.stderr‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
error: cannot find derive macro `FooWithLongNan` in this scope
2+
--> $DIR/resolve-error.rs:37:10
3+
|
4+
37 | #[derive(FooWithLongNan)]
5+
| ^^^^^^^^^^^^^^ help: try: `FooWithLongName`
6+
7+
error: cannot find attribute macro `attr_proc_macra` in this scope
8+
--> $DIR/resolve-error.rs:41:3
9+
|
10+
41 | #[attr_proc_macra]
11+
| ^^^^^^^^^^^^^^^ help: try: `attr_proc_macro`
12+
13+
error: cannot find attribute macro `FooWithLongNan` in this scope
14+
--> $DIR/resolve-error.rs:45:3
15+
|
16+
45 | #[FooWithLongNan]
17+
| ^^^^^^^^^^^^^^
18+
19+
error: cannot find derive macro `Dlone` in this scope
20+
--> $DIR/resolve-error.rs:49:10
21+
|
22+
49 | #[derive(Dlone)]
23+
| ^^^^^ help: try: `Clone`
24+
25+
error: cannot find derive macro `Dlona` in this scope
26+
--> $DIR/resolve-error.rs:53:10
27+
|
28+
53 | #[derive(Dlona)]
29+
| ^^^^^ help: try: `Clona`
30+
31+
error: cannot find derive macro `attr_proc_macra` in this scope
32+
--> $DIR/resolve-error.rs:57:10
33+
|
34+
57 | #[derive(attr_proc_macra)]
35+
| ^^^^^^^^^^^^^^^
36+
37+
error: cannot find macro `FooWithLongNama!` in this scope
38+
--> $DIR/resolve-error.rs:62:5
39+
|
40+
62 | FooWithLongNama!();
41+
| ^^^^^^^^^^^^^^^ help: you could try the macro: `FooWithLongNam!`
42+
43+
error: cannot find macro `attr_proc_macra!` in this scope
44+
--> $DIR/resolve-error.rs:65:5
45+
|
46+
65 | attr_proc_macra!();
47+
| ^^^^^^^^^^^^^^^ help: you could try the macro: `attr_proc_mac!`
48+
49+
error: cannot find macro `Dlona!` in this scope
50+
--> $DIR/resolve-error.rs:68:5
51+
|
52+
68 | Dlona!();
53+
| ^^^^^
54+
55+
error: cannot find macro `bang_proc_macrp!` in this scope
56+
--> $DIR/resolve-error.rs:71:5
57+
|
58+
71 | bang_proc_macrp!();
59+
| ^^^^^^^^^^^^^^^ help: you could try the macro: `bang_proc_macro!`
60+
61+
error: aborting due to 10 previous errors
62+

‎src/test/ui/resolve/issue-14254.stderr‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0425]: cannot find function `baz` in this scope
22
--> $DIR/issue-14254.rs:29:9
33
|
44
29 | baz();
5-
| ^^^ did you mean `self.baz(...)`?
5+
| ^^^ help: try: `self.baz`
66

77
error[E0425]: cannot find value `a` in this scope
88
--> $DIR/issue-14254.rs:32:9
@@ -14,19 +14,19 @@ error[E0425]: cannot find function `baz` in this scope
1414
--> $DIR/issue-14254.rs:40:9
1515
|
1616
40 | baz();
17-
| ^^^ did you mean `self.baz(...)`?
17+
| ^^^ help: try: `self.baz`
1818

1919
error[E0425]: cannot find value `x` in this scope
2020
--> $DIR/issue-14254.rs:43:9
2121
|
2222
43 | x;
23-
| ^ did you mean `self.x`?
23+
| ^ help: try: `self.x`
2424

2525
error[E0425]: cannot find value `y` in this scope
2626
--> $DIR/issue-14254.rs:46:9
2727
|
2828
46 | y;
29-
| ^ did you mean `self.y`?
29+
| ^ help: try: `self.y`
3030

3131
error[E0425]: cannot find value `a` in this scope
3232
--> $DIR/issue-14254.rs:49:9
@@ -38,7 +38,7 @@ error[E0425]: cannot find value `bah` in this scope
3838
--> $DIR/issue-14254.rs:52:9
3939
|
4040
52 | bah;
41-
| ^^^ did you mean `Self::bah`?
41+
| ^^^ help: try: `Self::bah`
4242

4343
error[E0425]: cannot find value `b` in this scope
4444
--> $DIR/issue-14254.rs:55:9
@@ -50,19 +50,19 @@ error[E0425]: cannot find function `baz` in this scope
5050
--> $DIR/issue-14254.rs:63:9
5151
|
5252
63 | baz();
53-
| ^^^ did you mean `self.baz(...)`?
53+
| ^^^ help: try: `self.baz`
5454

5555
error[E0425]: cannot find value `x` in this scope
5656
--> $DIR/issue-14254.rs:66:9
5757
|
5858
66 | x;
59-
| ^ did you mean `self.x`?
59+
| ^ help: try: `self.x`
6060

6161
error[E0425]: cannot find value `y` in this scope
6262
--> $DIR/issue-14254.rs:69:9
6363
|
6464
69 | y;
65-
| ^ did you mean `self.y`?
65+
| ^ help: try: `self.y`
6666

6767
error[E0425]: cannot find value `a` in this scope
6868
--> $DIR/issue-14254.rs:72:9
@@ -74,7 +74,7 @@ error[E0425]: cannot find value `bah` in this scope
7474
--> $DIR/issue-14254.rs:75:9
7575
|
7676
75 | bah;
77-
| ^^^ did you mean `Self::bah`?
77+
| ^^^ help: try: `Self::bah`
7878

7979
error[E0425]: cannot find value `b` in this scope
8080
--> $DIR/issue-14254.rs:78:9
@@ -86,61 +86,61 @@ error[E0425]: cannot find function `baz` in this scope
8686
--> $DIR/issue-14254.rs:86:9
8787
|
8888
86 | baz();
89-
| ^^^ did you mean `self.baz(...)`?
89+
| ^^^ help: try: `self.baz`
9090

9191
error[E0425]: cannot find value `bah` in this scope
9292
--> $DIR/issue-14254.rs:89:9
9393
|
9494
89 | bah;
95-
| ^^^ did you mean `Self::bah`?
95+
| ^^^ help: try: `Self::bah`
9696

9797
error[E0425]: cannot find function `baz` in this scope
9898
--> $DIR/issue-14254.rs:97:9
9999
|
100100
97 | baz();
101-
| ^^^ did you mean `self.baz(...)`?
101+
| ^^^ help: try: `self.baz`
102102

103103
error[E0425]: cannot find value `bah` in this scope
104104
--> $DIR/issue-14254.rs:100:9
105105
|
106106
100 | bah;
107-
| ^^^ did you mean `Self::bah`?
107+
| ^^^ help: try: `Self::bah`
108108

109109
error[E0425]: cannot find function `baz` in this scope
110110
--> $DIR/issue-14254.rs:108:9
111111
|
112112
108 | baz();
113-
| ^^^ did you mean `self.baz(...)`?
113+
| ^^^ help: try: `self.baz`
114114

115115
error[E0425]: cannot find value `bah` in this scope
116116
--> $DIR/issue-14254.rs:111:9
117117
|
118118
111 | bah;
119-
| ^^^ did you mean `Self::bah`?
119+
| ^^^ help: try: `Self::bah`
120120

121121
error[E0425]: cannot find function `baz` in this scope
122122
--> $DIR/issue-14254.rs:119:9
123123
|
124124
119 | baz();
125-
| ^^^ did you mean `self.baz(...)`?
125+
| ^^^ help: try: `self.baz`
126126

127127
error[E0425]: cannot find value `bah` in this scope
128128
--> $DIR/issue-14254.rs:122:9
129129
|
130130
122 | bah;
131-
| ^^^ did you mean `Self::bah`?
131+
| ^^^ help: try: `Self::bah`
132132

133133
error[E0425]: cannot find function `baz` in this scope
134134
--> $DIR/issue-14254.rs:130:9
135135
|
136136
130 | baz();
137-
| ^^^ did you mean `self.baz(...)`?
137+
| ^^^ help: try: `self.baz`
138138

139139
error[E0425]: cannot find value `bah` in this scope
140140
--> $DIR/issue-14254.rs:133:9
141141
|
142142
133 | bah;
143-
| ^^^ did you mean `Self::bah`?
143+
| ^^^ help: try: `Self::bah`
144144

145145
error: main function not found
146146

‎src/test/ui/resolve/issue-2356.stderr‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ error[E0425]: cannot find function `clone` in this scope
88
--> $DIR/issue-2356.rs:35:5
99
|
1010
35 | clone();
11-
| ^^^^^ did you mean `self.clone(...)`?
11+
| ^^^^^ help: try: `self.clone`
1212

1313
error[E0425]: cannot find function `default` in this scope
1414
--> $DIR/issue-2356.rs:43:5
1515
|
1616
43 | default();
17-
| ^^^^^^^ did you mean `Self::default`?
17+
| ^^^^^^^ help: try: `Self::default`
1818

1919
error[E0425]: cannot find value `whiskers` in this scope
2020
--> $DIR/issue-2356.rs:52:5
2121
|
2222
52 | whiskers -= other;
2323
| ^^^^^^^^
2424
| |
25-
| did you mean `self.whiskers`?
25+
| help: try: `self.whiskers`
2626
| `self` value is only available in methods with `self` parameter
2727

2828
error[E0425]: cannot find function `shave` in this scope
2929
--> $DIR/issue-2356.rs:57:5
3030
|
3131
57 | shave(4);
32-
| ^^^^^ did you mean `Self::shave`?
32+
| ^^^^^ help: try: `Self::shave`
3333

3434
error[E0425]: cannot find function `purr` in this scope
3535
--> $DIR/issue-2356.rs:60:5
@@ -83,15 +83,15 @@ error[E0425]: cannot find value `whiskers` in this scope
8383
--> $DIR/issue-2356.rs:104:5
8484
|
8585
104 | whiskers = 0;
86-
| ^^^^^^^^ did you mean `self.whiskers`?
86+
| ^^^^^^^^ help: try: `self.whiskers`
8787

8888
error[E0425]: cannot find value `whiskers` in this scope
8989
--> $DIR/issue-2356.rs:110:5
9090
|
9191
110 | whiskers = 4;
9292
| ^^^^^^^^
9393
| |
94-
| did you mean `self.whiskers`?
94+
| help: try: `self.whiskers`
9595
| `self` value is only available in methods with `self` parameter
9696

9797
error[E0425]: cannot find function `purr_louder` in this scope

‎src/test/ui/resolve/resolve-assoc-suggestions.stderr‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ error[E0425]: cannot find value `field` in this scope
1414
--> $DIR/resolve-assoc-suggestions.rs:32:9
1515
|
1616
32 | field;
17-
| ^^^^^ did you mean `self.field`?
17+
| ^^^^^ help: try: `self.field`
1818

1919
error[E0412]: cannot find type `Type` in this scope
2020
--> $DIR/resolve-assoc-suggestions.rs:36:16
2121
|
2222
36 | let _: Type;
23-
| ^^^^ did you mean `Self::Type`?
23+
| ^^^^ help: try: `Self::Type`
2424

2525
error[E0531]: cannot find tuple struct/variant `Type` in this scope
2626
--> $DIR/resolve-assoc-suggestions.rs:39:13
@@ -50,7 +50,7 @@ error[E0425]: cannot find value `method` in this scope
5050
--> $DIR/resolve-assoc-suggestions.rs:52:9
5151
|
5252
52 | method;
53-
| ^^^^^^ did you mean `self.method(...)`?
53+
| ^^^^^^ help: try: `self.method`
5454

5555
error: aborting due to 9 previous errors
5656

‎src/test/ui/resolve/resolve-speculative-adjustment.stderr‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ error[E0425]: cannot find value `field` in this scope
1414
--> $DIR/resolve-speculative-adjustment.rs:35:9
1515
|
1616
35 | field;
17-
| ^^^^^ did you mean `self.field`?
17+
| ^^^^^ help: try: `self.field`
1818

1919
error[E0425]: cannot find function `method` in this scope
2020
--> $DIR/resolve-speculative-adjustment.rs:38:9
2121
|
2222
38 | method();
23-
| ^^^^^^ did you mean `self.method(...)`?
23+
| ^^^^^^ help: try: `self.method`
2424

2525
error: aborting due to 4 previous errors
2626

‎src/test/ui/resolve/unresolved_static_type_field.stderr‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0425]: cannot find value `cx` in this scope
44
19 | f(cx);
55
| ^^
66
| |
7-
| did you mean `self.cx`?
7+
| help: try: `self.cx`
88
| `self` value is only available in methods with `self` parameter
99

1010
error: aborting due to previous error

‎src/test/ui/span/issue-39018.stderr‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0369]: binary operation `+` cannot be applied to type `&'static str`
44
12 | let x = "Hello " + "World!";
55
| ^^^^^^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
66
|
7-
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left.
7+
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
88
| let x = "Hello ".to_owned() + "World!";
99

1010
error[E0369]: binary operation `+` cannot be applied to type `World`

‎src/test/ui/span/suggestion-non-ascii.stderr‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: cannot index a value of type `({integer},)`
22
--> $DIR/suggestion-non-ascii.rs:14:21
33
|
44
14 | println!("☃{}", tup[0]);
5-
| ^^^^^^ help: to access tuple elements, use `tup.0`
5+
| ^^^^^^ help: to access tuple elements, use: `tup.0`
66

77
error: aborting due to previous error
88

‎src/test/ui/suggestions/tuple-float-index.stderr‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ error: unexpected token: `1.1`
55
| ------------^^^
66
| | |
77
| | unexpected token
8-
| help: try parenthesizing the first index `((1, (2, 3)).1).1`
8+
| help: try parenthesizing the first index: `((1, (2, 3)).1).1`
99

1010
error: aborting due to previous error
1111

0 commit comments

Comments
 (0)
Please sign in to comment.