trim type numeric literal suffix
This commit is contained in:
parent
17a28f7063
commit
d31a2a0c60
1 changed files with 1 additions and 6 deletions
|
@ -422,12 +422,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||
let suffix_suggestion = format!(
|
||||
"{}{}{}{}",
|
||||
if needs_paren { "(" } else { "" },
|
||||
{
|
||||
// 42u8
|
||||
// ^^
|
||||
let lit_offset = src.len() - checked_ty.to_string().len();
|
||||
&src[..lit_offset]
|
||||
},
|
||||
src.trim_right_matches(&checked_ty.to_string()),
|
||||
expected_ty,
|
||||
if needs_paren { ")" } else { "" },
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue