Bump syn to 0.12

epel9
Josh Stone 7 years ago
parent ae6ce1e51d
commit 82de2d267f

@ -0,0 +1,74 @@
From c32fcc0fe29a952829757b7936b222f390d39d38 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Thu, 8 Mar 2018 20:34:22 -0800
Subject: [PATCH] Update to syn 0.12
---
Cargo.toml | 2 +-
src/lib.rs | 28 +++++++++++++++-------------
2 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/src/lib.rs b/src/lib.rs
index 09d41e58eae4..4e98771e8627 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -398,17 +398,19 @@ pub fn check_html_root_url(path: &str, pkg_name: &str, pkg_version: &str) -> Res
.map_err(|err| format!("could not read {}: {}", path, err))?;
let version = parse_version(pkg_version)
.map_err(|err| format!("bad package version {:?}: {}", pkg_version, err))?;
- let krate = syn::parse_crate(&code)
+ let krate: syn::File = syn::parse_str(&code)
.map_err(|_| format!("could not parse {}: please run \"cargo build\"", path))?;
println!("Checking doc attributes in {}...", path);
for attr in krate.attrs {
- let (ident, nested_meta_items) = match attr {
- syn::Attribute {
- style: syn::AttrStyle::Inner,
- value: syn::MetaItem::List(ref ident, ref nested_meta_items),
- is_sugared_doc: false,
- } => (ident, nested_meta_items),
+ if let syn::AttrStyle::Outer = attr.style {
+ continue;
+ }
+ if attr.is_sugared_doc {
+ continue;
+ }
+ let (ident, nested_meta_items) = match attr.interpret_meta() {
+ Some(syn::Meta::List(syn::MetaList { ident, nested, .. })) => (ident, nested),
_ => continue,
};
@@ -417,23 +419,23 @@ pub fn check_html_root_url(path: &str, pkg_name: &str, pkg_version: &str) -> Res
}
for nested_meta_item in nested_meta_items {
- let meta_item = match *nested_meta_item {
- syn::NestedMetaItem::MetaItem(ref meta_item) => meta_item,
+ let meta_item = match nested_meta_item {
+ syn::NestedMeta::Meta(ref meta_item) => meta_item,
_ => continue,
};
let check_result = match *meta_item {
- syn::MetaItem::NameValue(ref name, ref value) if name == "html_root_url" => {
- match *value {
+ syn::Meta::NameValue(syn::MetaNameValue { ref ident, ref lit, .. }) if ident == "html_root_url" => {
+ match *lit {
// Accept both cooked and raw strings here.
- syn::Lit::Str(ref s, _) => url_matches(s, pkg_name, &version),
+ syn::Lit::Str(ref s) => url_matches(&s.value(), pkg_name, &version),
// A non-string html_root_url is probably an
// error, but we leave this check to the
// compiler.
_ => continue,
}
}
- syn::MetaItem::Word(ref name) if name == "html_root_url" => {
+ syn::Meta::Word(ref name) if name == "html_root_url" => {
Err(String::from("html_root_url attribute without URL"))
}
_ => continue,
--
2.14.3

@ -6,12 +6,17 @@
Name: rust-%{crate} Name: rust-%{crate}
Version: 0.5.0 Version: 0.5.0
Release: 3%{?dist} Release: 4%{?dist}
Summary: Simple crate for ensuring that version numbers in README files are updated Summary: Simple crate for ensuring that version numbers in README files are updated
License: MIT License: MIT
URL: https://crates.io/crates/version-sync URL: https://crates.io/crates/version-sync
Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate
# Initial patched metadata
Patch0: version-sync-0.5.0-fix-metadata.diff
# https://github.com/mgeisler/version-sync/pull/35
Patch1: 0001-Update-to-syn-0.12.patch
ExclusiveArch: %{rust_arches} ExclusiveArch: %{rust_arches}
@ -20,7 +25,7 @@ BuildRequires: rust-packaging
BuildRequires: (crate(itertools) >= 0.7.0 with crate(itertools) < 0.8.0) BuildRequires: (crate(itertools) >= 0.7.0 with crate(itertools) < 0.8.0)
BuildRequires: (crate(pulldown-cmark) >= 0.1.0 with crate(pulldown-cmark) < 0.2.0) BuildRequires: (crate(pulldown-cmark) >= 0.1.0 with crate(pulldown-cmark) < 0.2.0)
BuildRequires: (crate(semver-parser) >= 0.7.0 with crate(semver-parser) < 0.8.0) BuildRequires: (crate(semver-parser) >= 0.7.0 with crate(semver-parser) < 0.8.0)
BuildRequires: ((crate(syn) >= 0.11.0 with crate(syn) < 0.12.0) with crate(syn/full)) BuildRequires: ((crate(syn) >= 0.12.0 with crate(syn) < 0.13.0) with crate(syn/full))
BuildRequires: (crate(toml) >= 0.4.0 with crate(toml) < 0.5.0) BuildRequires: (crate(toml) >= 0.4.0 with crate(toml) < 0.5.0)
BuildRequires: (crate(url) >= 1.5.1 with crate(url) < 2.0.0) BuildRequires: (crate(url) >= 1.5.1 with crate(url) < 2.0.0)
@ -59,6 +64,9 @@ which use %{crate} from crates.io.
%{cargo_registry}/%{crate}-%{version}/ %{cargo_registry}/%{crate}-%{version}/
%changelog %changelog
* Thu Mar 08 2018 Josh Stone <jistone@redhat.com> - 0.5.0-4
- Bump syn to 0.12
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-3 * Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

@ -0,0 +1,11 @@
--- version-sync-0.5.0/Cargo.toml 1969-12-31T16:00:00-08:00
+++ version-sync-0.5.0/Cargo.toml 2018-03-08T20:49:53.515269-08:00
@@ -33,7 +33,7 @@
version = "0.7"
[dependencies.syn]
-version = "0.11"
+version = "0.12"
features = ["full"]
[dependencies.toml]
Loading…
Cancel
Save