Skip to content

Commit e90c1f6

Browse files
committed
Add Clone bounds for derive
1 parent 45c50ff commit e90c1f6

File tree

1 file changed

+2
-3
lines changed
  • compiler/rustc_builtin_macros/src/deriving

1 file changed

+2
-3
lines changed

compiler/rustc_builtin_macros/src/deriving/clone.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ pub fn expand_deriving_clone(
1717
) {
1818
let bounds;
1919
let substructure;
20-
let is_union;
2120
let is_shallow;
2221
match *item {
2322
Annotatable::Item(ref annitem) => match annitem.kind {
@@ -40,7 +39,7 @@ pub fn expand_deriving_clone(
4039
cs_clone_shallow(c, s, sub, false)
4140
}));
4241
} else {
43-
bounds = vec![];
42+
bounds = vec![Literal(path_std!(clone::Clone))];
4443
is_shallow = false;
4544
substructure = combine_substructure(Box::new(|c, s, sub| cs_clone(c, s, sub)));
4645
}
@@ -52,7 +51,7 @@ pub fn expand_deriving_clone(
5251
combine_substructure(Box::new(|c, s, sub| cs_clone_shallow(c, s, sub, true)));
5352
}
5453
_ => {
55-
bounds = vec![];
54+
bounds = vec![Literal(path_std!(clone::Clone))];
5655
is_shallow = false;
5756
substructure = combine_substructure(Box::new(|c, s, sub| cs_clone(c, s, sub)));
5857
}

0 commit comments

Comments
 (0)