Skip to content

Commit

Permalink
Tweak deriving-all-codegen.rs.
Browse files Browse the repository at this point in the history
To include some `Option<>` fields of different types in a single enum.
The test output is currently buggy, but the next commit will fix that.
  • Loading branch information
nnethercote committed Oct 18, 2022
1 parent bf286a8 commit dfa9d5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/test/ui/deriving/deriving-all-codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ enum Mixed {
P,
Q,
R(u32),
S { d1: u32, d2: u32 },
S { d1: Option<u32>, d2: Option<i32> },
}

// An enum with no fieldless variants. Note that `Default` cannot be derived
Expand Down
6 changes: 4 additions & 2 deletions src/test/ui/deriving/deriving-all-codegen.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -789,15 +789,16 @@ enum Mixed {
Q,
R(u32),
S {
d1: u32,
d2: u32,
d1: Option<u32>,
d2: Option<i32>,
},
}
#[automatically_derived]
impl ::core::clone::Clone for Mixed {
#[inline]
fn clone(&self) -> Mixed {
let _: ::core::clone::AssertParamIsClone<u32>;
let _: ::core::clone::AssertParamIsClone<Option<u32>>;
*self
}
}
Expand Down Expand Up @@ -864,6 +865,7 @@ impl ::core::cmp::Eq for Mixed {
#[no_coverage]
fn assert_receiver_is_total_eq(&self) -> () {
let _: ::core::cmp::AssertParamIsEq<u32>;
let _: ::core::cmp::AssertParamIsEq<Option<u32>>;
}
}
#[automatically_derived]
Expand Down

0 comments on commit dfa9d5c

Please sign in to comment.