Skip to content

Commit

Permalink
Add Clone bounds for derive
Browse files Browse the repository at this point in the history
  • Loading branch information
fee1-dead committed Apr 5, 2022
1 parent 45c50ff commit e90c1f6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler/rustc_builtin_macros/src/deriving/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pub fn expand_deriving_clone(
) {
let bounds;
let substructure;
let is_union;
let is_shallow;
match *item {
Annotatable::Item(ref annitem) => match annitem.kind {
Expand All @@ -40,7 +39,7 @@ pub fn expand_deriving_clone(
cs_clone_shallow(c, s, sub, false)
}));
} else {
bounds = vec![];
bounds = vec![Literal(path_std!(clone::Clone))];
is_shallow = false;
substructure = combine_substructure(Box::new(|c, s, sub| cs_clone(c, s, sub)));
}
Expand All @@ -52,7 +51,7 @@ pub fn expand_deriving_clone(
combine_substructure(Box::new(|c, s, sub| cs_clone_shallow(c, s, sub, true)));
}
_ => {
bounds = vec![];
bounds = vec![Literal(path_std!(clone::Clone))];
is_shallow = false;
substructure = combine_substructure(Box::new(|c, s, sub| cs_clone(c, s, sub)));
}
Expand Down

0 comments on commit e90c1f6

Please sign in to comment.