@@ -231,8 +231,8 @@ struct CoherenceChecker {
231
231
self . crate_context. tcx. sess. str_of( item. ident) ) ;
232
232
233
233
match item. node {
234
- item_impl( _, associated_traits , _, _) => {
235
- self . check_implementation ( item, associated_traits ) ;
234
+ item_impl( _, opt_trait , _, _) => {
235
+ self . check_implementation ( item, opt_trait . to_vec ( ) ) ;
236
236
}
237
237
item_class( struct_def, _) => {
238
238
self . check_implementation ( item, struct_def. traits ) ;
@@ -432,7 +432,7 @@ struct CoherenceChecker {
432
432
// Then visit the module items.
433
433
visit_mod ( module_, item. span , item. id , ( ) , visitor) ;
434
434
}
435
- item_impl( _, associated_traits , _, _) => {
435
+ item_impl( _, opt_trait , _, _) => {
436
436
match self . base_type_def_ids . find (
437
437
local_def ( item. id ) ) {
438
438
@@ -453,7 +453,8 @@ struct CoherenceChecker {
453
453
// if the traits are defined in the same
454
454
// crate.
455
455
456
- if associated_traits. len ( ) == 0 {
456
+ match opt_trait {
457
+ None => {
457
458
// There is no trait to implement, so
458
459
// this is an error.
459
460
@@ -470,8 +471,10 @@ struct CoherenceChecker {
470
471
or new type \
471
472
instead ") ;
472
473
}
474
+ _ => ( )
475
+ }
473
476
474
- for associated_traits . each |trait_ref| {
477
+ do opt_trait . iter ( ) |trait_ref| {
475
478
// This is OK if and only if the
476
479
// trait was defined in this
477
480
// crate.
0 commit comments