Skip to content

Commit 500d454

Browse files
lqdcuviper
authored andcommitted
check binders with bound vars for global bounds that don't hold
(instead of just late bound vars) (cherry picked from commit 2beca15)
1 parent 0e1fac1 commit 500d454

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _
3232
use rustc_trait_selection::traits::{
3333
self, ObligationCause, ObligationCauseCode, ObligationCtxt, WellFormedLoc,
3434
};
35+
use rustc_type_ir::TypeFlags;
3536

3637
use std::cell::LazyCell;
3738
use std::ops::{ControlFlow, Deref};
@@ -1862,7 +1863,7 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
18621863
continue;
18631864
}
18641865
// Match the existing behavior.
1865-
if pred.is_global() && !pred.has_late_bound_vars() {
1866+
if pred.is_global() && !pred.has_type_flags(TypeFlags::HAS_BINDER_VARS) {
18661867
let pred = self.normalize(span, None, pred);
18671868
let hir_node = tcx.hir().find_by_def_id(self.body_def_id);
18681869

0 commit comments

Comments
 (0)