Generated
+3
-3
@@ -30,7 +30,7 @@ dependencies = [
|
||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@@ -214,7 +214,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "0.14.1"
|
||||
version = "0.15.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -321,7 +321,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
"checksum serde_json 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "93aee34bb692dde91e602871bc792dd319e489c7308cdbbe5f27cf27c64280f5"
|
||||
"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
|
||||
"checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b"
|
||||
"checksum syn 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6dfd71b2be5a58ee30a6f8ea355ba8290d397131c00dfa55c3d34e6e13db5101"
|
||||
"checksum syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)" = "9545a6a093a3f0bd59adb472700acc08cad3776f860f16a897dfce8c88721cbc"
|
||||
"checksum tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c4b103c6d08d323b92ff42c8ce62abcd83ca8efa7fd5bf7927efefec75f58c76"
|
||||
"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
|
||||
"checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693"
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ toml = "0.4"
|
||||
version = "=1.0.58"
|
||||
|
||||
[dependencies.syn]
|
||||
version = "0.14.0"
|
||||
version = "0.15.0"
|
||||
default-features = false
|
||||
features = ["clone-impls", "derive", "extra-traits", "full", "parsing", "printing"]
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ use std::fmt;
|
||||
pub use bindgen::cargo::cargo_expand::Error as CargoExpandError;
|
||||
pub use bindgen::cargo::cargo_metadata::Error as CargoMetadataError;
|
||||
pub use bindgen::cargo::cargo_toml::Error as CargoTomlError;
|
||||
pub use syn::synom::ParseError;
|
||||
pub use syn::parse::Error as ParseError;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
|
||||
@@ -108,10 +108,6 @@ impl Cfg {
|
||||
let mut configs = Vec::new();
|
||||
|
||||
for attr in attrs {
|
||||
if attr.is_sugared_doc {
|
||||
continue;
|
||||
}
|
||||
|
||||
match attr.interpret_meta() {
|
||||
Some(syn::Meta::List(syn::MetaList { ident, nested, .. })) => {
|
||||
if ident != "cfg" || nested.len() != 1 {
|
||||
|
||||
@@ -36,14 +36,12 @@ impl Documentation {
|
||||
let comment = comment.value();
|
||||
|
||||
if &*name == "doc" {
|
||||
let line = if attr.is_sugared_doc {
|
||||
comment
|
||||
.trim_left_matches("/// ")
|
||||
.trim_left_matches("///")
|
||||
.trim_right()
|
||||
} else {
|
||||
comment.trim_left_matches(" ").trim_right()
|
||||
};
|
||||
// Try to catch both sugared and unsugared doc
|
||||
// attributes.
|
||||
let line = comment
|
||||
.trim_left_matches("///")
|
||||
.trim_left_matches(" ")
|
||||
.trim_right();
|
||||
if !line.starts_with("cbindgen:") {
|
||||
doc.push(line.to_owned());
|
||||
}
|
||||
|
||||
@@ -55,12 +55,8 @@ impl Repr {
|
||||
let ids = attrs
|
||||
.iter()
|
||||
.filter_map(|attr| {
|
||||
if attr.is_sugared_doc || attr.style != syn::AttrStyle::Outer {
|
||||
return None;
|
||||
}
|
||||
|
||||
if let Some(syn::Meta::List(syn::MetaList { ident, nested, .. })) =
|
||||
attr.interpret_meta()
|
||||
if let syn::Meta::List(syn::MetaList { ident, nested, .. }) =
|
||||
attr.interpret_meta()?
|
||||
{
|
||||
if ident == "repr" {
|
||||
return Some(nested.into_iter().collect::<Vec<_>>());
|
||||
|
||||
@@ -342,10 +342,6 @@ impl Parser {
|
||||
// Last chance to find a module path
|
||||
let mut path_attr_found = false;
|
||||
for attr in &item.attrs {
|
||||
if attr.is_sugared_doc {
|
||||
continue;
|
||||
}
|
||||
|
||||
match attr.interpret_meta() {
|
||||
Some(syn::Meta::NameValue(syn::MetaNameValue {
|
||||
ident,
|
||||
|
||||
+21
-17
@@ -65,23 +65,25 @@ pub trait SynItemHelpers {
|
||||
|
||||
macro_rules! syn_item_match_helper {
|
||||
($s:ident => has_attrs: |$i:ident| $a:block, otherwise: || $b:block) => {
|
||||
match $s {
|
||||
&syn::Item::Const(ref item) => (|$i: &syn::ItemConst| $a)(item),
|
||||
&syn::Item::Enum(ref item) => (|$i: &syn::ItemEnum| $a)(item),
|
||||
&syn::Item::ExternCrate(ref item) => (|$i: &syn::ItemExternCrate| $a)(item),
|
||||
&syn::Item::Fn(ref item) => (|$i: &syn::ItemFn| $a)(item),
|
||||
&syn::Item::ForeignMod(ref item) => (|$i: &syn::ItemForeignMod| $a)(item),
|
||||
&syn::Item::Impl(ref item) => (|$i: &syn::ItemImpl| $a)(item),
|
||||
&syn::Item::Macro(ref item) => (|$i: &syn::ItemMacro| $a)(item),
|
||||
&syn::Item::Macro2(ref item) => (|$i: &syn::ItemMacro2| $a)(item),
|
||||
&syn::Item::Mod(ref item) => (|$i: &syn::ItemMod| $a)(item),
|
||||
&syn::Item::Static(ref item) => (|$i: &syn::ItemStatic| $a)(item),
|
||||
&syn::Item::Struct(ref item) => (|$i: &syn::ItemStruct| $a)(item),
|
||||
&syn::Item::Trait(ref item) => (|$i: &syn::ItemTrait| $a)(item),
|
||||
&syn::Item::Type(ref item) => (|$i: &syn::ItemType| $a)(item),
|
||||
&syn::Item::Union(ref item) => (|$i: &syn::ItemUnion| $a)(item),
|
||||
&syn::Item::Use(ref item) => (|$i: &syn::ItemUse| $a)(item),
|
||||
&syn::Item::Verbatim(_) => (|| $b)(),
|
||||
match *$s {
|
||||
syn::Item::Const(ref item) => (|$i: &syn::ItemConst| $a)(item),
|
||||
syn::Item::Enum(ref item) => (|$i: &syn::ItemEnum| $a)(item),
|
||||
syn::Item::ExternCrate(ref item) => (|$i: &syn::ItemExternCrate| $a)(item),
|
||||
syn::Item::Fn(ref item) => (|$i: &syn::ItemFn| $a)(item),
|
||||
syn::Item::ForeignMod(ref item) => (|$i: &syn::ItemForeignMod| $a)(item),
|
||||
syn::Item::Impl(ref item) => (|$i: &syn::ItemImpl| $a)(item),
|
||||
syn::Item::Macro(ref item) => (|$i: &syn::ItemMacro| $a)(item),
|
||||
syn::Item::Macro2(ref item) => (|$i: &syn::ItemMacro2| $a)(item),
|
||||
syn::Item::Mod(ref item) => (|$i: &syn::ItemMod| $a)(item),
|
||||
syn::Item::Static(ref item) => (|$i: &syn::ItemStatic| $a)(item),
|
||||
syn::Item::Struct(ref item) => (|$i: &syn::ItemStruct| $a)(item),
|
||||
syn::Item::Trait(ref item) => (|$i: &syn::ItemTrait| $a)(item),
|
||||
syn::Item::Type(ref item) => (|$i: &syn::ItemType| $a)(item),
|
||||
syn::Item::Union(ref item) => (|$i: &syn::ItemUnion| $a)(item),
|
||||
syn::Item::Use(ref item) => (|$i: &syn::ItemUse| $a)(item),
|
||||
syn::Item::Existential(ref item) => (|$i: &syn::ItemExistential| $a)(item),
|
||||
syn::Item::TraitAlias(ref item) => (|$i: &syn::ItemTraitAlias| $a)(item),
|
||||
syn::Item::Verbatim(_) => (|| $b)(),
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -189,6 +191,8 @@ impl_syn_item_helper!(syn::ItemTrait);
|
||||
impl_syn_item_helper!(syn::ItemImpl);
|
||||
impl_syn_item_helper!(syn::ItemMacro);
|
||||
impl_syn_item_helper!(syn::ItemMacro2);
|
||||
impl_syn_item_helper!(syn::ItemExistential);
|
||||
impl_syn_item_helper!(syn::ItemTraitAlias);
|
||||
|
||||
impl SynItemHelpers for syn::ItemVerbatim {
|
||||
fn has_attr_word(&self, _name: &str) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user