@@ -117,14 +117,12 @@ pub enum TraitQueryMode {
117
117
}
118
118
119
119
/// Creates predicate obligations from the generic bounds.
120
+ #[ instrument( level = "debug" , skip( cause, param_env) ) ]
120
121
pub fn predicates_for_generics < ' tcx > (
121
122
cause : impl Fn ( usize , Span ) -> ObligationCause < ' tcx > ,
122
123
param_env : ty:: ParamEnv < ' tcx > ,
123
124
generic_bounds : ty:: InstantiatedPredicates < ' tcx > ,
124
125
) -> impl Iterator < Item = PredicateObligation < ' tcx > > {
125
- let generic_bounds = generic_bounds;
126
- debug ! ( "predicates_for_generics(generic_bounds={:?})" , generic_bounds) ;
127
-
128
126
std:: iter:: zip ( generic_bounds. predicates , generic_bounds. spans ) . enumerate ( ) . map (
129
127
move |( idx, ( predicate, span) ) | Obligation {
130
128
cause : cause ( idx, span) ,
@@ -140,19 +138,14 @@ pub fn predicates_for_generics<'tcx>(
140
138
/// `bound` or is not known to meet bound (note that this is
141
139
/// conservative towards *no impl*, which is the opposite of the
142
140
/// `evaluate` methods).
141
+ #[ instrument( level = "debug" , skip( infcx, param_env, span) , ret) ]
143
142
pub fn type_known_to_meet_bound_modulo_regions < ' tcx > (
144
143
infcx : & InferCtxt < ' tcx > ,
145
144
param_env : ty:: ParamEnv < ' tcx > ,
146
145
ty : Ty < ' tcx > ,
147
146
def_id : DefId ,
148
147
span : Span ,
149
148
) -> 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
-
156
149
let trait_ref =
157
150
ty:: Binder :: dummy ( ty:: TraitRef { def_id, substs : infcx. tcx . mk_substs_trait ( ty, & [ ] ) } ) ;
158
151
let obligation = Obligation {
@@ -163,12 +156,7 @@ pub fn type_known_to_meet_bound_modulo_regions<'tcx>(
163
156
} ;
164
157
165
158
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) ;
172
160
173
161
if result && ty. has_non_region_infer ( ) {
174
162
// Because of inference "guessing", selection can sometimes claim
@@ -190,21 +178,9 @@ pub fn type_known_to_meet_bound_modulo_regions<'tcx>(
190
178
// *definitively* show that it implements `Copy`. Otherwise,
191
179
// assume it is move; linear is always ok.
192
180
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 ,
201
182
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) ;
208
184
false
209
185
}
210
186
}
0 commit comments