Skip to content

Commit e33fac6

Browse files
committed
Use error reporting provided by Meta
1 parent cea0cef commit e33fac6

File tree

11 files changed

+71
-80
lines changed

11 files changed

+71
-80
lines changed

gen/build/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ once_cell = "1.9"
2525
proc-macro2 = { version = "1.0.39", default-features = false, features = ["span-locations"] }
2626
quote = { version = "1.0", default-features = false }
2727
scratch = "1.0"
28-
syn = { version = "2.0.0", default-features = false, features = ["parsing", "printing", "clone-impls", "full"] }
28+
syn = { version = "2.0.1", default-features = false, features = ["parsing", "printing", "clone-impls", "full"] }
2929

3030
[dev-dependencies]
3131
cxx = { version = "1.0", path = "../.." }

gen/cmd/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ clap = { version = "4", default-features = false, features = ["error-context", "
2525
codespan-reporting = "0.11"
2626
proc-macro2 = { version = "1.0.39", default-features = false, features = ["span-locations"] }
2727
quote = { version = "1.0", default-features = false }
28-
syn = { version = "2.0.0", default-features = false, features = ["parsing", "printing", "clone-impls", "full"] }
28+
syn = { version = "2.0.1", default-features = false, features = ["parsing", "printing", "clone-impls", "full"] }
2929

3030
[package.metadata.docs.rs]
3131
targets = ["x86_64-unknown-linux-gnu"]

gen/lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ rust-version = "1.60"
1515
codespan-reporting = "0.11"
1616
proc-macro2 = { version = "1.0.39", default-features = false, features = ["span-locations"] }
1717
quote = { version = "1.0", default-features = false }
18-
syn = { version = "2.0.0", default-features = false, features = ["parsing", "printing", "clone-impls", "full"] }
18+
syn = { version = "2.0.1", default-features = false, features = ["parsing", "printing", "clone-impls", "full"] }
1919

2020
[lib]
2121
doc-scrape-examples = false

macro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ experimental-enum-variants-from-header = ["clang-ast", "flate2", "memmap", "serd
2323
[dependencies]
2424
proc-macro2 = "1.0.39"
2525
quote = "1.0.4"
26-
syn = { version = "2.0.0", features = ["full"] }
26+
syn = { version = "2.0.1", features = ["full"] }
2727

2828
# optional dependencies:
2929
clang-ast = { version = "0.1", optional = true }

syntax/attrs.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ pub fn parse(cx: &mut Errors, attrs: Vec<Attribute>, mut parser: Parser) -> Othe
146146
} else if attr_path.is_ident("variants_from_header")
147147
&& cfg!(feature = "experimental-enum-variants-from-header")
148148
{
149-
if let Err(err) = require_empty_attribute(&attr.meta) {
149+
if let Err(err) = attr.meta.require_path_only() {
150150
cx.push(err);
151151
}
152152
if let Some(variants_from_header) = &mut parser.variants_from_header {
@@ -310,12 +310,3 @@ impl ToTokens for OtherAttrs {
310310
}
311311
}
312312
}
313-
314-
fn require_empty_attribute(meta: &Meta) -> Result<()> {
315-
let error_span = match meta {
316-
Meta::Path(_) => return Ok(()),
317-
Meta::List(meta) => meta.delimiter.span().open(),
318-
Meta::NameValue(meta) => meta.eq_token.span,
319-
};
320-
Err(Error::new(error_span, "unexpected token in cxx attribute"))
321-
}

third-party/BUCK

Lines changed: 55 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

third-party/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

third-party/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ once_cell = "1.9"
1515
proc-macro2 = { version = "1.0.39", features = ["span-locations"] }
1616
quote = "1.0.4"
1717
scratch = "1"
18-
syn = { version = "2.0.0", features = ["full"] }
18+
syn = { version = "2.0.1", features = ["full"] }

third-party/bazel/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

third-party/bazel/BUILD.syn-2.0.0.bazel renamed to third-party/bazel/BUILD.syn-2.0.1.bazel

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)