let parse_alignment = |node: &ast::LitKind| -> Result<u32, &'static str> {
if let ast::LitKind::Int(literal, ast::LitIntType::Unsuffixed) = node {
if literal.is_power_of_two() {
- // rustc::ty::layout::Align restricts align to <= 2147483647
- if *literal <= 2147483647 {
+ // rustc::ty::layout::Align restricts align to <= 2^29
+ if *literal <= 1 << 29 {
Ok(*literal as u32)
} else {
- Err("larger than 2147483647")
+ Err("larger than 2^29")
}
} else {
Err("not a power of two")