Collapse Analysis|Borrowck|PostBorrowckAnalysis when there are no opaques
This commit is contained in:
parent
9c4ff566ba
commit
582c2df9dd
1 changed files with 11 additions and 3 deletions
|
|
@ -117,12 +117,20 @@ impl<I: Interner> TypingMode<I> {
|
|||
}
|
||||
|
||||
pub fn borrowck(cx: I, body_def_id: I::LocalDefId) -> TypingMode<I> {
|
||||
TypingMode::Borrowck { defining_opaque_types: cx.opaque_types_defined_by(body_def_id) }
|
||||
let defining_opaque_types = cx.opaque_types_defined_by(body_def_id);
|
||||
if defining_opaque_types.is_empty() {
|
||||
TypingMode::non_body_analysis()
|
||||
} else {
|
||||
TypingMode::Borrowck { defining_opaque_types }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn post_borrowck_analysis(cx: I, body_def_id: I::LocalDefId) -> TypingMode<I> {
|
||||
TypingMode::PostBorrowckAnalysis {
|
||||
defined_opaque_types: cx.opaque_types_defined_by(body_def_id),
|
||||
let defined_opaque_types = cx.opaque_types_defined_by(body_def_id);
|
||||
if defined_opaque_types.is_empty() {
|
||||
TypingMode::non_body_analysis()
|
||||
} else {
|
||||
TypingMode::PostBorrowckAnalysis { defined_opaque_types }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue