From: Mike Hommey Date: Wed, 9 Mar 2022 07:21:56 +0900 Subject: Relax MSRV to 1.56.0 --- Cargo.lock | 2 ++ config/makefiles/rust.mk | 2 +- python/mozboot/mozboot/util.py | 2 +- servo/components/style/Cargo.toml | 1 + servo/components/style/build.rs | 4 ++++ servo/components/style/lib.rs | 1 + servo/components/style/stylesheets/page_rule.rs | 2 +- servo/components/style/stylist.rs | 2 +- third_party/rust/audioipc2-client/.cargo-checksum.json | 2 +- third_party/rust/audioipc2-client/Cargo.toml | 3 +++ third_party/rust/audioipc2-client/build.rs | 7 +++++++ third_party/rust/audioipc2-client/src/lib.rs | 1 + third_party/rust/wgpu-hal/.cargo-checksum.json | 2 +- third_party/rust/wgpu-hal/src/gles/egl.rs | 6 ++++-- 14 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 third_party/rust/audioipc2-client/build.rs diff --git a/Cargo.lock b/Cargo.lock index c90fafe..91370ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -297,6 +297,7 @@ dependencies = [ "audioipc2", "cubeb-backend", "log", + "rustc_version", ] [[package]] @@ -4874,6 +4875,7 @@ dependencies = [ "precomputed-hash", "rayon", "regex", + "rustc_version", "selectors", "serde", "servo_arc", diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk index ce3652d..c8a966b 100644 --- a/config/makefiles/rust.mk +++ b/config/makefiles/rust.mk @@ -240,7 +240,7 @@ endif endif ifndef RUSTC_BOOTSTRAP -RUSTC_BOOTSTRAP := mozglue_static,qcms +RUSTC_BOOTSTRAP := mozglue_static,qcms,style,audioipc2_client ifdef MOZ_RUST_SIMD RUSTC_BOOTSTRAP := $(RUSTC_BOOTSTRAP),encoding_rs,packed_simd endif diff --git a/python/mozboot/mozboot/util.py b/python/mozboot/mozboot/util.py index 484ff52..b3990f6 100644 --- a/python/mozboot/mozboot/util.py +++ b/python/mozboot/mozboot/util.py @@ -12,7 +12,7 @@ from mach.site import PythonVirtualenv from mach.util import get_state_dir -MINIMUM_RUST_VERSION = "1.57.0" +MINIMUM_RUST_VERSION = "1.56.0" def get_tools_dir(srcdir=False): diff --git a/servo/components/style/Cargo.toml b/servo/components/style/Cargo.toml index 7e8a285..4c51e66 100644 --- a/servo/components/style/Cargo.toml +++ b/servo/components/style/Cargo.toml @@ -85,3 +85,4 @@ regex = {version = "1.0", optional = true, default-features = false, features = walkdir = "2.1.4" toml = {version = "0.4.5", optional = true, default-features = false} mozbuild = {version = "0.1", optional = true} +rustc_version = "0.2" diff --git a/servo/components/style/build.rs b/servo/components/style/build.rs index 2247e87..51e0a84 100644 --- a/servo/components/style/build.rs +++ b/servo/components/style/build.rs @@ -8,6 +8,7 @@ extern crate lazy_static; use std::env; use std::path::Path; use std::process::{exit, Command}; +use rustc_version::{version, Version}; use walkdir::WalkDir; #[cfg(feature = "gecko")] @@ -88,4 +89,7 @@ fn main() { println!("cargo:out_dir={}", env::var("OUT_DIR").unwrap()); generate_properties(engine); build_gecko::generate(); + if version().unwrap() < Version::parse("1.57.0-alpha").unwrap() { + println!("cargo:rustc-cfg=try_reserve"); + } } diff --git a/servo/components/style/lib.rs b/servo/components/style/lib.rs index 9ea9188..f4ffaf8 100644 --- a/servo/components/style/lib.rs +++ b/servo/components/style/lib.rs @@ -24,6 +24,7 @@ //! [selectors]: ../selectors/index.html #![deny(missing_docs)] +#![cfg_attr(try_reserve, feature(try_reserve))] #[macro_use] extern crate bitflags; diff --git a/servo/components/style/stylesheets/page_rule.rs b/servo/components/style/stylesheets/page_rule.rs index ee156cf..7048ea0 100644 --- a/servo/components/style/stylesheets/page_rule.rs +++ b/servo/components/style/stylesheets/page_rule.rs @@ -32,7 +32,7 @@ impl PageSelector { /// This does not currently take pseudo selectors into account. #[inline] pub fn ident_matches(&self, other: &CustomIdent) -> bool { - self.0.0 == other.0 + (self.0).0 == other.0 } } diff --git a/servo/components/style/stylist.rs b/servo/components/style/stylist.rs index 9d5e38d..c72d46f 100644 --- a/servo/components/style/stylist.rs +++ b/servo/components/style/stylist.rs @@ -1747,7 +1747,7 @@ impl ExtraStyleData { // TODO: Handle pseudo-classes self.pages.named.try_reserve(page_rule.selectors.0.len())?; for name in page_rule.selectors.as_slice() { - let vec = self.pages.named.entry(name.0.0.clone()).or_default(); + let vec = self.pages.named.entry((name.0).0.clone()).or_default(); vec.try_reserve(1)?; vec.push(PageRuleData{layer, rule: rule.clone()}); } diff --git a/third_party/rust/audioipc2-client/.cargo-checksum.json b/third_party/rust/audioipc2-client/.cargo-checksum.json index 85789ad..3365cd7 100644 --- a/third_party/rust/audioipc2-client/.cargo-checksum.json +++ b/third_party/rust/audioipc2-client/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"4304d6695b5ae83a67ec50eeb7c8b05f0292b31bf6d93bfec629492116cb05fd","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/context.rs":"060680f87d406cef1f6f94cfae991ae59b5f3a13253e15481716a1a4224682ee","src/lib.rs":"c4a6797734489280f6b97dd72c9e51a7bd7be4104592eece3929e29d45cbca4a","src/send_recv.rs":"450bdb1d8a346634c0237f2081b424d11e2c19ad81670009303f8a03b3bfb196","src/stream.rs":"8f2f33b75b78fb1ef8ebb7b14bbb81dbb0f046f9e91b6110a3c49e424690bb8b"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"fcf7b1d8c3f72ecac29ebe859e7ea5e216168aad149fad0284a81015bd88c329","build.rs":"91de386f621a91eb125484980f352d52549826c27d1ddff53ce6e3835c79e61d","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/context.rs":"060680f87d406cef1f6f94cfae991ae59b5f3a13253e15481716a1a4224682ee","src/lib.rs":"78c7060e55536cbff4681a300e73c7fa0ff52953caa668c84035d2e975b6871d","src/send_recv.rs":"450bdb1d8a346634c0237f2081b424d11e2c19ad81670009303f8a03b3bfb196","src/stream.rs":"8f2f33b75b78fb1ef8ebb7b14bbb81dbb0f046f9e91b6110a3c49e424690bb8b"},"package":null} diff --git a/third_party/rust/audioipc2-client/Cargo.toml b/third_party/rust/audioipc2-client/Cargo.toml index 94afedb..b0a63ea 100644 --- a/third_party/rust/audioipc2-client/Cargo.toml +++ b/third_party/rust/audioipc2-client/Cargo.toml @@ -14,3 +14,6 @@ audio_thread_priority = "0.23.4" audioipc = { package = "audioipc2", path="../audioipc" } cubeb-backend = "0.9" log = "0.4" + +[build-dependencies] +rustc_version = "0.2" diff --git a/third_party/rust/audioipc2-client/build.rs b/third_party/rust/audioipc2-client/build.rs new file mode 100644 index 0000000..ad093ae --- /dev/null +++ b/third_party/rust/audioipc2-client/build.rs @@ -0,0 +1,7 @@ +use rustc_version::{version, Version}; + +fn main() { + if version().unwrap() < Version::parse("1.57.0-alpha").unwrap() { + println!("cargo:rustc-cfg=try_reserve"); + } +} diff --git a/third_party/rust/audioipc2-client/src/lib.rs b/third_party/rust/audioipc2-client/src/lib.rs index 51a68af..75013d2 100644 --- a/third_party/rust/audioipc2-client/src/lib.rs +++ b/third_party/rust/audioipc2-client/src/lib.rs @@ -3,6 +3,7 @@ // This program is made available under an ISC-style license. See the // accompanying file LICENSE for details. #![warn(unused_extern_crates)] +#![cfg_attr(try_reserve, feature(try_reserve))] #[macro_use] extern crate log; diff --git a/third_party/rust/wgpu-hal/.cargo-checksum.json b/third_party/rust/wgpu-hal/.cargo-checksum.json index 43f4b8c..15f46e6 100644 --- a/third_party/rust/wgpu-hal/.cargo-checksum.json +++ b/third_party/rust/wgpu-hal/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"3862315ca7f4457023d24cc734caf97344767b109b6aff70bf521842f23e057a","README.md":"78377f5876fafd77963eff7e3c2ba3a7e3ad5cf9201b09ed5612e49c2288eb18","examples/halmark/main.rs":"9985c489565558c44023c2e0939c6f23f73840d336ebc552063277a85ea5136f","examples/halmark/shader.wgsl":"d63ba820574d2809b8a5d16342fddbede5dd0ff0024b3448c947fb7da896dd8d","examples/raw-gles.rs":"e1a47d82b58eef8a74fee37f9e2d190bf33ed764818af532c31fe2ffd160d070","src/auxil/mod.rs":"80e81fb7421f29553922fe67f16859cb5a3e2e199413f10a87e58253bb4fe6f6","src/auxil/renderdoc.rs":"3a4da908ebd6230177ca55c541c8278639e83d78badb4595a941aea30dd7f80f","src/dx12/adapter.rs":"7ce0b5398973584df4a314627c9958cfd120e31533c222a7a81e9e643552c27f","src/dx12/command.rs":"f8b84a576a5f2eea82d5c001ea1a7d4552f9fc7a7d0bc496a096ac3ffee2ff14","src/dx12/conv.rs":"7dfa5fb67b11acd2ffcee400b7e737aa1b08ee1f22d93d9fffaab5f275efee44","src/dx12/descriptor.rs":"c0108edad4a7a8c77d52c6172844d4310820edb400e351c843d56aab997a5dc2","src/dx12/device.rs":"fed1f2286c153998448bf07c423f320eade15d7dbce0a1d1d719f822bebd2936","src/dx12/instance.rs":"e93de85ddf6772ca366e02b7d0b4ee4d619164fd4700df4a389515f4f4500ebc","src/dx12/mod.rs":"b11a6b29ecb9dce95ffeb0b65d69d0af0a6adb1437faf0f561c82010ca6306c9","src/dx12/view.rs":"7449d7459e39178491e76812f154ef2895f8137e944c1c821c0d441fdb173cae","src/empty.rs":"6bf65e405f63eff49b25d079af644b352b95a9c7edcf3a57be2e96a50307b66b","src/gles/adapter.rs":"854215a4a93eacb8f15bb4e905de6cf6d064b5e4773cc48f64f0acb0c1c50811","src/gles/command.rs":"557effbdf8a885fec118e926f1e322253b4e4f417d4f7efbc300f7b75580e0f5","src/gles/conv.rs":"ec87ddf4b509a394f5faaacdae2e2eb119f100585f5850e4f52ccb8687e67452","src/gles/device.rs":"6ff31ffe2f5266c73f3de787ca06da8347ae19ec178792cd215b844cc309eaf9","src/gles/egl.rs":"0d8993a0d722063042ee9fa83a4de868e91689f1ce8c8aec47e538a6c0f38553","src/gles/mod.rs":"714ce10a4929a3f0d9a32bb0bbbfbe87a3b3162a8532b2cd79f228d32b958dd1","src/gles/queue.rs":"fea36dc55becee4493cea6b554e8d7a8ffe946201eb21c563e7dc4bcacab3bcd","src/gles/shaders/clear.frag":"aac702eed9ece5482db5ba6783a678b119a5e7802b1ecf93f4975dee8acab0b3","src/gles/shaders/clear.vert":"8f636168e1da2cac48091c466a543c3b09fb4a0dd8c60c1c9bf34cc890766740","src/gles/shaders/present.frag":"dd9a43c339a2fa4ccf7f6a1854c6f400cabf271a7d5e9230768e9f39d47f3ff5","src/gles/shaders/present.vert":"6e85d489403d80b81cc94790730bb53b309dfc5eeede8f1ea3412a660f31d357","src/gles/web.rs":"083500c0b36d079a82754895d06b993ea8ed4393690b226c85f07cbec373a730","src/lib.rs":"354670f72b69e3c6b704b9668dab681032d48ff2a650be3c07807d803582900c","src/metal/adapter.rs":"daae4f4c8097dd2fa4c915b1521457e38d9f143e468c45daba5b124f06608359","src/metal/command.rs":"233e646076d94b5d2b109f254ba129b8dcc30f683b30178a66d59bd7e2a25b78","src/metal/conv.rs":"0f8065cbe54b499476381fd93002a377d6ae756d63d5d8dacb18fe292dfa30eb","src/metal/device.rs":"b0dc77b3567b4d456118d7428a0594f0ace5c1a3bb75cee9b24a61645feae0ba","src/metal/mod.rs":"29092cc039a844611b6e6755e735ec232a947c25531fb3c185a4a9422891e6af","src/metal/surface.rs":"74f81d37f0f1362603c26fd085ad2821f82810e2b5c5f816a6c1e83c5295d47b","src/vulkan/adapter.rs":"627d67199a49ebffa8e183cb68b61ee8646418ac0f81e8634acccddccc8c0ac4","src/vulkan/command.rs":"60d1867acd0e46c34dabecea708cd776a1f435721b6673a506b5bb8aee87ff80","src/vulkan/conv.rs":"241764384cb35a7fbd453923fc0e968909689e4698e69ff61df87d2aa6cf37cb","src/vulkan/device.rs":"a88d85962e1d819b903a4b6f1b2e2822ecf770d05fa5a16673e87b77fbadc38f","src/vulkan/instance.rs":"b258b87760150feda3e1f23166fd5e6067b0af0c9ed404e0208433b3b10d42bd","src/vulkan/mod.rs":"bb4d3c01a7a75fa167f03123794f747a21e2cbe0ec93fbf473b1d40f9b2c2d42"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"3862315ca7f4457023d24cc734caf97344767b109b6aff70bf521842f23e057a","README.md":"78377f5876fafd77963eff7e3c2ba3a7e3ad5cf9201b09ed5612e49c2288eb18","examples/halmark/main.rs":"9985c489565558c44023c2e0939c6f23f73840d336ebc552063277a85ea5136f","examples/halmark/shader.wgsl":"d63ba820574d2809b8a5d16342fddbede5dd0ff0024b3448c947fb7da896dd8d","examples/raw-gles.rs":"e1a47d82b58eef8a74fee37f9e2d190bf33ed764818af532c31fe2ffd160d070","src/auxil/mod.rs":"80e81fb7421f29553922fe67f16859cb5a3e2e199413f10a87e58253bb4fe6f6","src/auxil/renderdoc.rs":"3a4da908ebd6230177ca55c541c8278639e83d78badb4595a941aea30dd7f80f","src/dx12/adapter.rs":"7ce0b5398973584df4a314627c9958cfd120e31533c222a7a81e9e643552c27f","src/dx12/command.rs":"f8b84a576a5f2eea82d5c001ea1a7d4552f9fc7a7d0bc496a096ac3ffee2ff14","src/dx12/conv.rs":"7dfa5fb67b11acd2ffcee400b7e737aa1b08ee1f22d93d9fffaab5f275efee44","src/dx12/descriptor.rs":"c0108edad4a7a8c77d52c6172844d4310820edb400e351c843d56aab997a5dc2","src/dx12/device.rs":"fed1f2286c153998448bf07c423f320eade15d7dbce0a1d1d719f822bebd2936","src/dx12/instance.rs":"e93de85ddf6772ca366e02b7d0b4ee4d619164fd4700df4a389515f4f4500ebc","src/dx12/mod.rs":"b11a6b29ecb9dce95ffeb0b65d69d0af0a6adb1437faf0f561c82010ca6306c9","src/dx12/view.rs":"7449d7459e39178491e76812f154ef2895f8137e944c1c821c0d441fdb173cae","src/empty.rs":"6bf65e405f63eff49b25d079af644b352b95a9c7edcf3a57be2e96a50307b66b","src/gles/adapter.rs":"854215a4a93eacb8f15bb4e905de6cf6d064b5e4773cc48f64f0acb0c1c50811","src/gles/command.rs":"557effbdf8a885fec118e926f1e322253b4e4f417d4f7efbc300f7b75580e0f5","src/gles/conv.rs":"ec87ddf4b509a394f5faaacdae2e2eb119f100585f5850e4f52ccb8687e67452","src/gles/device.rs":"6ff31ffe2f5266c73f3de787ca06da8347ae19ec178792cd215b844cc309eaf9","src/gles/egl.rs":"2018feea9faca02bc5a897fd0e64489e4491129f139b760651ca795f564ed7ca","src/gles/mod.rs":"714ce10a4929a3f0d9a32bb0bbbfbe87a3b3162a8532b2cd79f228d32b958dd1","src/gles/queue.rs":"fea36dc55becee4493cea6b554e8d7a8ffe946201eb21c563e7dc4bcacab3bcd","src/gles/shaders/clear.frag":"aac702eed9ece5482db5ba6783a678b119a5e7802b1ecf93f4975dee8acab0b3","src/gles/shaders/clear.vert":"8f636168e1da2cac48091c466a543c3b09fb4a0dd8c60c1c9bf34cc890766740","src/gles/shaders/present.frag":"dd9a43c339a2fa4ccf7f6a1854c6f400cabf271a7d5e9230768e9f39d47f3ff5","src/gles/shaders/present.vert":"6e85d489403d80b81cc94790730bb53b309dfc5eeede8f1ea3412a660f31d357","src/gles/web.rs":"083500c0b36d079a82754895d06b993ea8ed4393690b226c85f07cbec373a730","src/lib.rs":"354670f72b69e3c6b704b9668dab681032d48ff2a650be3c07807d803582900c","src/metal/adapter.rs":"daae4f4c8097dd2fa4c915b1521457e38d9f143e468c45daba5b124f06608359","src/metal/command.rs":"233e646076d94b5d2b109f254ba129b8dcc30f683b30178a66d59bd7e2a25b78","src/metal/conv.rs":"0f8065cbe54b499476381fd93002a377d6ae756d63d5d8dacb18fe292dfa30eb","src/metal/device.rs":"b0dc77b3567b4d456118d7428a0594f0ace5c1a3bb75cee9b24a61645feae0ba","src/metal/mod.rs":"29092cc039a844611b6e6755e735ec232a947c25531fb3c185a4a9422891e6af","src/metal/surface.rs":"74f81d37f0f1362603c26fd085ad2821f82810e2b5c5f816a6c1e83c5295d47b","src/vulkan/adapter.rs":"627d67199a49ebffa8e183cb68b61ee8646418ac0f81e8634acccddccc8c0ac4","src/vulkan/command.rs":"60d1867acd0e46c34dabecea708cd776a1f435721b6673a506b5bb8aee87ff80","src/vulkan/conv.rs":"241764384cb35a7fbd453923fc0e968909689e4698e69ff61df87d2aa6cf37cb","src/vulkan/device.rs":"a88d85962e1d819b903a4b6f1b2e2822ecf770d05fa5a16673e87b77fbadc38f","src/vulkan/instance.rs":"b258b87760150feda3e1f23166fd5e6067b0af0c9ed404e0208433b3b10d42bd","src/vulkan/mod.rs":"bb4d3c01a7a75fa167f03123794f747a21e2cbe0ec93fbf473b1d40f9b2c2d42"},"package":null} diff --git a/third_party/rust/wgpu-hal/src/gles/egl.rs b/third_party/rust/wgpu-hal/src/gles/egl.rs index ea49dfb..d3ac0a7 100644 --- a/third_party/rust/wgpu-hal/src/gles/egl.rs +++ b/third_party/rust/wgpu-hal/src/gles/egl.rs @@ -951,14 +951,16 @@ impl crate::Surface for Surface { let (mut temp_xlib_handle, mut temp_xcb_handle); #[allow(trivial_casts)] let native_window_ptr = match (self.wsi.kind, self.raw_window_handle) { - (WindowKind::Unknown | WindowKind::X11, Rwh::Xlib(handle)) => { + (WindowKind::Unknown, Rwh::Xlib(handle)) | + (WindowKind::X11, Rwh::Xlib(handle)) => { temp_xlib_handle = handle.window; &mut temp_xlib_handle as *mut _ as *mut std::ffi::c_void } (WindowKind::AngleX11, Rwh::Xlib(handle)) => { handle.window as *mut std::ffi::c_void } - (WindowKind::Unknown | WindowKind::X11, Rwh::Xcb(handle)) => { + (WindowKind::Unknown, Rwh::Xcb(handle)) | + (WindowKind::X11, Rwh::Xcb(handle)) => { temp_xcb_handle = handle.window; &mut temp_xcb_handle as *mut _ as *mut std::ffi::c_void }