@@ -117,14 +117,12 @@ pub enum TraitQueryMode {
117117}
118118
119119/// Creates predicate obligations from the generic bounds.
120+ #[ instrument( level = "debug" , skip( cause, param_env) ) ]
120121pub fn predicates_for_generics < ' tcx > (
121122 cause : impl Fn ( usize , Span ) -> ObligationCause < ' tcx > ,
122123 param_env : ty:: ParamEnv < ' tcx > ,
123124 generic_bounds : ty:: InstantiatedPredicates < ' tcx > ,
124125) -> impl Iterator < Item = PredicateObligation < ' tcx > > {
125- let generic_bounds = generic_bounds;
126- debug ! ( "predicates_for_generics(generic_bounds={:?})" , generic_bounds) ;
127-
128126 std:: iter:: zip ( generic_bounds. predicates , generic_bounds. spans ) . enumerate ( ) . map (
129127 move |( idx, ( predicate, span) ) | Obligation {
130128 cause : cause ( idx, span) ,
@@ -140,19 +138,14 @@ pub fn predicates_for_generics<'tcx>(
140138/// `bound` or is not known to meet bound (note that this is
141139/// conservative towards *no impl*, which is the opposite of the
142140/// `evaluate` methods).
141+ #[ instrument( level = "debug" , skip( infcx, param_env, span) , ret) ]
143142pub fn type_known_to_meet_bound_modulo_regions < ' tcx > (
144143 infcx : & InferCtxt < ' tcx > ,
145144 param_env : ty:: ParamEnv < ' tcx > ,
146145 ty : Ty < ' tcx > ,
147146 def_id : DefId ,
148147 span : Span ,
149148) -> bool {
150- debug ! (
151- "type_known_to_meet_bound_modulo_regions(ty={:?}, bound={:?})" ,
152- ty,
153- infcx. tcx. def_path_str( def_id)
154- ) ;
155-
156149 let trait_ref =
157150 ty:: Binder :: dummy ( ty:: TraitRef { def_id, substs : infcx. tcx . mk_substs_trait ( ty, & [ ] ) } ) ;
158151 let obligation = Obligation {
@@ -163,12 +156,7 @@ pub fn type_known_to_meet_bound_modulo_regions<'tcx>(
163156 } ;
164157
165158 let result = infcx. predicate_must_hold_modulo_regions ( & obligation) ;
166- debug ! (
167- "type_known_to_meet_ty={:?} bound={} => {:?}" ,
168- ty,
169- infcx. tcx. def_path_str( def_id) ,
170- result
171- ) ;
159+ debug ! ( ?result) ;
172160
173161 if result && ty. has_non_region_infer ( ) {
174162 // Because of inference "guessing", selection can sometimes claim
@@ -190,21 +178,9 @@ pub fn type_known_to_meet_bound_modulo_regions<'tcx>(
190178 // *definitively* show that it implements `Copy`. Otherwise,
191179 // assume it is move; linear is always ok.
192180 match & errors[ ..] {
193- [ ] => {
194- debug ! (
195- "type_known_to_meet_bound_modulo_regions: ty={:?} bound={} success" ,
196- ty,
197- infcx. tcx. def_path_str( def_id)
198- ) ;
199- true
200- }
181+ [ ] => true ,
201182 errors => {
202- debug ! (
203- ?ty,
204- bound = %infcx. tcx. def_path_str( def_id) ,
205- ?errors,
206- "type_known_to_meet_bound_modulo_regions"
207- ) ;
183+ debug ! ( ?errors) ;
208184 false
209185 }
210186 }
0 commit comments