Skip to content

Commit 0c392d8

Browse files
Add comment describing purpose of field traversal
1 parent e3b308e commit 0c392d8

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_builtin_macros/src/deriving/generic

1 file changed

+4
-0
lines changed

compiler/rustc_builtin_macros/src/deriving/generic/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,10 @@ impl<'a> TraitDef<'a> {
636636
}
637637
}));
638638

639+
// If this type declaration has type parameters, look for any mention of types *derived* from
640+
// those parameters in the declaration (e.g. `T::Item`). Those derived types need bounds as
641+
// well.
642+
639643
let mut ty_params = params
640644
.iter()
641645
.filter(|param| matches!(param.kind, ast::GenericParamKind::Type { .. }))

0 commit comments

Comments
 (0)