about summary refs log tree commit diff
path: root/src/libsyntax/attr.rs
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2018-05-01 21:26:23 +0100
committervarkor <github@varkor.com>2018-05-01 22:02:05 +0100
commitcd2f5f7d977936c409f4bec28075c8918e239f4c (patch)
treef6b1812708b34cf85208f86e2165e9bbf299f115 /src/libsyntax/attr.rs
parentc1607f80b3d57b66386c1cab4b2b6ae069d4caba (diff)
downloadrust-cd2f5f7d977936c409f4bec28075c8918e239f4c.tar.gz
rust-cd2f5f7d977936c409f4bec28075c8918e239f4c.zip
Reduce the maximum alignment to repr(align(1 << 29))
This brings it into line with LLVM's maximum permitted alignment.
Diffstat (limited to 'src/libsyntax/attr.rs')
-rw-r--r--src/libsyntax/attr.rs6
1 files changed, 3 insertions, 3 deletions
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<ReprAttr>
                     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")