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:
crate: cargo-deny
locked: true
# 0.16.2 requires Rust 1.81 or newer.
version: '0.16.1'
- name: Bootstrap Python
run: python3 -m pip install --upgrade pip
- name: Bootstrap dependencies

View file

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

View file

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

View file

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

View file

@ -125,7 +125,7 @@ impl AllPendingLoads {
}
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
.remove(&(
pending_load.url.clone(),
@ -133,7 +133,6 @@ impl AllPendingLoads {
pending_load.cors_setting,
))
.unwrap();
pending_load
})
}

View file

@ -244,9 +244,8 @@ impl StorageManager {
let old_value = data
.get_mut(&origin)
.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();
old
})
});
sender.send(old_value).unwrap();

View file

@ -873,11 +873,7 @@ fn run_form_data_algorithm(
mime: &[u8],
can_gc: CanGc,
) -> Fallible<FetchedData> {
let mime_str = if let Ok(s) = str::from_utf8(mime) {
s
} else {
""
};
let mime_str = str::from_utf8(mime).unwrap_or_default();
let mime: Mime = mime_str
.parse()
.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
content
.replace("\r\n", "\n")
.split(|c| c == '\n' || c == '\r')
.split(['\n', '\r'])
.map(DOMString::from)
.collect()
} else {

View file

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

View file

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

View file

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

View file

@ -10,7 +10,7 @@ with import (builtins.fetchTarball {
overlays = [
(import (builtins.fetchTarball {
# 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 = {

View file

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

View file

@ -1,5 +1,5 @@
[toolchain]
channel = "1.80.1"
channel = "1.81.0"
components = [
"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
//config.link_deps();
config.strict_headers = true;
// See https://github.com/Manishearth/compiletest-rs/issues/295
config.compile_test_exit_code = Some(101);
compiletest::run_tests(&config);
}