Skip to content

Commit

Permalink
fix: Remove proc-macro2-diagnostics dependency (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay authored Nov 17, 2023
1 parent f7b6691 commit 3cfb534
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
9 changes: 4 additions & 5 deletions crates/test-case-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ doctest = false
path = "src/lib.rs"

[dependencies]
cfg-if = "1.0"
proc-macro2 = { version = "1.0", features = [] }
proc-macro2-diagnostics = "0.10"
quote = "1.0"
syn = { version = "2.0", features = ["full", "extra-traits"] }
cfg-if = "1.0"
proc-macro2 = { version = "1.0", features = [] }
quote = "1.0"
syn = { version = "2.0", features = ["full", "extra-traits"] }
7 changes: 2 additions & 5 deletions crates/test-case-core/src/complex_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,8 @@ fn regex_assertion(expected_regex: &Expr) -> TokenStream {
fn not_assertion(not: &ComplexTestCase) -> TokenStream {
match not {
ComplexTestCase::Not(_) => {
use proc_macro2_diagnostics::SpanDiagnosticExt as _;

Span::call_site()
.error("multiple negations on single item are forbidden")
.emit_as_expr_tokens()
let msg = "multiple negations on single item are forbidden";
syn::Error::new(Span::call_site(), msg).into_compile_error()
}
ComplexTestCase::And(cases) => negate(and_assertion(cases)),
ComplexTestCase::Or(cases) => negate(or_assertion(cases)),
Expand Down

0 comments on commit 3cfb534

Please sign in to comment.