Skip to content

Commit

Permalink
fix: Build error due to merge conflict
Browse files Browse the repository at this point in the history
Due to two pull requests changing the same function a build error occurred. `fields` has move to inside `oneof` and has changed type.
  • Loading branch information
caspermeijn committed May 20, 2024
1 parent bb5a1fa commit 2fc73ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prost-build/src/code_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,9 +619,9 @@ impl<'a> CodeGenerator<'a> {
self.buf
.push_str("#[allow(clippy::derive_partial_eq_without_eq)]\n");

let can_oneof_derive_copy = fields.iter().map(|(field, _idx)| field).all(|field| {
let can_oneof_derive_copy = oneof.fields.iter().all(|field| {
self.message_graph
.can_field_derive_copy(fq_message_name, field)
.can_field_derive_copy(fq_message_name, &field.descriptor)
});
self.buf.push_str(&format!(
"#[derive(Clone, {}PartialEq, {}::Oneof)]\n",
Expand Down
1 change: 1 addition & 0 deletions tests/src/derive_copy.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include!(concat!(env!("OUT_DIR"), "/derive_copy.rs"));

#[allow(dead_code)]
trait TestCopyIsImplemented: Copy {}

impl TestCopyIsImplemented for EmptyMsg {}
Expand Down

0 comments on commit 2fc73ed

Please sign in to comment.