Skip to content

Commit 425d68f

Browse files
committed
layout_of uses PostAnalysis
1 parent 70ec05e commit 425d68f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

crates/hir-ty/src/layout.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ pub fn layout_of_ty_ns_query<'db>(
182182
};
183183
let dl = &*target;
184184
let cx = LayoutCx::new(dl);
185-
let infer_ctxt = interner.infer_ctxt().build(TypingMode::non_body_analysis());
185+
let infer_ctxt = interner.infer_ctxt().build(TypingMode::PostAnalysis);
186186
let cause = ObligationCause::dummy();
187187
let ty = deeply_normalize(infer_ctxt.at(&cause, ParamEnv::empty()), ty).unwrap_or(ty);
188188
let result = match ty.kind() {
@@ -368,7 +368,11 @@ pub fn layout_of_ty_ns_query<'db>(
368368
}
369369

370370
TyKind::Error(_) => return Err(LayoutError::HasErrorType),
371-
TyKind::Placeholder(_) | TyKind::Bound(..) | TyKind::Infer(..) | TyKind::Param(..) | TyKind::Alias(..) => {
371+
TyKind::Placeholder(_)
372+
| TyKind::Bound(..)
373+
| TyKind::Infer(..)
374+
| TyKind::Param(..)
375+
| TyKind::Alias(..) => {
372376
return Err(LayoutError::HasPlaceholder);
373377
}
374378
};

0 commit comments

Comments
 (0)