Auto merge of #122972 - beetrees:use-align-type, r=fee1-dead

Use the `Align` type when parsing alignment attributes

Use the `Align` type in `rustc_attr::parse_alignment`, removing the need to call `Align::from_bytes(...).unwrap()` later in the compilation process.
This commit is contained in:
bors
2024-04-01 03:16:45 +00:00
12 changed files with 74 additions and 26 deletions

View File

@@ -1,6 +1,7 @@
use crate::mir::mono::Linkage;
use rustc_attr::{InlineAttr, InstructionSetAttr, OptimizeAttr};
use rustc_span::symbol::Symbol;
use rustc_target::abi::Align;
use rustc_target::spec::SanitizerSet;
#[derive(Clone, TyEncodable, TyDecodable, HashStable, Debug)]
@@ -42,7 +43,7 @@ pub struct CodegenFnAttrs {
pub instruction_set: Option<InstructionSetAttr>,
/// The `#[repr(align(...))]` attribute. Indicates the value of which the function should be
/// aligned to.
pub alignment: Option<u32>,
pub alignment: Option<Align>,
}
#[derive(Clone, Copy, PartialEq, Eq, TyEncodable, TyDecodable, HashStable)]