Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2beca15

Browse files
committed
check binders with bound vars for global bounds that don't hold
(instead of just late bound vars)
1 parent e1fcecb commit 2beca15

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};
@@ -1877,7 +1878,7 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
18771878
continue;
18781879
}
18791880
// Match the existing behavior.
1880-
if pred.is_global() && !pred.has_late_bound_vars() {
1881+
if pred.is_global() && !pred.has_type_flags(TypeFlags::HAS_BINDER_VARS) {
18811882
let pred = self.normalize(span, None, pred);
18821883
let hir_node = tcx.hir().find_by_def_id(self.body_def_id);
18831884

0 commit comments

Comments
 (0)