public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rust-cssparser-macros] epel10: Bump syn to 0.12, quote to 0.4
@ 2026-06-15 14:13 Igor Gnatenko
0 siblings, 0 replies; only message in thread
From: Igor Gnatenko @ 2026-06-15 14:13 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rust-cssparser-macros
Branch : epel10
Commit : 83cef6dda09cc49c894902f8e0a1cb9c7711239d
Author : Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date : 2018-03-09T13:32:07+01:00
Stats : +127/-8 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/rust-cssparser-macros/c/83cef6dda09cc49c894902f8e0a1cb9c7711239d?branch=epel10
Log:
Bump syn to 0.12, quote to 0.4
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
---
diff --git a/0001-Update-syn-to-0.12-and-quote-to-0.4.patch b/0001-Update-syn-to-0.12-and-quote-to-0.4.patch
new file mode 100644
index 0000000..5b60d20
--- /dev/null
+++ b/0001-Update-syn-to-0.12-and-quote-to-0.4.patch
@@ -0,0 +1,108 @@
+From bcf7f831a07336b7779f16a917e714f758f29aa7 Mon Sep 17 00:00:00 2001
+From: Bastien Orivel <eijebong@bananium.fr>
+Date: Thu, 11 Jan 2018 13:38:20 +0100
+Subject: [PATCH] Update syn to 0.12 and quote to 0.4
+
+(cherry picked from commit a244c3c36194a90e8081a1a89bf424a3cc70294d)
+---
+ macros/lib.rs | 39 ++++++++++++++++++++-------------------
+ 1 file changed, 20 insertions(+), 19 deletions(-)
+
+diff --git a/macros/lib.rs b/macros/lib.rs
+index 80d3e54..253616d 100644
+--- a/macros/lib.rs
++++ b/macros/lib.rs
+@@ -5,10 +5,13 @@
+ #[macro_use] extern crate procedural_masquerade;
+ extern crate phf_codegen;
+ extern crate proc_macro;
++extern crate proc_macro2;
+ #[macro_use] extern crate quote;
+ extern crate syn;
+
+-use std::ascii::AsciiExt;
++#[allow(unused_imports)] use std::ascii::AsciiExt;
++use quote::ToTokens;
++use proc_macro2::{TokenNode, TokenStream, TokenTree};
+
+ define_proc_macros! {
+ /// Input: the arms of a `match` expression.
+@@ -19,22 +22,22 @@ define_proc_macros! {
+ /// or string patterns that contains ASCII uppercase letters.
+ #[allow(non_snake_case)]
+ pub fn cssparser_internal__assert_ascii_lowercase__max_len(input: &str) -> String {
+- let expr = syn::parse_expr(&format!("match x {{ {} }}", input)).unwrap();
++ let expr = syn::parse_str(&format!("match x {{ {} }}", input)).unwrap();
+ let arms = match expr {
+- syn::Expr { node: syn::ExprKind::Match(_, ref arms), .. } => arms,
++ syn::Expr::Match(syn::ExprMatch { ref arms, .. }) => arms,
+ _ => panic!("expected a match expression, got {:?}", expr)
+ };
+ max_len(arms.iter().flat_map(|arm| &arm.pats).filter_map(|pattern| {
+ let expr = match *pattern {
+ syn::Pat::Lit(ref expr) => expr,
+- syn::Pat::Wild => return None,
++ syn::Pat::Wild(_) => return None,
+ _ => panic!("expected string or wildcard pattern, got {:?}", pattern)
+ };
+- match **expr {
+- syn::Expr { node: syn::ExprKind::Lit(syn::Lit::Str(ref string, _)), .. } => {
+- assert_eq!(*string, string.to_ascii_lowercase(),
++ match *expr.expr {
++ syn::Expr::Lit(syn::ExprLit { lit: syn::Lit::Str(ref lit), .. }) => {
++ assert_eq!(lit.value(), lit.value().to_ascii_lowercase(),
+ "string patterns must be given in ASCII lowercase");
+- Some(string.len())
++ Some(lit.value().len())
+ }
+ _ => panic!("expected string pattern, got {:?}", expr)
+ }
+@@ -46,7 +49,7 @@ define_proc_macros! {
+ /// Output: a `MAX_LENGTH` constant with the length of the longest string.
+ #[allow(non_snake_case)]
+ pub fn cssparser_internal__max_len(input: &str) -> String {
+- max_len(syn::parse_token_trees(input).unwrap().iter().map(|tt| string_literal(tt).len()))
++ max_len(syn::parse_str::<TokenStream>(input).unwrap().into_iter().map(|tt| string_literal(&tt).len()))
+ }
+
+ /// Input: parsed as token trees. The first TT is a type. (Can be wrapped in parens.)
+@@ -59,7 +62,7 @@ define_proc_macros! {
+ /// ```
+ #[allow(non_snake_case)]
+ pub fn cssparser_internal__phf_map(input: &str) -> String {
+- let token_trees = syn::parse_token_trees(input).unwrap();
++ let token_trees: Vec<TokenTree> = syn::parse_str::<TokenStream>(input).unwrap().into_iter().collect();
+ let value_type = &token_trees[0];
+ let pairs: Vec<_> = token_trees[1..].chunks(2).map(|chunk| {
+ let key = string_literal(&chunk[0]);
+@@ -78,20 +81,18 @@ define_proc_macros! {
+ };
+ let mut initializer_bytes = Vec::new();
+ map.build(&mut initializer_bytes).unwrap();
+- tokens.append(::std::str::from_utf8(&initializer_bytes).unwrap());
+- tokens.append(";");
+- tokens.into_string()
++ tokens.append_all(syn::parse_str::<syn::Expr>(::std::str::from_utf8(&initializer_bytes).unwrap()));
++ tokens.append_all(quote!(;));
++ tokens.to_string()
+ }
+ }
+
+ fn max_len<I: Iterator<Item=usize>>(lengths: I) -> String {
+ let max_length = lengths.max().expect("expected at least one string");
+- quote!( const MAX_LENGTH: usize = #max_length; ).into_string()
++ quote!( const MAX_LENGTH: usize = #max_length; ).to_string()
+ }
+
+-fn string_literal(token: &syn::TokenTree) -> &str {
+- match *token {
+- syn::TokenTree::Token(syn::Token::Literal(syn::Lit::Str(ref string, _))) => string,
+- _ => panic!("expected string literal, got {:?}", token)
+- }
++fn string_literal(token: &TokenTree) -> String {
++ let lit: syn::LitStr = syn::parse2(token.clone().into()).expect(&format!("expected string literal, got {:?}", token));
++ lit.value()
+ }
+--
+2.16.2
+
diff --git a/cssparser-macros-0.3.0-fix-metadata.diff b/cssparser-macros-0.3.0-fix-metadata.diff
index db00ba7..433e348 100644
--- a/cssparser-macros-0.3.0-fix-metadata.diff
+++ b/cssparser-macros-0.3.0-fix-metadata.diff
@@ -1,11 +1,14 @@
--- cssparser-macros-0.3.0/Cargo.toml 2017-04-24T12:29:55+02:00
-+++ cssparser-macros-0.3.0/Cargo.toml 2018-01-24T15:11:02.054945+01:00
-@@ -12,7 +12,7 @@
++++ cssparser-macros-0.3.0/Cargo.toml 2018-03-09T13:25:22.141436+01:00
+@@ -12,7 +12,8 @@
proc-macro = true
[dependencies]
-procedural-masquerade = {path = "../procedural-masquerade", version = "0.1"}
+procedural-masquerade = "0.1"
phf_codegen = "0.7"
- quote = "0.3.14"
- syn = {version = "0.11.8", features = ["full"]}
+-quote = "0.3.14"
+-syn = {version = "0.11.8", features = ["full"]}
++quote = "0.4"
++syn = {version = "0.12", features = ["full"]}
++proc-macro2 = "0.2"
diff --git a/rust-cssparser-macros.spec b/rust-cssparser-macros.spec
index 2b34c05..8a28bfe 100644
--- a/rust-cssparser-macros.spec
+++ b/rust-cssparser-macros.spec
@@ -6,7 +6,7 @@
Name: rust-%{crate}
Version: 0.3.0
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Procedural macros for cssparser
# https://github.com/servo/rust-cssparser/pull/201
@@ -15,16 +15,19 @@ URL: https://crates.io/crates/cssparser-macros
Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate
# Initial patched metadata
# * No paths
+# * Bump syn to 0.12, quote to 0.4, https://github.com/servo/rust-cssparser/commit/a244c3c36194a90e8081a1a89bf424a3cc70294d
Patch0: cssparser-macros-0.3.0-fix-metadata.diff
+Patch1: 0001-Update-syn-to-0.12-and-quote-to-0.4.patch
ExclusiveArch: %{rust_arches}
BuildRequires: rust-packaging
# [dependencies]
BuildRequires: (crate(phf_codegen) >= 0.7.0 with crate(phf_codegen) < 0.8.0)
+BuildRequires: (crate(proc-macro2) >= 0.2.0 with crate(proc-macro2) < 0.3.0)
BuildRequires: (crate(procedural-masquerade) >= 0.1.0 with crate(procedural-masquerade) < 0.2.0)
-BuildRequires: (crate(quote) >= 0.3.14 with crate(quote) < 0.4.0)
-BuildRequires: ((crate(syn) >= 0.11.8 with crate(syn) < 0.12.0) with crate(syn/full))
+BuildRequires: (crate(quote) >= 0.4.0 with crate(quote) < 0.5.0)
+BuildRequires: ((crate(syn) >= 0.12.0 with crate(syn) < 0.13.0) with crate(syn/full))
%description
%{summary}.
@@ -40,7 +43,9 @@ This package contains library source intended for building other packages
which use %{crate} from crates.io.
%prep
-%autosetup -n %{crate}-%{version} -p1
+%autosetup -n %{crate}-%{version} -N
+%patch0 -p1
+%patch1 -p2
%cargo_prep
%build
@@ -58,6 +63,9 @@ which use %{crate} from crates.io.
%{cargo_registry}/%{crate}-%{version}/
%changelog
+* Fri Mar 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.3.0-3
+- Bump syn to 0.12, quote to 0.4
+
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-15 14:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-15 14:13 [rpms/rust-cssparser-macros] epel10: Bump syn to 0.12, quote to 0.4 Igor Gnatenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox