summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-08-03 21:14:42 +0800
committerJohn Hodge <tpg@mutabah.net>2016-08-03 21:14:42 +0800
commit606c701bca379038568921aec6f216fa69b7a580 (patch)
tree43c7ac2d3df68db6b972fb09b01551aa2b3d2a74 /src
parent855fe7a06efdfb067850a375aec76a194643e621 (diff)
downloadmrust-606c701bca379038568921aec6f216fa69b7a580.tar.gz
Expand Derive - Working extra bounds
Diffstat (limited to 'src')
-rw-r--r--src/expand/derive.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/expand/derive.cpp b/src/expand/derive.cpp
index 3ee0772b..3e2bdabd 100644
--- a/src/expand/derive.cpp
+++ b/src/expand/derive.cpp
@@ -162,13 +162,16 @@ struct Deriver
(Local,
),
(Relative,
- // Check if the first node of a relative is a generic param.
- for(const auto& typ : params.ty_params())
+ if( pe.nodes.size() > 1 )
{
- if( pe.nodes.front().name() == typ.name() )
+ // Check if the first node of a relative is a generic param.
+ for(const auto& typ : params.ty_params())
{
- add_field_bound(out_list, ty);
- break ;
+ if( pe.nodes.front().name() == typ.name() )
+ {
+ add_field_bound(out_list, ty);
+ break ;
+ }
}
}
H::visit_nodes(*this, params, out_list, pe.nodes);