Ui tests with compile_error resolved at call site

This commit is contained in:
David Tolnay
2023-06-07 20:02:04 -07:00
parent 1aebdc2760
commit e77db40b8d
92 changed files with 467 additions and 0 deletions
@@ -1,6 +1,11 @@
error: variant `Newtype` cannot have both #[serde(deserialize_with)] and a field #0 marked with #[serde(skip_deserializing)]
--> tests/ui/with-variant/skip_de_newtype_field.rs:5:5
|
3 | #[derive(Deserialize)]
| ----------- in this derive macro expansion
4 | enum Enum {
5 | / #[serde(deserialize_with = "deserialize_some_newtype_variant")]
6 | | Newtype(#[serde(skip_deserializing)] String),
| |________________________________________________^
|
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,6 +1,9 @@
error: variant `Struct` cannot have both #[serde(deserialize_with)] and a field `f1` marked with #[serde(skip_deserializing)]
--> tests/ui/with-variant/skip_de_struct_field.rs:5:5
|
3 | #[derive(Deserialize)]
| ----------- in this derive macro expansion
4 | enum Enum {
5 | / #[serde(deserialize_with = "deserialize_some_other_variant")]
6 | | Struct {
7 | | #[serde(skip_deserializing)]
@@ -8,3 +11,5 @@ error: variant `Struct` cannot have both #[serde(deserialize_with)] and a field
9 | | f2: u8,
10 | | },
| |_____^
|
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,6 +1,11 @@
error: variant `Tuple` cannot have both #[serde(deserialize_with)] and a field #0 marked with #[serde(skip_deserializing)]
--> tests/ui/with-variant/skip_de_tuple_field.rs:5:5
|
3 | #[derive(Deserialize)]
| ----------- in this derive macro expansion
4 | enum Enum {
5 | / #[serde(deserialize_with = "deserialize_some_other_variant")]
6 | | Tuple(#[serde(skip_deserializing)] String, u8),
| |__________________________________________________^
|
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,7 +1,12 @@
error: variant `Unit` cannot have both #[serde(deserialize_with)] and #[serde(skip_deserializing)]
--> tests/ui/with-variant/skip_de_whole_variant.rs:5:5
|
3 | #[derive(Deserialize)]
| ----------- in this derive macro expansion
4 | enum Enum {
5 | / #[serde(deserialize_with = "deserialize_some_unit_variant")]
6 | | #[serde(skip_deserializing)]
7 | | Unit,
| |________^
|
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,6 +1,11 @@
error: variant `Newtype` cannot have both #[serde(serialize_with)] and a field #0 marked with #[serde(skip_serializing)]
--> tests/ui/with-variant/skip_ser_newtype_field.rs:5:5
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | enum Enum {
5 | / #[serde(serialize_with = "serialize_some_newtype_variant")]
6 | | Newtype(#[serde(skip_serializing)] String),
| |______________________________________________^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,6 +1,11 @@
error: variant `Newtype` cannot have both #[serde(serialize_with)] and a field #0 marked with #[serde(skip_serializing_if)]
--> tests/ui/with-variant/skip_ser_newtype_field_if.rs:5:5
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | enum Enum {
5 | / #[serde(serialize_with = "serialize_some_newtype_variant")]
6 | | Newtype(#[serde(skip_serializing_if = "always")] String),
| |____________________________________________________________^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,6 +1,9 @@
error: variant `Struct` cannot have both #[serde(serialize_with)] and a field `f1` marked with #[serde(skip_serializing)]
--> tests/ui/with-variant/skip_ser_struct_field.rs:5:5
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | enum Enum {
5 | / #[serde(serialize_with = "serialize_some_other_variant")]
6 | | Struct {
7 | | #[serde(skip_serializing)]
@@ -8,3 +11,5 @@ error: variant `Struct` cannot have both #[serde(serialize_with)] and a field `f
9 | | f2: u8,
10 | | },
| |_____^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,6 +1,9 @@
error: variant `Struct` cannot have both #[serde(serialize_with)] and a field `f1` marked with #[serde(skip_serializing_if)]
--> tests/ui/with-variant/skip_ser_struct_field_if.rs:5:5
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | enum Enum {
5 | / #[serde(serialize_with = "serialize_some_newtype_variant")]
6 | | Struct {
7 | | #[serde(skip_serializing_if = "always")]
@@ -8,3 +11,5 @@ error: variant `Struct` cannot have both #[serde(serialize_with)] and a field `f
9 | | f2: u8,
10 | | },
| |_____^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,6 +1,11 @@
error: variant `Tuple` cannot have both #[serde(serialize_with)] and a field #0 marked with #[serde(skip_serializing)]
--> tests/ui/with-variant/skip_ser_tuple_field.rs:5:5
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | enum Enum {
5 | / #[serde(serialize_with = "serialize_some_other_variant")]
6 | | Tuple(#[serde(skip_serializing)] String, u8),
| |________________________________________________^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,6 +1,11 @@
error: variant `Tuple` cannot have both #[serde(serialize_with)] and a field #0 marked with #[serde(skip_serializing_if)]
--> tests/ui/with-variant/skip_ser_tuple_field_if.rs:5:5
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | enum Enum {
5 | / #[serde(serialize_with = "serialize_some_other_variant")]
6 | | Tuple(#[serde(skip_serializing_if = "always")] String, u8),
| |______________________________________________________________^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,7 +1,12 @@
error: variant `Unit` cannot have both #[serde(serialize_with)] and #[serde(skip_serializing)]
--> tests/ui/with-variant/skip_ser_whole_variant.rs:5:5
|
3 | #[derive(Serialize)]
| --------- in this derive macro expansion
4 | enum Enum {
5 | / #[serde(serialize_with = "serialize_some_unit_variant")]
6 | | #[serde(skip_serializing)]
7 | | Unit,
| |________^
|
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)