PKGBUILDs/extra/firefox/0004-Bug-1912663-Fix-some-build-issues-with-cbindgen-0.27.patch
2024-08-13 19:18:03 +00:00

80 lines
3.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@crisal.io>
Date: Sun, 11 Aug 2024 15:12:29 +0000
Subject: [PATCH] Bug 1912663 - Fix some build issues with cbindgen 0.27.
r=firefox-style-system-reviewers,zrhoffman
It updates serde and syn and they are more strict. In particular, syn 2
doesn't parse the rust 2015 syntax where try is not a keyword, and serde
rejects duplicate keys.
Differential Revision: https://phabricator.services.mozilla.com/D219025
---
servo/components/style_traits/values.rs | 16 ++++++++--------
servo/ports/geckolib/cbindgen.toml | 1 -
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/servo/components/style_traits/values.rs b/servo/components/style_traits/values.rs
index 545dd317de14..1128eb9b315e 100644
--- a/servo/components/style_traits/values.rs
+++ b/servo/components/style_traits/values.rs
@@ -388,39 +388,39 @@ impl Separator for Space {
where
F: for<'tt> FnMut(&mut Parser<'i, 'tt>) -> Result<T, ParseError<'i, E>>,
{
- input.skip_whitespace(); // Unnecessary for correctness, but may help try() rewind less.
+ input.skip_whitespace(); // Unnecessary for correctness, but may help try_parse() rewind less.
let mut results = vec![parse_one(input)?];
loop {
- input.skip_whitespace(); // Unnecessary for correctness, but may help try() rewind less.
- if let Ok(item) = input.try(&mut parse_one) {
+ input.skip_whitespace(); // Unnecessary for correctness, but may help try_parse() rewind less.
+ if let Ok(item) = input.try_parse(&mut parse_one) {
results.push(item);
} else {
return Ok(results);
}
}
}
}
impl Separator for CommaWithSpace {
fn separator() -> &'static str {
", "
}
fn parse<'i, 't, F, T, E>(
input: &mut Parser<'i, 't>,
mut parse_one: F,
) -> Result<Vec<T>, ParseError<'i, E>>
where
F: for<'tt> FnMut(&mut Parser<'i, 'tt>) -> Result<T, ParseError<'i, E>>,
{
- input.skip_whitespace(); // Unnecessary for correctness, but may help try() rewind less.
+ input.skip_whitespace(); // Unnecessary for correctness, but may help try_parse() rewind less.
let mut results = vec![parse_one(input)?];
loop {
- input.skip_whitespace(); // Unnecessary for correctness, but may help try() rewind less.
+ input.skip_whitespace(); // Unnecessary for correctness, but may help try_parse() rewind less.
let comma_location = input.current_source_location();
- let comma = input.try(|i| i.expect_comma()).is_ok();
- input.skip_whitespace(); // Unnecessary for correctness, but may help try() rewind less.
- if let Ok(item) = input.try(&mut parse_one) {
+ let comma = input.try_parse(|i| i.expect_comma()).is_ok();
+ input.skip_whitespace(); // Unnecessary for correctness, but may help try_parse() rewind less.
+ if let Ok(item) = input.try_parse(&mut parse_one) {
results.push(item);
} else if comma {
return Err(comma_location.new_unexpected_token_error(Token::Comma));
diff --git a/servo/ports/geckolib/cbindgen.toml b/servo/ports/geckolib/cbindgen.toml
index d507293e195d..38ff6504d949 100644
--- a/servo/ports/geckolib/cbindgen.toml
+++ b/servo/ports/geckolib/cbindgen.toml
@@ -360,7 +360,6 @@ renaming_overrides_prefixing = true
"Keyframe" = "Keyframe"
"nsChangeHint" = "nsChangeHint"
"ServoElementSnapshotTable" = "ServoElementSnapshotTable"
-"Keyframe" = "Keyframe"
"ComputedKeyframeValues" = "ComputedKeyframeValues"
"OriginFlags" = "OriginFlags"
"ServoTraversalFlags" = "ServoTraversalFlags"