diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /third_party/rust/serde_repr/tests/ui | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/serde_repr/tests/ui')
10 files changed, 85 insertions, 0 deletions
diff --git a/third_party/rust/serde_repr/tests/ui/empty_enum.rs b/third_party/rust/serde_repr/tests/ui/empty_enum.rs new file mode 100644 index 0000000000..f1fb6f9d56 --- /dev/null +++ b/third_party/rust/serde_repr/tests/ui/empty_enum.rs @@ -0,0 +1,6 @@ +use serde_repr::Serialize_repr; + +#[derive(Serialize_repr)] +enum SmallPrime {} + +fn main() {} diff --git a/third_party/rust/serde_repr/tests/ui/empty_enum.stderr b/third_party/rust/serde_repr/tests/ui/empty_enum.stderr new file mode 100644 index 0000000000..d7c4de19b3 --- /dev/null +++ b/third_party/rust/serde_repr/tests/ui/empty_enum.stderr @@ -0,0 +1,7 @@ +error: there must be at least one variant + --> tests/ui/empty_enum.rs:3:10 + | +3 | #[derive(Serialize_repr)] + | ^^^^^^^^^^^^^^ + | + = note: this error originates in the derive macro `Serialize_repr` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/third_party/rust/serde_repr/tests/ui/missing_repr.rs b/third_party/rust/serde_repr/tests/ui/missing_repr.rs new file mode 100644 index 0000000000..00836356b9 --- /dev/null +++ b/third_party/rust/serde_repr/tests/ui/missing_repr.rs @@ -0,0 +1,11 @@ +use serde_repr::Serialize_repr; + +#[derive(Serialize_repr)] +enum SmallPrime { + Two = 2, + Three = 3, + Five = 5, + Seven = 7, +} + +fn main() {} diff --git a/third_party/rust/serde_repr/tests/ui/missing_repr.stderr b/third_party/rust/serde_repr/tests/ui/missing_repr.stderr new file mode 100644 index 0000000000..e011be6f1c --- /dev/null +++ b/third_party/rust/serde_repr/tests/ui/missing_repr.stderr @@ -0,0 +1,7 @@ +error: missing #[repr(...)] attribute + --> tests/ui/missing_repr.rs:3:10 + | +3 | #[derive(Serialize_repr)] + | ^^^^^^^^^^^^^^ + | + = note: this error originates in the derive macro `Serialize_repr` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/third_party/rust/serde_repr/tests/ui/multiple_others.rs b/third_party/rust/serde_repr/tests/ui/multiple_others.rs new file mode 100644 index 0000000000..fdb552b109 --- /dev/null +++ b/third_party/rust/serde_repr/tests/ui/multiple_others.rs @@ -0,0 +1,12 @@ +use serde_repr::Deserialize_repr; + +#[derive(Deserialize_repr)] +#[repr(u8)] +enum MultipleOthers { + #[serde(other)] + A, + #[serde(other)] + B, +} + +fn main() {} diff --git a/third_party/rust/serde_repr/tests/ui/multiple_others.stderr b/third_party/rust/serde_repr/tests/ui/multiple_others.stderr new file mode 100644 index 0000000000..599d5e1724 --- /dev/null +++ b/third_party/rust/serde_repr/tests/ui/multiple_others.stderr @@ -0,0 +1,7 @@ +error: only one variant can be #[serde(other)] + --> tests/ui/multiple_others.rs:3:10 + | +3 | #[derive(Deserialize_repr)] + | ^^^^^^^^^^^^^^^^ + | + = note: this error originates in the derive macro `Deserialize_repr` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/third_party/rust/serde_repr/tests/ui/non_unit_variant.rs b/third_party/rust/serde_repr/tests/ui/non_unit_variant.rs new file mode 100644 index 0000000000..9cdc80d0af --- /dev/null +++ b/third_party/rust/serde_repr/tests/ui/non_unit_variant.rs @@ -0,0 +1,12 @@ +use serde_repr::Serialize_repr; + +#[derive(Serialize_repr)] +#[repr(u8)] +enum SmallPrime { + Two(u8), + Three(u8), + Five(u8), + Seven(u8), +} + +fn main() {} diff --git a/third_party/rust/serde_repr/tests/ui/non_unit_variant.stderr b/third_party/rust/serde_repr/tests/ui/non_unit_variant.stderr new file mode 100644 index 0000000000..8eaf0c1d9b --- /dev/null +++ b/third_party/rust/serde_repr/tests/ui/non_unit_variant.stderr @@ -0,0 +1,5 @@ +error: must be a unit variant + --> tests/ui/non_unit_variant.rs:6:5 + | +6 | Two(u8), + | ^^^ diff --git a/third_party/rust/serde_repr/tests/ui/not_enum.rs b/third_party/rust/serde_repr/tests/ui/not_enum.rs new file mode 100644 index 0000000000..92a1d746dc --- /dev/null +++ b/third_party/rust/serde_repr/tests/ui/not_enum.rs @@ -0,0 +1,11 @@ +use serde_repr::Serialize_repr; + +#[derive(Serialize_repr)] +struct SmallPrime { + two: u8, + three: u8, + five: u8, + seven: u8, +} + +fn main() {} diff --git a/third_party/rust/serde_repr/tests/ui/not_enum.stderr b/third_party/rust/serde_repr/tests/ui/not_enum.stderr new file mode 100644 index 0000000000..26ad4c313f --- /dev/null +++ b/third_party/rust/serde_repr/tests/ui/not_enum.stderr @@ -0,0 +1,7 @@ +error: input must be an enum + --> tests/ui/not_enum.rs:3:10 + | +3 | #[derive(Serialize_repr)] + | ^^^^^^^^^^^^^^ + | + = note: this error originates in the derive macro `Serialize_repr` (in Nightly builds, run with -Z macro-backtrace for more info) |