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