-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
In my attempt to migrate this crate away from the abandoned proc-macro-error crate I discovered these usages of syn::Result::ok were causing test failures with this diff applied:
diff --git a/crates/test-case-core/src/complex_expr.rs b/crates/test-case-core/src/complex_expr.rs
index e708f2e..2a4334e 100644
--- a/crates/test-case-core/src/complex_expr.rs
+++ b/crates/test-case-core/src/complex_expr.rs
@@ -323,11 +323,11 @@ impl ComplexTestCase {
expected_regex: input.parse()?,
})
} else {
- proc_macro_error::abort!(input.span(), "'with-regex' feature is required to use 'matches-regex' keyword");
+ return Err(input.error("'with-regex' feature is required to use 'matches-regex' keyword"));
}
}
} else {
- proc_macro_error::abort!(input.span(), "cannot parse complex expression")
+ return Err(input.error("cannot parse complex expression"));
})
}
}
I realize that these .ok() calls are used in cases where expressions and comments are optional, but it would be better to peek and avoid errors so that these .ok()s can be removed to allow the change above.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels