build: upgrade rustc to 1.81.0 (#34270)

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Mukilan Thiyagarajan 2024-12-12 12:56:16 +05:30 committed by GitHub
parent 26f61103d6
commit 7fcde1f7a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 16 additions and 26 deletions

View file

@ -44,8 +44,6 @@ jobs:
with: with:
crate: cargo-deny crate: cargo-deny
locked: true locked: true
# 0.16.2 requires Rust 1.81 or newer.
version: '0.16.1'
- name: Bootstrap Python - name: Bootstrap Python
run: python3 -m pip install --upgrade pip run: python3 -m pip install --upgrade pip
- name: Bootstrap dependencies - name: Bootstrap dependencies

View file

@ -13,7 +13,7 @@ authors = ["The Servo Project Developers"]
license = "MPL-2.0" license = "MPL-2.0"
edition = "2021" edition = "2021"
publish = false publish = false
rust-version = "1.80.1" rust-version = "1.81.0"
[workspace.dependencies] [workspace.dependencies]
accountable-refcell = "0.2.0" accountable-refcell = "0.2.0"

View file

@ -448,9 +448,8 @@ where
{ {
let mut next = parent.first_child(); let mut next = parent.first_child();
std::iter::from_fn(move || { std::iter::from_fn(move || {
next.map(|child| { next.inspect(|child| {
next = child.next_sibling(); next = child.next_sibling();
child
}) })
}) })
} }

View file

@ -232,13 +232,12 @@ impl InlineFormattingContextBuilder {
let white_space_collapse = info.style.clone_white_space_collapse(); let white_space_collapse = info.style.clone_white_space_collapse();
let new_text: String = char_iterator let new_text: String = char_iterator
.map(|character| { .inspect(|&character| {
self.has_uncollapsible_text_content |= matches!( self.has_uncollapsible_text_content |= matches!(
white_space_collapse, white_space_collapse,
WhiteSpaceCollapse::Preserve | WhiteSpaceCollapse::BreakSpaces WhiteSpaceCollapse::Preserve | WhiteSpaceCollapse::BreakSpaces
) || !character.is_ascii_whitespace() || ) || !character.is_ascii_whitespace() ||
(character == '\n' && white_space_collapse != WhiteSpaceCollapse::Collapse); (character == '\n' && white_space_collapse != WhiteSpaceCollapse::Collapse);
character
}) })
.collect(); .collect();

View file

@ -125,7 +125,7 @@ impl AllPendingLoads {
} }
fn remove(&mut self, key: &LoadKey) -> Option<PendingLoad> { fn remove(&mut self, key: &LoadKey) -> Option<PendingLoad> {
self.loads.remove(key).map(|pending_load| { self.loads.remove(key).inspect(|pending_load| {
self.url_to_load_key self.url_to_load_key
.remove(&( .remove(&(
pending_load.url.clone(), pending_load.url.clone(),
@ -133,7 +133,6 @@ impl AllPendingLoads {
pending_load.cors_setting, pending_load.cors_setting,
)) ))
.unwrap(); .unwrap();
pending_load
}) })
} }

View file

@ -244,9 +244,8 @@ impl StorageManager {
let old_value = data let old_value = data
.get_mut(&origin) .get_mut(&origin)
.and_then(|&mut (ref mut total, ref mut entry)| { .and_then(|&mut (ref mut total, ref mut entry)| {
entry.remove(&name).map(|old| { entry.remove(&name).inspect(|old| {
*total -= name.as_bytes().len() + old.as_bytes().len(); *total -= name.as_bytes().len() + old.as_bytes().len();
old
}) })
}); });
sender.send(old_value).unwrap(); sender.send(old_value).unwrap();

View file

@ -873,11 +873,7 @@ fn run_form_data_algorithm(
mime: &[u8], mime: &[u8],
can_gc: CanGc, can_gc: CanGc,
) -> Fallible<FetchedData> { ) -> Fallible<FetchedData> {
let mime_str = if let Ok(s) = str::from_utf8(mime) { let mime_str = str::from_utf8(mime).unwrap_or_default();
s
} else {
""
};
let mime: Mime = mime_str let mime: Mime = mime_str
.parse() .parse()
.map_err(|_| Error::Type("Inappropriate MIME-type for Body".to_string()))?; .map_err(|_| Error::Type("Inappropriate MIME-type for Body".to_string()))?;

View file

@ -1037,7 +1037,7 @@ impl<T: ClipboardProvider> TextInput<T> {
// https://html.spec.whatwg.org/multipage/#textarea-line-break-normalisation-transformation // https://html.spec.whatwg.org/multipage/#textarea-line-break-normalisation-transformation
content content
.replace("\r\n", "\n") .replace("\r\n", "\n")
.split(|c| c == '\n' || c == '\r') .split(['\n', '\r'])
.map(DOMString::from) .map(DOMString::from)
.collect() .collect()
} else { } else {

View file

@ -31,9 +31,8 @@ pub fn get_default_url(
let mut new_url = None; let mut new_url = None;
let cmdline_url = url_opt.map(|s| s.to_string()).and_then(|url_string| { let cmdline_url = url_opt.map(|s| s.to_string()).and_then(|url_string| {
parse_url_or_filename(cwd.as_ref(), &url_string) parse_url_or_filename(cwd.as_ref(), &url_string)
.map_err(|error| { .inspect_err(|&error| {
log::warn!("URL parsing failed ({:?}).", error); log::warn!("URL parsing failed ({:?}).", error);
error
}) })
.ok() .ok()
}); });

View file

@ -83,8 +83,7 @@ class Base:
return False return False
print(" * Installing cargo-deny...") print(" * Installing cargo-deny...")
# cargo-deny 0.16.2 requires Rust 1.81. if subprocess.call(["cargo", "install", "cargo-deny", "--locked"]) != 0:
if subprocess.call(["cargo", "install", "cargo-deny", "--locked", "--version", "0.16.1"]) != 0:
raise EnvironmentError("Installation of cargo-deny failed.") raise EnvironmentError("Installation of cargo-deny failed.")
return True return True

View file

@ -1,6 +1,6 @@
[toolchain] [toolchain]
# Be sure to update shell.nix and support/crown/rust-toolchain.toml when bumping this! # Be sure to update shell.nix and support/crown/rust-toolchain.toml when bumping this!
channel = "1.80.1" channel = "1.81.0"
components = [ components = [
"clippy", "clippy",

View file

@ -10,7 +10,7 @@ with import (builtins.fetchTarball {
overlays = [ overlays = [
(import (builtins.fetchTarball { (import (builtins.fetchTarball {
# Bumped the channel in rust-toolchain.toml? Bump this commit too! # Bumped the channel in rust-toolchain.toml? Bump this commit too!
url = "https://github.com/oxalica/rust-overlay/archive/65e3dc0fe079fe8df087cd38f1fe6836a0373aad.tar.gz"; url = "https://github.com/oxalica/rust-overlay/archive/0be641045af6d8666c11c2c40e45ffc9667839b5.tar.gz";
})) }))
]; ];
config = { config = {

View file

@ -25,9 +25,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "compiletest_rs" name = "compiletest_rs"
version = "0.11.1" version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71fcc3c0c91b59c137b3cf8073cbc2f72a49b3d5505660ec88f94da3ed4bb1de" checksum = "f150fe9105fcd2a57cad53f0c079a24de65195903ef670990f5909f695eac04c"
dependencies = [ dependencies = [
"diff", "diff",
"filetime", "filetime",

View file

@ -1,5 +1,5 @@
[toolchain] [toolchain]
channel = "1.80.1" channel = "1.81.0"
components = [ components = [
"clippy", "clippy",

View file

@ -35,6 +35,8 @@ fn run_mode(mode: &'static str, bless: bool) {
// Does not work reliably: https://github.com/servo/servo/pull/30508#issuecomment-1834542203 // Does not work reliably: https://github.com/servo/servo/pull/30508#issuecomment-1834542203
//config.link_deps(); //config.link_deps();
config.strict_headers = true; config.strict_headers = true;
// See https://github.com/Manishearth/compiletest-rs/issues/295
config.compile_test_exit_code = Some(101);
compiletest::run_tests(&config); compiletest::run_tests(&config);
} }