]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_codegen_llvm/type_.rs
Rollup merge of #74136 - JohnTitor:index-page-link, r=GuillaumeGomez
[rust.git] / src / librustc_codegen_llvm / type_.rs
index c06d2e6a01ac2d9cc714f4e3c46ac97503090000..854eff31733805e349062e7876efd4889b756cc9 100644 (file)
 use rustc_codegen_ssa::traits::*;
 use rustc_data_structures::small_c_str::SmallCStr;
 use rustc_middle::bug;
-use rustc_middle::ty::layout::{self, Align, Size, TyAndLayout};
+use rustc_middle::ty::layout::TyAndLayout;
 use rustc_middle::ty::Ty;
 use rustc_target::abi::call::{CastTarget, FnAbi, Reg};
+use rustc_target::abi::{Align, Integer, Size};
 
 use std::fmt;
 use std::ptr;
@@ -114,14 +115,14 @@ impl CodegenCx<'ll, 'tcx> {
 
     crate fn type_pointee_for_align(&self, align: Align) -> &'ll Type {
         // FIXME(eddyb) We could find a better approximation if ity.align < align.
-        let ity = layout::Integer::approximate_align(self, align);
+        let ity = Integer::approximate_align(self, align);
         self.type_from_integer(ity)
     }
 
     /// Return a LLVM type that has at most the required alignment,
     /// and exactly the required size, as a best-effort padding array.
     crate fn type_padding_filler(&self, size: Size, align: Align) -> &'ll Type {
-        let unit = layout::Integer::approximate_align(self, align);
+        let unit = Integer::approximate_align(self, align);
         let size = size.bytes();
         let unit_size = unit.size().bytes();
         assert_eq!(size % unit_size, 0);