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_json/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 '')
20 files changed, 136 insertions, 0 deletions
diff --git a/third_party/rust/serde_json/tests/ui/missing_colon.rs b/third_party/rust/serde_json/tests/ui/missing_colon.rs new file mode 100644 index 0000000000..d93b7b907d --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/missing_colon.rs @@ -0,0 +1,5 @@ +use serde_json::json; + +fn main() { + json!({ "a" }); +} diff --git a/third_party/rust/serde_json/tests/ui/missing_colon.stderr b/third_party/rust/serde_json/tests/ui/missing_colon.stderr new file mode 100644 index 0000000000..1515211adf --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/missing_colon.stderr @@ -0,0 +1,12 @@ +error: unexpected end of macro invocation + --> tests/ui/missing_colon.rs:4:5 + | +4 | json!({ "a" }); + | ^^^^^^^^^^^^^^ missing tokens in macro arguments + | +note: while trying to match `@` + --> src/macros.rs + | + | (@array [$($elems:expr,)*]) => { + | ^ + = note: this error originates in the macro `json_internal` which comes from the expansion of the macro `json` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/third_party/rust/serde_json/tests/ui/missing_comma.rs b/third_party/rust/serde_json/tests/ui/missing_comma.rs new file mode 100644 index 0000000000..8818c3e60c --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/missing_comma.rs @@ -0,0 +1,5 @@ +use serde_json::json; + +fn main() { + json!({ "1": "" "2": "" }); +} diff --git a/third_party/rust/serde_json/tests/ui/missing_comma.stderr b/third_party/rust/serde_json/tests/ui/missing_comma.stderr new file mode 100644 index 0000000000..bafa0f8915 --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/missing_comma.stderr @@ -0,0 +1,13 @@ +error: no rules expected the token `"2"` + --> tests/ui/missing_comma.rs:4:21 + | +4 | json!({ "1": "" "2": "" }); + | -^^^ no rules expected this token in macro call + | | + | help: missing comma here + | +note: while trying to match `,` + --> src/macros.rs + | + | ($e:expr , $($tt:tt)*) => {}; + | ^ diff --git a/third_party/rust/serde_json/tests/ui/missing_value.rs b/third_party/rust/serde_json/tests/ui/missing_value.rs new file mode 100644 index 0000000000..0ba14e22c2 --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/missing_value.rs @@ -0,0 +1,5 @@ +use serde_json::json; + +fn main() { + json!({ "a" : }); +} diff --git a/third_party/rust/serde_json/tests/ui/missing_value.stderr b/third_party/rust/serde_json/tests/ui/missing_value.stderr new file mode 100644 index 0000000000..9c9de99ca9 --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/missing_value.stderr @@ -0,0 +1,12 @@ +error: unexpected end of macro invocation + --> tests/ui/missing_value.rs:4:5 + | +4 | json!({ "a" : }); + | ^^^^^^^^^^^^^^^^ missing tokens in macro arguments + | +note: while trying to match `@` + --> src/macros.rs + | + | (@array [$($elems:expr,)*]) => { + | ^ + = note: this error originates in the macro `json_internal` which comes from the expansion of the macro `json` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/third_party/rust/serde_json/tests/ui/not_found.rs b/third_party/rust/serde_json/tests/ui/not_found.rs new file mode 100644 index 0000000000..2df6870dc3 --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/not_found.rs @@ -0,0 +1,5 @@ +use serde_json::json; + +fn main() { + json!({ "a" : x }); +} diff --git a/third_party/rust/serde_json/tests/ui/not_found.stderr b/third_party/rust/serde_json/tests/ui/not_found.stderr new file mode 100644 index 0000000000..6fec180409 --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/not_found.stderr @@ -0,0 +1,5 @@ +error[E0425]: cannot find value `x` in this scope + --> tests/ui/not_found.rs:4:19 + | +4 | json!({ "a" : x }); + | ^ not found in this scope diff --git a/third_party/rust/serde_json/tests/ui/parse_expr.rs b/third_party/rust/serde_json/tests/ui/parse_expr.rs new file mode 100644 index 0000000000..e7f1805b1e --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/parse_expr.rs @@ -0,0 +1,5 @@ +use serde_json::json; + +fn main() { + json!({ "a" : ~ }); +} diff --git a/third_party/rust/serde_json/tests/ui/parse_expr.stderr b/third_party/rust/serde_json/tests/ui/parse_expr.stderr new file mode 100644 index 0000000000..cd3e1c94d1 --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/parse_expr.stderr @@ -0,0 +1,11 @@ +error: no rules expected the token `~` + --> tests/ui/parse_expr.rs:4:19 + | +4 | json!({ "a" : ~ }); + | ^ no rules expected this token in macro call + | +note: while trying to match meta-variable `$e:expr` + --> src/macros.rs + | + | ($e:expr , $($tt:tt)*) => {}; + | ^^^^^^^ diff --git a/third_party/rust/serde_json/tests/ui/parse_key.rs b/third_party/rust/serde_json/tests/ui/parse_key.rs new file mode 100644 index 0000000000..858bd71692 --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/parse_key.rs @@ -0,0 +1,5 @@ +use serde_json::json; + +fn main() { + json!({ "".s : true }); +} diff --git a/third_party/rust/serde_json/tests/ui/parse_key.stderr b/third_party/rust/serde_json/tests/ui/parse_key.stderr new file mode 100644 index 0000000000..f10c21800e --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/parse_key.stderr @@ -0,0 +1,5 @@ +error[E0609]: no field `s` on type `&'static str` + --> tests/ui/parse_key.rs:4:16 + | +4 | json!({ "".s : true }); + | ^ diff --git a/third_party/rust/serde_json/tests/ui/unexpected_after_array_element.rs b/third_party/rust/serde_json/tests/ui/unexpected_after_array_element.rs new file mode 100644 index 0000000000..226c58cf17 --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/unexpected_after_array_element.rs @@ -0,0 +1,5 @@ +use serde_json::json; + +fn main() { + json!([ true => ]); +} diff --git a/third_party/rust/serde_json/tests/ui/unexpected_after_array_element.stderr b/third_party/rust/serde_json/tests/ui/unexpected_after_array_element.stderr new file mode 100644 index 0000000000..ef449f764d --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/unexpected_after_array_element.stderr @@ -0,0 +1,7 @@ +error: no rules expected the token `=>` + --> tests/ui/unexpected_after_array_element.rs:4:18 + | +4 | json!([ true => ]); + | ^^ no rules expected this token in macro call + | + = note: while trying to match end of macro diff --git a/third_party/rust/serde_json/tests/ui/unexpected_after_map_entry.rs b/third_party/rust/serde_json/tests/ui/unexpected_after_map_entry.rs new file mode 100644 index 0000000000..0dfb731559 --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/unexpected_after_map_entry.rs @@ -0,0 +1,5 @@ +use serde_json::json; + +fn main() { + json!({ "k": true => }); +} diff --git a/third_party/rust/serde_json/tests/ui/unexpected_after_map_entry.stderr b/third_party/rust/serde_json/tests/ui/unexpected_after_map_entry.stderr new file mode 100644 index 0000000000..c62d90ba0d --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/unexpected_after_map_entry.stderr @@ -0,0 +1,7 @@ +error: no rules expected the token `=>` + --> tests/ui/unexpected_after_map_entry.rs:4:23 + | +4 | json!({ "k": true => }); + | ^^ no rules expected this token in macro call + | + = note: while trying to match end of macro diff --git a/third_party/rust/serde_json/tests/ui/unexpected_colon.rs b/third_party/rust/serde_json/tests/ui/unexpected_colon.rs new file mode 100644 index 0000000000..e767ea6f7d --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/unexpected_colon.rs @@ -0,0 +1,5 @@ +use serde_json::json; + +fn main() { + json!({ : true }); +} diff --git a/third_party/rust/serde_json/tests/ui/unexpected_colon.stderr b/third_party/rust/serde_json/tests/ui/unexpected_colon.stderr new file mode 100644 index 0000000000..7e47726bc6 --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/unexpected_colon.stderr @@ -0,0 +1,7 @@ +error: no rules expected the token `:` + --> tests/ui/unexpected_colon.rs:4:13 + | +4 | json!({ : true }); + | ^ no rules expected this token in macro call + | + = note: while trying to match end of macro diff --git a/third_party/rust/serde_json/tests/ui/unexpected_comma.rs b/third_party/rust/serde_json/tests/ui/unexpected_comma.rs new file mode 100644 index 0000000000..338874ed8f --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/unexpected_comma.rs @@ -0,0 +1,5 @@ +use serde_json::json; + +fn main() { + json!({ "a" , "b": true }); +} diff --git a/third_party/rust/serde_json/tests/ui/unexpected_comma.stderr b/third_party/rust/serde_json/tests/ui/unexpected_comma.stderr new file mode 100644 index 0000000000..552f399a50 --- /dev/null +++ b/third_party/rust/serde_json/tests/ui/unexpected_comma.stderr @@ -0,0 +1,7 @@ +error: no rules expected the token `,` + --> tests/ui/unexpected_comma.rs:4:17 + | +4 | json!({ "a" , "b": true }); + | ^ no rules expected this token in macro call + | + = note: while trying to match end of macro |