Do not consider a T: !Sized candidate to satisfy a T: !MetaSized obligation.
This commit is contained in:
@@ -9,8 +9,8 @@ pub use rustc_infer::traits::util::*;
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::ty::fast_reject::DeepRejectCtxt;
|
||||
use rustc_middle::ty::{
|
||||
self, PolyTraitPredicate, SizedTraitKind, TraitPredicate, TraitRef, Ty, TyCtxt, TypeFoldable,
|
||||
TypeFolder, TypeSuperFoldable, TypeVisitableExt,
|
||||
self, PolyTraitPredicate, PredicatePolarity, SizedTraitKind, TraitPredicate, TraitRef, Ty,
|
||||
TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitableExt,
|
||||
};
|
||||
pub use rustc_next_trait_solver::placeholder::BoundVarReplacer;
|
||||
use rustc_span::Span;
|
||||
@@ -427,7 +427,9 @@ pub(crate) fn lazily_elaborate_sizedness_candidate<'tcx>(
|
||||
return candidate;
|
||||
}
|
||||
|
||||
if obligation.predicate.polarity() != candidate.polarity() {
|
||||
if obligation.predicate.polarity() != PredicatePolarity::Positive
|
||||
|| candidate.polarity() != PredicatePolarity::Positive
|
||||
{
|
||||
return candidate;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user