Skip to content

Commit 094f14c

Browse files
committed
Add article after "to"
Also added missing backtick in "you can cast" message.
1 parent 549f861 commit 094f14c

21 files changed

+304
-302
lines changed

compiler/rustc_typeck/src/check/demand.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -753,16 +753,18 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
753753
}
754754

755755
let msg = format!(
756-
"you can convert {} `{}` to `{}`",
756+
"you can convert {} `{}` to {} `{}`",
757757
checked_ty.kind().article(),
758758
checked_ty,
759-
expected_ty
759+
expected_ty.kind().article(),
760+
expected_ty,
760761
);
761762
let cast_msg = format!(
762-
"you can cast {} `{} to `{}`",
763+
"you can cast {} `{}` to {} `{}`",
763764
checked_ty.kind().article(),
764765
checked_ty,
765-
expected_ty
766+
expected_ty.kind().article(),
767+
expected_ty,
766768
);
767769
let lit_msg = format!(
768770
"change the type of the numeric literal from `{}` to `{}`",

src/test/ui/associated-types/associated-types-path-2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ LL | let _: i32 = f2(2i32);
4747
| |
4848
| expected due to this
4949
|
50-
help: you can convert a `u32` to `i32` and panic if the converted value wouldn't fit
50+
help: you can convert a `u32` to an `i32` and panic if the converted value wouldn't fit
5151
|
5252
LL | let _: i32 = f2(2i32).try_into().unwrap();
5353
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/test/ui/indexing-requires-a-uint.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
1313
LL | bar::<isize>(i); // i should not be re-coerced back to an isize
1414
| ^ expected `isize`, found `usize`
1515
|
16-
help: you can convert a `usize` to `isize` and panic if the converted value wouldn't fit
16+
help: you can convert a `usize` to an `isize` and panic if the converted value wouldn't fit
1717
|
1818
LL | bar::<isize>(i.try_into().unwrap()); // i should not be re-coerced back to an isize
1919
| ^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)