Skip to content

Commit d31a2a0

Browse files
committed
trim type numeric literal suffix
1 parent 17a28f7 commit d31a2a0

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/librustc_typeck/check/demand.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -422,12 +422,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
422422
let suffix_suggestion = format!(
423423
"{}{}{}{}",
424424
if needs_paren { "(" } else { "" },
425-
{
426-
// 42u8
427-
// ^^
428-
let lit_offset = src.len() - checked_ty.to_string().len();
429-
&src[..lit_offset]
430-
},
425+
src.trim_right_matches(&checked_ty.to_string()),
431426
expected_ty,
432427
if needs_paren { ")" } else { "" },
433428
);

0 commit comments

Comments
 (0)