Use correct article in help message for conversion or cast
Before it always used `an`; now it uses the correct article for the type.
This commit is contained in:
parent
1d216fef3e
commit
549f861f7d
14 changed files with 169 additions and 147 deletions
|
@ -752,8 +752,18 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
let msg = format!("you can convert an `{}` to `{}`", checked_ty, expected_ty);
|
||||
let cast_msg = format!("you can cast an `{} to `{}`", checked_ty, expected_ty);
|
||||
let msg = format!(
|
||||
"you can convert {} `{}` to `{}`",
|
||||
checked_ty.kind().article(),
|
||||
checked_ty,
|
||||
expected_ty
|
||||
);
|
||||
let cast_msg = format!(
|
||||
"you can cast {} `{} to `{}`",
|
||||
checked_ty.kind().article(),
|
||||
checked_ty,
|
||||
expected_ty
|
||||
);
|
||||
let lit_msg = format!(
|
||||
"change the type of the numeric literal from `{}` to `{}`",
|
||||
checked_ty, expected_ty,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue