From 2cc0ef2f507985abb44752e91087787223512280 Mon Sep 17 00:00:00 2001 From: Simone Cottini Date: Tue, 14 May 2024 18:07:49 +0200 Subject: [PATCH] Fix tests --- Cargo.toml | 2 +- positional_derive/src/analyze/variant.rs | 1 - .../tests/ui/enums-with-wrong-matcher.stderr | 4 ++-- positional_derive/tests/ui/list-attributes.stderr | 8 ++++---- positional_derive/tests/ui/path-attributes.stderr | 8 ++++---- positional_derive/tests/ui/wrong-filler-type.stderr | 4 ++-- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b1b7dfa..3c5c352 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] - +resolver = "2" members = [ "positional", "positional_derive", diff --git a/positional_derive/src/analyze/variant.rs b/positional_derive/src/analyze/variant.rs index 6e12e1b..5c67079 100644 --- a/positional_derive/src/analyze/variant.rs +++ b/positional_derive/src/analyze/variant.rs @@ -1,5 +1,4 @@ use proc_macro_error::abort; -use syn::spanned::Spanned; use syn::{Expr, Fields}; const MATCHER_ATTRIBUTE: &str = "matcher"; diff --git a/positional_derive/tests/ui/enums-with-wrong-matcher.stderr b/positional_derive/tests/ui/enums-with-wrong-matcher.stderr index 61bf963..c5a74b6 100644 --- a/positional_derive/tests/ui/enums-with-wrong-matcher.stderr +++ b/positional_derive/tests/ui/enums-with-wrong-matcher.stderr @@ -2,7 +2,7 @@ error: expected an expression as matcher = help: example syntax: `#[matcher(row[0..2] == "00")]` - --> tests/ui/enums-with-wrong-matcher.rs:5:14 + --> tests/ui/enums-with-wrong-matcher.rs:5:15 | 5 | #[matcher(struct)] - | ^^^^^^^^ + | ^^^^^^ diff --git a/positional_derive/tests/ui/list-attributes.stderr b/positional_derive/tests/ui/list-attributes.stderr index fd4c410..65086f0 100644 --- a/positional_derive/tests/ui/list-attributes.stderr +++ b/positional_derive/tests/ui/list-attributes.stderr @@ -1,8 +1,8 @@ -error: wrong field configuration +error: failed to parse field attribute - = help: there should only be name = value couple inside the field configuration + = note: unsupported attribute - --> tests/ui/list-attributes.rs:5:13 + --> tests/ui/list-attributes.rs:5:5 | 5 | #[field(a)] - | ^ + | ^^^^^^^^^^^ diff --git a/positional_derive/tests/ui/path-attributes.stderr b/positional_derive/tests/ui/path-attributes.stderr index da0a86f..037a50f 100644 --- a/positional_derive/tests/ui/path-attributes.stderr +++ b/positional_derive/tests/ui/path-attributes.stderr @@ -1,8 +1,8 @@ -error: wrong field configuration +error: failed to parse field attribute - = help: there should only be name = value couple inside the field configuration + = note: expected attribute arguments in parentheses: #[field(...)] - --> tests/ui/path-attributes.rs:5:7 + --> tests/ui/path-attributes.rs:5:5 | 5 | #[field] - | ^^^^^ + | ^^^^^^^^ diff --git a/positional_derive/tests/ui/wrong-filler-type.stderr b/positional_derive/tests/ui/wrong-filler-type.stderr index 5b0a2fa..2368512 100644 --- a/positional_derive/tests/ui/wrong-filler-type.stderr +++ b/positional_derive/tests/ui/wrong-filler-type.stderr @@ -1,6 +1,6 @@ -error: wrong field configuration +error: failed to parse field attribute - = help: the filler configuration should be a char + = note: expected character literal --> tests/ui/wrong-filler-type.rs:5:5 |