Skip to content

Commit 8bf387d

Browse files
Expect deep norm to fail if query norm failed
1 parent df1da67 commit 8bf387d

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

compiler/rustc_borrowck/src/type_check/liveness/trace.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -621,13 +621,7 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
621621
&ocx, op, span,
622622
) {
623623
Ok(_) => ocx.select_all_or_error(),
624-
Err(e) => {
625-
if e.is_empty() {
626-
ocx.select_all_or_error()
627-
} else {
628-
e
629-
}
630-
}
624+
Err(e) => e,
631625
};
632626

633627
// Could have no errors if a type lowering error, say, caused the query

compiler/rustc_trait_selection/src/traits/query/dropck_outlives.rs

+13-5
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,19 @@ where
204204
return Err(errors);
205205
}
206206

207-
ocx.deeply_normalize(&cause, param_env, ty)?;
208-
209-
let errors = ocx.select_where_possible();
210-
debug!("normalize errors: {ty} ~> {errors:#?}");
211-
return Err(errors);
207+
match ocx.deeply_normalize(&cause, param_env, ty) {
208+
Ok(_) => {
209+
tcx.dcx().span_delayed_bug(
210+
span,
211+
format!(
212+
"query normalize succeeded of {ty}, \
213+
but deep normalize failed",
214+
),
215+
);
216+
ty
217+
}
218+
Err(errors) => return Err(errors),
219+
}
212220
};
213221

214222
match ty.kind() {

0 commit comments

Comments
 (0)