about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-10-18 14:31:33 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2022-10-18 14:47:27 +1100
commitdfa9d5c971d74aa5bdf6b99253fe4b7db39f9b67 (patch)
treee394a13f7f130e6835574d6d3bd40712d68f2bff
parentbf286a82e236e065c67909657e3a35d1511d1864 (diff)
downloadrust-dfa9d5c971d74aa5bdf6b99253fe4b7db39f9b67.tar.gz
rust-dfa9d5c971d74aa5bdf6b99253fe4b7db39f9b67.zip
Tweak `deriving-all-codegen.rs`.
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.
-rw-r--r--src/test/ui/deriving/deriving-all-codegen.rs2
-rw-r--r--src/test/ui/deriving/deriving-all-codegen.stdout6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/test/ui/deriving/deriving-all-codegen.rs b/src/test/ui/deriving/deriving-all-codegen.rs
index aef79ae8a5b..ba7809413bd 100644
--- a/src/test/ui/deriving/deriving-all-codegen.rs
+++ b/src/test/ui/deriving/deriving-all-codegen.rs
@@ -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
diff --git a/src/test/ui/deriving/deriving-all-codegen.stdout b/src/test/ui/deriving/deriving-all-codegen.stdout
index 65f7dec8408..6baa7317b12 100644
--- a/src/test/ui/deriving/deriving-all-codegen.stdout
+++ b/src/test/ui/deriving/deriving-all-codegen.stdout
@@ -789,8 +789,8 @@ enum Mixed {
     Q,
     R(u32),
     S {
-        d1: u32,
-        d2: u32,
+        d1: Option<u32>,
+        d2: Option<i32>,
     },
 }
 #[automatically_derived]
@@ -798,6 +798,7 @@ impl ::core::clone::Clone for Mixed {
     #[inline]
     fn clone(&self) -> Mixed {
         let _: ::core::clone::AssertParamIsClone<u32>;
+        let _: ::core::clone::AssertParamIsClone<Option<u32>>;
         *self
     }
 }
@@ -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]