Conversation
|
Changes to the code generated for builtin derived traits. cc @nnethercote |
This comment has been minimized.
This comment has been minimized.
544b651 to
5657ac1
Compare
| .collect::<Vec<String>>(); | ||
| let prefixes: &[&str] = match selflike_args.len() { | ||
| 1 => &["__self"], | ||
| 2 => &["__self", "__arg1"], |
There was a problem hiding this comment.
This is good. The old code seemed designed to be very generic and handle a wide variety of possible method signatures, when in practice they have only a few forms.
| .map(|prefix| { | ||
| let pieces_iter = | ||
| struct_def.fields().iter().enumerate().map(|(i, struct_field)| { | ||
| let sp = struct_field.span.with_ctxt(self.span.ctxt()); |
There was a problem hiding this comment.
Why can the with_ctxt be removed?
There was a problem hiding this comment.
make_pattern_ident creates an ident with span self.span, so it already has the correct context and with_span_pos doesn't look at sps context
|
|
||
| pub methods: SmallVec<[MethodDef<'a>; 1]>, | ||
|
|
||
| pub associated_types: SmallVec<[(Ident, Ty); 1]>, |
This comment has been minimized.
This comment has been minimized.
5657ac1 to
2196ae3
Compare
|
r=me once tests are green. @bors delegate=cyrgani |
|
✌️ @cyrgani, you can now approve this pull request! If @nnethercote told you to " |
As the next step after #163080, this PR removes more unneeded complexity, including the "mini version of
Ty" and theFieldInfofor discriminants.r? @nnethercote