File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -2322,7 +2322,7 @@ pub fn type_contents(cx: ctxt, ty: t) -> TypeContents {
2322
2322
let _i = indenter ( ) ;
2323
2323
2324
2324
let mut tc = TC_ALL ;
2325
- for bound in type_param_def. bounds . builtin_bounds . iter ( ) {
2325
+ do each_inherited_builtin_bound ( cx , type_param_def. bounds ) |bound| {
2326
2326
debug ! ( "tc = %s, bound = %?" , tc. to_str( ) , bound) ;
2327
2327
tc = tc - match bound {
2328
2328
BoundStatic => TypeContents :: nonstatic ( cx) ,
@@ -2335,6 +2335,23 @@ pub fn type_contents(cx: ctxt, ty: t) -> TypeContents {
2335
2335
2336
2336
debug ! ( "result = %s" , tc. to_str( ) ) ;
2337
2337
return tc;
2338
+
2339
+ // Iterates over all builtin bounds on the type parameter def, including
2340
+ // those inherited from traits with builtin-kind-supertraits.
2341
+ fn each_inherited_builtin_bound ( cx : ctxt , bounds : & ParamBounds ,
2342
+ f : & fn ( BuiltinBound ) ) {
2343
+ for bound in bounds. builtin_bounds . iter ( ) {
2344
+ f ( bound) ;
2345
+ }
2346
+
2347
+ do each_bound_trait_and_supertraits ( cx, bounds. trait_bounds ) |trait_ref| {
2348
+ let trait_def = lookup_trait_def ( cx, trait_ref. def_id ) ;
2349
+ for bound in trait_def. bounds . iter ( ) {
2350
+ f ( bound) ;
2351
+ }
2352
+ true
2353
+ } ;
2354
+ }
2338
2355
}
2339
2356
}
2340
2357
You can’t perform that action at this time.
0 commit comments