mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-13 09:11:51 +00:00
layout_of uses PostAnalysis
This commit is contained in:
parent
70ec05eed7
commit
425d68fc02
1 changed files with 6 additions and 2 deletions
|
|
@ -182,7 +182,7 @@ pub fn layout_of_ty_ns_query<'db>(
|
||||||
};
|
};
|
||||||
let dl = &*target;
|
let dl = &*target;
|
||||||
let cx = LayoutCx::new(dl);
|
let cx = LayoutCx::new(dl);
|
||||||
let infer_ctxt = interner.infer_ctxt().build(TypingMode::non_body_analysis());
|
let infer_ctxt = interner.infer_ctxt().build(TypingMode::PostAnalysis);
|
||||||
let cause = ObligationCause::dummy();
|
let cause = ObligationCause::dummy();
|
||||||
let ty = deeply_normalize(infer_ctxt.at(&cause, ParamEnv::empty()), ty).unwrap_or(ty);
|
let ty = deeply_normalize(infer_ctxt.at(&cause, ParamEnv::empty()), ty).unwrap_or(ty);
|
||||||
let result = match ty.kind() {
|
let result = match ty.kind() {
|
||||||
|
|
@ -368,7 +368,11 @@ pub fn layout_of_ty_ns_query<'db>(
|
||||||
}
|
}
|
||||||
|
|
||||||
TyKind::Error(_) => return Err(LayoutError::HasErrorType),
|
TyKind::Error(_) => return Err(LayoutError::HasErrorType),
|
||||||
TyKind::Placeholder(_) | TyKind::Bound(..) | TyKind::Infer(..) | TyKind::Param(..) | TyKind::Alias(..) => {
|
TyKind::Placeholder(_)
|
||||||
|
| TyKind::Bound(..)
|
||||||
|
| TyKind::Infer(..)
|
||||||
|
| TyKind::Param(..)
|
||||||
|
| TyKind::Alias(..) => {
|
||||||
return Err(LayoutError::HasPlaceholder);
|
return Err(LayoutError::HasPlaceholder);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue