From cd2f5f7d977936c409f4bec28075c8918e239f4c Mon Sep 17 00:00:00 2001 From: varkor Date: Tue, 1 May 2018 21:26:23 +0100 Subject: Reduce the maximum alignment to repr(align(1 << 29)) This brings it into line with LLVM's maximum permitted alignment. --- src/libsyntax/attr.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index f0557277267..13f8bb9a318 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -1012,11 +1012,11 @@ pub fn find_repr_attrs(diagnostic: &Handler, attr: &Attribute) -> Vec let parse_alignment = |node: &ast::LitKind| -> Result { 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") -- cgit 1.4.1-3-g733a5