From 1f58c458555a49170dc91bac217aaee9ee311307 Mon Sep 17 00:00:00 2001 From: stormshield-gt <143998166+stormshield-gt@users.noreply.github.com.> Date: Wed, 3 Apr 2024 16:08:48 +0200 Subject: [PATCH] add missing .stderr files --- tests/macro/empty_attr.stderr | 19 +++++++++++++++ tests/macro/invalid_data.stderr | 40 +++++++++++++++++++++++++++++++ tests/macro/invalid_method.stderr | 13 ++++++++++ tests/macro/invalid_result.stderr | 13 ++++++++++ tests/macro/invalid_type.stderr | 19 +++++++++++++++ tests/macro/no_attr.stderr | 15 ++++++++++++ tests/macro/no_path.stderr | 15 ++++++++++++ 7 files changed, 134 insertions(+) create mode 100644 tests/macro/empty_attr.stderr create mode 100644 tests/macro/invalid_data.stderr create mode 100644 tests/macro/invalid_method.stderr create mode 100644 tests/macro/invalid_result.stderr create mode 100644 tests/macro/invalid_type.stderr create mode 100644 tests/macro/no_attr.stderr create mode 100644 tests/macro/no_path.stderr diff --git a/tests/macro/empty_attr.stderr b/tests/macro/empty_attr.stderr new file mode 100644 index 0000000..c4c91c6 --- /dev/null +++ b/tests/macro/empty_attr.stderr @@ -0,0 +1,19 @@ +error: Cannot parse attribute as list + --> tests/macro/empty_attr.rs:6:3 + | +6 | #[endpoint] + | ^^^^^^^^ + +error: Attribute cannot be empty + --> tests/macro/empty_attr.rs:10:3 + | +10 | #[endpoint()] + | ^^^^^^^^ + +warning: unused import: `rustify::endpoint::Endpoint` + --> tests/macro/empty_attr.rs:1:5 + | +1 | use rustify::endpoint::Endpoint; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` on by default diff --git a/tests/macro/invalid_data.stderr b/tests/macro/invalid_data.stderr new file mode 100644 index 0000000..1dc6cec --- /dev/null +++ b/tests/macro/invalid_data.stderr @@ -0,0 +1,40 @@ +error: May only mark one field as raw + --> tests/macro/invalid_data.rs:19:5 + | +19 | #[endpoint(raw)] + | ^ + +warning: unused import: `rustify::endpoint::Endpoint` + --> tests/macro/invalid_data.rs:1:5 + | +1 | use rustify::endpoint::Endpoint; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` on by default + +error[E0308]: mismatched types + --> tests/macro/invalid_data.rs:5:17 + | +5 | #[derive(Debug, Endpoint, Serialize)] + | ^^^^^^^^ + | | + | expected `Vec`, found `String` + | arguments to this enum variant are incorrect + | + = note: expected struct `Vec` + found struct `std::string::String` +help: the type constructed contains `std::string::String` due to the type of the argument passed + --> tests/macro/invalid_data.rs:5:17 + | +5 | #[derive(Debug, Endpoint, Serialize)] + | ^^^^^^^^ this argument influences the type of `Some` +note: tuple variant defined here + --> $RUST/core/src/option.rs + | + | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ^^^^ + = note: this error originates in the derive macro `Endpoint` (in Nightly builds, run with -Z macro-backtrace for more info) +help: call `Into::into` on this expression to convert `std::string::String` into `Vec` + | +5 | #[derive(Debug, Endpoint.into(), Serialize)] + | +++++++ diff --git a/tests/macro/invalid_method.stderr b/tests/macro/invalid_method.stderr new file mode 100644 index 0000000..c04ca07 --- /dev/null +++ b/tests/macro/invalid_method.stderr @@ -0,0 +1,13 @@ +warning: unused import: `rustify::endpoint::Endpoint` + --> tests/macro/invalid_method.rs:1:5 + | +1 | use rustify::endpoint::Endpoint; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` on by default + +error[E0599]: no variant or associated item named `TEST` found for enum `RequestMethod` in the current scope + --> tests/macro/invalid_method.rs:6:41 + | +6 | #[endpoint(path = "test/path", method = "TEST")] + | ^^^^^^ variant or associated item not found in `RequestMethod` diff --git a/tests/macro/invalid_result.stderr b/tests/macro/invalid_result.stderr new file mode 100644 index 0000000..08f3adb --- /dev/null +++ b/tests/macro/invalid_result.stderr @@ -0,0 +1,13 @@ +error: Unknown parameter + --> tests/macro/invalid_result.rs:6:32 + | +6 | #[endpoint(path = "test/path", result = "DoesNotExist")] + | ^^^^^^ + +warning: unused import: `rustify::endpoint::Endpoint` + --> tests/macro/invalid_result.rs:1:5 + | +1 | use rustify::endpoint::Endpoint; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` on by default diff --git a/tests/macro/invalid_type.stderr b/tests/macro/invalid_type.stderr new file mode 100644 index 0000000..b041ce7 --- /dev/null +++ b/tests/macro/invalid_type.stderr @@ -0,0 +1,19 @@ +warning: unused import: `rustify::endpoint::Endpoint` + --> tests/macro/invalid_type.rs:1:5 + | +1 | use rustify::endpoint::Endpoint; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` on by default + +error[E0599]: no variant or associated item named `BAD` found for enum `RequestType` in the current scope + --> tests/macro/invalid_type.rs:6:47 + | +6 | #[endpoint(path = "test/path", request_type = "BAD", response_type = "BAD")] + | ^^^^^ variant or associated item not found in `RequestType` + +error[E0599]: no variant or associated item named `BAD` found for enum `ResponseType` in the current scope + --> tests/macro/invalid_type.rs:6:70 + | +6 | #[endpoint(path = "test/path", request_type = "BAD", response_type = "BAD")] + | ^^^^^ variant or associated item not found in `ResponseType` diff --git a/tests/macro/no_attr.stderr b/tests/macro/no_attr.stderr new file mode 100644 index 0000000..07d7749 --- /dev/null +++ b/tests/macro/no_attr.stderr @@ -0,0 +1,15 @@ +error: Deriving `Endpoint` requires attaching an `endpoint` attribute + --> tests/macro/no_attr.rs:5:17 + | +5 | #[derive(Debug, Endpoint, Serialize)] + | ^^^^^^^^ + | + = note: this error originates in the derive macro `Endpoint` (in Nightly builds, run with -Z macro-backtrace for more info) + +warning: unused import: `rustify::endpoint::Endpoint` + --> tests/macro/no_attr.rs:1:5 + | +1 | use rustify::endpoint::Endpoint; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` on by default diff --git a/tests/macro/no_path.stderr b/tests/macro/no_path.stderr new file mode 100644 index 0000000..a3ab12a --- /dev/null +++ b/tests/macro/no_path.stderr @@ -0,0 +1,15 @@ +error: Missing required parameter: path + --> tests/macro/no_path.rs:5:17 + | +5 | #[derive(Debug, Endpoint, Serialize)] + | ^^^^^^^^ + | + = note: this error originates in the derive macro `Endpoint` (in Nightly builds, run with -Z macro-backtrace for more info) + +warning: unused import: `rustify::endpoint::Endpoint` + --> tests/macro/no_path.rs:1:5 + | +1 | use rustify::endpoint::Endpoint; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` on by default