Skip to content

Commit

Permalink
replace old literal in expr
Browse files Browse the repository at this point in the history
  • Loading branch information
csmoe committed Sep 16, 2018
1 parent 1984079 commit 0ff0669
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/librustc_typeck/check/demand.rs
Expand Up @@ -422,7 +422,12 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
let suffix_suggestion = format!(
"{}{}{}{}",
if needs_paren { "(" } else { "" },
src,
{
// 42u8
// ^^
let lit_offset = src.len() - checked_ty.to_string().len();
&src[..lit_offset]
},
expected_ty,
if needs_paren { ")" } else { "" },
);
Expand Down

0 comments on commit 0ff0669

Please sign in to comment.