File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
compiler/rustc_trait_selection/src/solve Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,54 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
136136 None
137137 }
138138 }
139+ ty:: PredicateKind :: Clause ( ty:: ClauseKind :: WellFormed ( arg) ) => match arg. kind ( ) {
140+ ty:: TermKind :: Ty ( ty) => match self . shallow_resolve ( ty) . kind ( ) {
141+ ty:: Bool
142+ | ty:: Char
143+ | ty:: Int ( _)
144+ | ty:: Uint ( _)
145+ | ty:: Float ( _)
146+ | ty:: Str
147+ | ty:: Never
148+ | ty:: Param ( _)
149+ | ty:: Placeholder ( _) => Some ( Certainty :: Yes ) ,
150+
151+ ty:: Infer ( infer) => match infer {
152+ ty:: TyVar ( _) => Some ( Certainty :: AMBIGUOUS ) ,
153+ ty:: IntVar ( _) | ty:: FloatVar ( _) => Some ( Certainty :: Yes ) ,
154+ ty:: FreshTy ( _) | ty:: FreshIntTy ( _) | ty:: FreshFloatTy ( _) => unreachable ! ( ) ,
155+ } ,
156+
157+ ty:: Adt ( _, _)
158+ | ty:: Foreign ( _)
159+ | ty:: Array ( _, _)
160+ | ty:: Pat ( _, _)
161+ | ty:: Slice ( _)
162+ | ty:: RawPtr ( ..)
163+ | ty:: Ref ( ..)
164+ | ty:: FnDef ( ..)
165+ | ty:: FnPtr ( ..)
166+ | ty:: UnsafeBinder ( ..)
167+ | ty:: Dynamic ( ..)
168+ | ty:: Closure ( ..)
169+ | ty:: CoroutineClosure ( ..)
170+ | ty:: Coroutine ( ..)
171+ | ty:: CoroutineWitness ( ..)
172+ | ty:: Tuple ( _)
173+ | ty:: Alias ( ..)
174+ | ty:: Bound ( ..)
175+ | ty:: Error ( _) => None ,
176+ } ,
177+ ty:: TermKind :: Const ( ct) => match self . shallow_resolve_const ( ct) . kind ( ) {
178+ ty:: ConstKind :: Param ( _) | ty:: ConstKind :: Placeholder ( _) => Some ( Certainty :: Yes ) ,
179+ ty:: ConstKind :: Infer ( _) => Some ( Certainty :: AMBIGUOUS ) ,
180+ ty:: ConstKind :: Bound ( ..)
181+ | ty:: ConstKind :: Unevaluated ( ..)
182+ | ty:: ConstKind :: Value ( _)
183+ | ty:: ConstKind :: Error ( _)
184+ | ty:: ConstKind :: Expr ( _) => None ,
185+ } ,
186+ } ,
139187 _ => None ,
140188 }
141189 }
You can’t perform that action at this time.
0 commit comments