diff options
| author | Michael Goulet <michael@errs.io> | 2022-11-15 22:26:28 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-11-18 18:23:48 +0000 |
| commit | b3da04aa52d6e36d7db8666db9aeeaec316f1cc9 (patch) | |
| tree | 1df8059392d817dba2b0b9526d96f93dcaf7da64 /compiler/rustc_trait_selection/src | |
| parent | da3c5397a614f790f0daaf61bfdc692b36719e01 (diff) | |
| download | rust-b3da04aa52d6e36d7db8666db9aeeaec316f1cc9.tar.gz rust-b3da04aa52d6e36d7db8666db9aeeaec316f1cc9.zip | |
Check both align and size in PointerSized
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs index c77f035d6b9..4c6bb39d17b 100644 --- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs +++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs @@ -1069,7 +1069,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { let usize_layout = self.tcx().layout_of(ty::ParamEnv::empty().and(self.tcx().types.usize)).unwrap().layout; if let Ok(layout) = self.tcx().layout_of(obligation.param_env.and(self_ty)) - && layout.layout.size().bytes() == usize_layout.size().bytes() + && layout.layout.size() == usize_layout.size() + && layout.layout.align() == usize_layout.align() { candidates.vec.push(BuiltinCandidate { has_nested: false }); } |
