reword `;` suggestions to have consistent wording

This commit is contained in:
Esteban Küber 2021-02-04 13:59:23 -08:00
parent 796ce9fcb7
commit 020edd91a9
10 changed files with 10 additions and 10 deletions

View File

@ -346,7 +346,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
if call_is_multiline {
err.span_suggestion(
callee.span.shrink_to_hi(),
"try adding a semicolon",
"consider using a semicolon here",
";".to_owned(),
Applicability::MaybeIncorrect,
);

View File

@ -395,7 +395,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
| ExprKind::Block(..) => {
err.span_suggestion(
cause_span.shrink_to_hi(),
"try adding a semicolon",
"consider using a semicolon here",
";".to_string(),
Applicability::MachineApplicable,
);

View File

@ -21,7 +21,7 @@ async fn dummy() {}
async fn suggest_await_in_async_fn_return() {
dummy()
//~^ ERROR mismatched types [E0308]
//~| HELP try adding a semicolon
//~| HELP consider using a semicolon here
//~| HELP consider `await`ing on the `Future`
//~| SUGGESTION .await
}

View File

@ -29,7 +29,7 @@ help: consider `await`ing on the `Future`
|
LL | dummy().await
| ^^^^^^
help: try adding a semicolon
help: consider using a semicolon here
|
LL | dummy();
| ^

View File

@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | foo()
| ^^^^^ expected `()`, found `usize`
|
help: try adding a semicolon
help: consider using a semicolon here
|
LL | foo();
| ^

View File

@ -5,7 +5,7 @@ LL | fn main() {
| - expected `()` because of default return type
LL | // Test that constructing the `visible_parent_map` (in `cstore_impl.rs`) does not ICE.
LL | std::cell::Cell::new(0)
| ^^^^^^^^^^^^^^^^^^^^^^^- help: try adding a semicolon: `;`
| ^^^^^^^^^^^^^^^^^^^^^^^- help: consider using a semicolon here: `;`
| |
| expected `()`, found struct `Cell`
|

View File

@ -6,7 +6,7 @@ LL | foo(4 as usize)
|
= note: expected unit type `()`
found struct `S<usize>`
help: try adding a semicolon
help: consider using a semicolon here
|
LL | foo(4 as usize);
| ^

View File

@ -9,7 +9,7 @@ LL | | }
|
= note: expected unit type `()`
found enum `std::result::Result<_, {integer}>`
help: try adding a semicolon
help: consider using a semicolon here
|
LL | Err(42);
| ^

View File

@ -29,7 +29,7 @@ LL | fn monomorphic() -> () {
| -- expected `()` because of return type
...
LL | generic::<()>()
| ^^^^^^^^^^^^^^^- help: try adding a semicolon: `;`
| ^^^^^^^^^^^^^^^- help: consider using a semicolon here: `;`
| |
| expected `()`, found associated type
|

View File

@ -5,7 +5,7 @@ LL | fn vindictive() -> bool { true }
| ----------------------- `vindictive` defined here returns `bool`
...
LL | vindictive()
| -^^^^^^^^^^^- help: try adding a semicolon: `;`
| -^^^^^^^^^^^- help: consider using a semicolon here: `;`
| _____|
| |
LL | | (1, 2)