mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
check binders with bound vars for global bounds that don't hold
(instead of just late bound vars)
This commit is contained in:
parent
e1fcecb1b9
commit
2beca157c9
@ -32,6 +32,7 @@ use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _
|
|||||||
use rustc_trait_selection::traits::{
|
use rustc_trait_selection::traits::{
|
||||||
self, ObligationCause, ObligationCauseCode, ObligationCtxt, WellFormedLoc,
|
self, ObligationCause, ObligationCauseCode, ObligationCtxt, WellFormedLoc,
|
||||||
};
|
};
|
||||||
|
use rustc_type_ir::TypeFlags;
|
||||||
|
|
||||||
use std::cell::LazyCell;
|
use std::cell::LazyCell;
|
||||||
use std::ops::{ControlFlow, Deref};
|
use std::ops::{ControlFlow, Deref};
|
||||||
@ -1877,7 +1878,7 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Match the existing behavior.
|
// Match the existing behavior.
|
||||||
if pred.is_global() && !pred.has_late_bound_vars() {
|
if pred.is_global() && !pred.has_type_flags(TypeFlags::HAS_BINDER_VARS) {
|
||||||
let pred = self.normalize(span, None, pred);
|
let pred = self.normalize(span, None, pred);
|
||||||
let hir_node = tcx.hir().find_by_def_id(self.body_def_id);
|
let hir_node = tcx.hir().find_by_def_id(self.body_def_id);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user