diff options
Diffstat (limited to 'compiler/rustc_builtin_macros/src/concat_bytes.rs')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/concat_bytes.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_builtin_macros/src/concat_bytes.rs b/compiler/rustc_builtin_macros/src/concat_bytes.rs index 4f7c0266343..a01bbeac824 100644 --- a/compiler/rustc_builtin_macros/src/concat_bytes.rs +++ b/compiler/rustc_builtin_macros/src/concat_bytes.rs @@ -54,7 +54,7 @@ fn invalid_type_err( val, ast::LitIntType::Unsuffixed | ast::LitIntType::Unsigned(ast::UintTy::U8), )) => { - assert!(val > u8::MAX.into()); // must be an error + assert!(val.get() > u8::MAX.into()); // must be an error dcx.emit_err(ConcatBytesOob { span }); } Ok(ast::LitKind::Int(_, _)) => { @@ -86,7 +86,7 @@ fn handle_array_element( Ok(ast::LitKind::Int( val, ast::LitIntType::Unsuffixed | ast::LitIntType::Unsigned(ast::UintTy::U8), - )) if val <= u8::MAX.into() => Some(val as u8), + )) if val.get() <= u8::MAX.into() => Some(val.get() as u8), Ok(ast::LitKind::Byte(val)) => Some(val), Ok(ast::LitKind::ByteStr(..)) => { @@ -148,7 +148,7 @@ pub fn expand_concat_bytes( if let Some(elem) = handle_array_element(cx, &mut has_errors, &mut missing_literals, expr) { - for _ in 0..count_val { + for _ in 0..count_val.get() { accumulator.push(elem); } } |
