diff --git a/.cargo/audit.toml b/.cargo/audit.toml index 0e271c7fbbca..dae666906400 100644 --- a/.cargo/audit.toml +++ b/.cargo/audit.toml @@ -6,8 +6,6 @@ ignore = [ "RUSTSEC-2020-0095", # proc-macro-error is unmaintained "RUSTSEC-2024-0370", - # time crate can't be updated in the repo because of MSRV, users are unaffected - "RUSTSEC-2026-0009", # rand unsoundness, fixed when we remove kuchikiki from deps in v3, currently # remains for semver reasons but is not built in default configuration "RUSTSEC-2026-0097", @@ -21,4 +19,8 @@ ignore = [ "RUSTSEC-2026-0099", # rustls, fixed when updating to apple-codesign 0.28.0 "RUSTSEC-2026-0104", + # quick-xml, need an update in plist + "RUSTSEC-2026-0194", + # quick-xml, need an update in plist + "RUSTSEC-2026-0195", ] diff --git a/.changes/ctor-1.md b/.changes/ctor-1.md new file mode 100644 index 000000000000..c7ad9e6662bc --- /dev/null +++ b/.changes/ctor-1.md @@ -0,0 +1,5 @@ +--- +tauri-utils: patch:deps +--- + +Updated `ctor` crate to `1` diff --git a/.changes/msrv-1.90.md b/.changes/msrv-1.90.md new file mode 100644 index 000000000000..af2f2477a001 --- /dev/null +++ b/.changes/msrv-1.90.md @@ -0,0 +1,16 @@ +--- +"tauri": minor:changes +"tauri-utils": minor:changes +"tauri-runtime": minor:changes +"tauri-runtime-wry": minor:changes +"tauri-codegen": minor:changes +"tauri-macros": minor:changes +"tauri-plugin": minor:changes +"tauri-build": minor:changes +"tauri-cli": minor:changes +"tauri-macos-sign": minor:changes +"tauri-bundler": minor:changes +"tauri-driver": minor:changes +--- + +Set MSRV to 1.90. diff --git a/.github/workflows/test-android.yml b/.github/workflows/test-android.yml index 93b0fcb906b5..5790e5dafcf9 100644 --- a/.github/workflows/test-android.yml +++ b/.github/workflows/test-android.yml @@ -33,8 +33,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: install Rust 1.77.2 - uses: dtolnay/rust-toolchain@1.77.2 + - name: install Rust 1.90 + uses: dtolnay/rust-toolchain@1.90 - name: install Linux dependencies if: matrix.platform == 'ubuntu-latest' diff --git a/.github/workflows/test-cli-rs.yml b/.github/workflows/test-cli-rs.yml index 8b2806a94dae..f7b935827f8f 100644 --- a/.github/workflows/test-cli-rs.yml +++ b/.github/workflows/test-cli-rs.yml @@ -46,7 +46,7 @@ jobs: - uses: actions/checkout@v4 - name: 'Setup Rust' - uses: dtolnay/rust-toolchain@1.77.2 + uses: dtolnay/rust-toolchain@1.90 with: targets: ${{ matrix.platform.target }} diff --git a/.github/workflows/test-core.yml b/.github/workflows/test-core.yml index f291dea1c4f9..3c0507f64a26 100644 --- a/.github/workflows/test-core.yml +++ b/.github/workflows/test-core.yml @@ -39,35 +39,35 @@ jobs: - { target: x86_64-pc-windows-msvc, os: windows-latest, - toolchain: '1.77.2', + toolchain: '1.90', cross: false, command: 'test' } - { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, - toolchain: '1.77.2', + toolchain: '1.90', cross: false, command: 'test' } - { target: aarch64-apple-darwin, os: macos-14, - toolchain: '1.77.2', + toolchain: '1.90', cross: false, command: 'test' } - { target: aarch64-apple-ios, os: macos-latest, - toolchain: '1.77.2', + toolchain: '1.90', cross: false, command: 'build' } - { target: aarch64-linux-android, os: ubuntu-latest, - toolchain: '1.77.2', + toolchain: '1.90', cross: true, command: 'build' } diff --git a/Cargo.lock b/Cargo.lock index c232caed06a2..bc5be8c13b58 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "Inflector" @@ -220,9 +220,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.95" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" [[package]] name = "api" @@ -1656,28 +1656,12 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "ctor" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "352d39c2f7bef1d6ad73db6f5160efcaed66d94ef8c6c573a8410c00bf909a98" -dependencies = [ - "ctor-proc-macro", - "dtor", -] - [[package]] name = "ctor" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01334b89b69ff726750c5ce5073fc8bd860e99aa9a8fc5ca11b04730e3aee97a" -[[package]] -name = "ctor-proc-macro" -version = "0.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52560adf09603e58c9a7ee1fe1dcb95a16927b17c127f0ac02d6e768a0e25bc1" - [[package]] name = "ctr" version = "0.9.2" @@ -1819,12 +1803,11 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.11" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" dependencies = [ - "powerfmt", - "serde", + "serde_core", ] [[package]] @@ -2124,21 +2107,6 @@ dependencies = [ "dtoa", ] -[[package]] -name = "dtor" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1057d6c64987086ff8ed0fd3fbf377a6b7d205cc7715868cd401705f715cbe4" -dependencies = [ - "dtor-proc-macro", -] - -[[package]] -name = "dtor-proc-macro" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5" - [[package]] name = "duct" version = "1.1.1" @@ -4759,7 +4727,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b41bda2ac390efb5e8d22025d925ccc3f3807d8c1bea6d19b36127247c4b8f83" dependencies = [ "bitflags 2.7.0", - "ctor 1.0.7", + "ctor", "futures", "napi-build", "napi-sys", @@ -4780,7 +4748,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61d66f70256ad5aef58659966064471d0ad90e2897bc36a5a5e0389c85aabc1e" dependencies = [ "convert_case 0.11.0", - "ctor 1.0.7", + "ctor", "napi-derive-backend", "proc-macro2", "quote", @@ -5031,9 +4999,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.1.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" [[package]] name = "num-derive" @@ -7524,7 +7492,7 @@ dependencies = [ [[package]] name = "schemars_derive" version = "0.8.21" -source = "git+https://github.com/tauri-apps/schemars.git?branch=feat/preserve-description-newlines#c30f98480e6e4742aa72202d55d5264c6b2e6476" +source = "git+https://github.com/tauri-apps/schemars.git?branch=feat%2Fpreserve-description-newlines#c30f98480e6e4742aa72202d55d5264c6b2e6476" dependencies = [ "proc-macro2", "quote", @@ -9204,7 +9172,7 @@ dependencies = [ "anyhow", "brotli", "cargo_metadata", - "ctor 0.8.0", + "ctor", "dom_query", "dunce", "getrandom 0.3.3", @@ -9382,32 +9350,31 @@ dependencies = [ [[package]] name = "time" -version = "0.3.37" +version = "0.3.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +checksum = "85c17d80feb7334b40c484e45ed1a5273dfd8bfda537c3be2e74a06a6686f327" dependencies = [ "deranged", - "itoa", "libc", "num-conv", "num_threads", "powerfmt", - "serde", + "serde_core", "time-core", "time-macros", ] [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" [[package]] name = "time-macros" -version = "0.2.19" +version = "0.2.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +checksum = "dcef1a61bdb119096e153208ec5cbec23944ce8bca13be5c7f60c634f7403935" dependencies = [ "num-conv", "time-core", diff --git a/Cargo.toml b/Cargo.toml index 670a647672c2..3bf88a350845 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ repository = "https://github.com/tauri-apps/tauri" categories = ["gui", "web-programming"] license = "Apache-2.0 OR MIT" edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" # default to small, optimized workspace release binaries [profile.release] diff --git a/bench/Cargo.toml b/bench/Cargo.toml index 2a2b92886e56..ab2719aa4f49 100644 --- a/bench/Cargo.toml +++ b/bench/Cargo.toml @@ -3,7 +3,7 @@ name = "tauri_bench" version = "0.1.0" authors = ["Tauri Programme within The Commons Conservancy"] edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" license = "Apache-2.0 OR MIT" description = "Cross-platform WebView rendering library" repository = "https://github.com/tauri-apps/wry" diff --git a/bench/tests/cpu_intensive/src-tauri/Cargo.toml b/bench/tests/cpu_intensive/src-tauri/Cargo.toml index f88b056196cd..f6eba0a29fa7 100644 --- a/bench/tests/cpu_intensive/src-tauri/Cargo.toml +++ b/bench/tests/cpu_intensive/src-tauri/Cargo.toml @@ -3,7 +3,7 @@ name = "bench_cpu_intensive" version = "0.1.0" description = "A very simple Tauri Application" edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" [build-dependencies] tauri-build = { path = "../../../../crates/tauri-build", features = [ diff --git a/bench/tests/files_transfer/src-tauri/Cargo.toml b/bench/tests/files_transfer/src-tauri/Cargo.toml index 39b309e70e03..10139f87e469 100644 --- a/bench/tests/files_transfer/src-tauri/Cargo.toml +++ b/bench/tests/files_transfer/src-tauri/Cargo.toml @@ -3,7 +3,7 @@ name = "bench_files_transfer" version = "0.1.0" description = "A very simple Tauri Application" edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" [build-dependencies] tauri-build = { path = "../../../../crates/tauri-build", features = [ diff --git a/bench/tests/helloworld/src-tauri/Cargo.toml b/bench/tests/helloworld/src-tauri/Cargo.toml index 825b0c2d7df8..d33cca7c5aec 100644 --- a/bench/tests/helloworld/src-tauri/Cargo.toml +++ b/bench/tests/helloworld/src-tauri/Cargo.toml @@ -3,7 +3,7 @@ name = "bench_helloworld" version = "0.1.0" description = "A very simple Tauri Application" edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" [build-dependencies] tauri-build = { path = "../../../../crates/tauri-build", features = [ diff --git a/crates/tauri-bundler/Cargo.toml b/crates/tauri-bundler/Cargo.toml index 90e4cc6d91a9..9e9914a6f8c9 100644 --- a/crates/tauri-bundler/Cargo.toml +++ b/crates/tauri-bundler/Cargo.toml @@ -11,7 +11,7 @@ keywords = ["bundle", "cargo", "tauri"] repository = "https://github.com/tauri-apps/tauri" description = "Wrap rust executables in OS-specific app bundles for Tauri" edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" exclude = ["CHANGELOG.md", "/target", "rustfmt.toml"] [dependencies] diff --git a/crates/tauri-cli/Cargo.toml b/crates/tauri-cli/Cargo.toml index 0b896ca34896..4923d1ac9009 100644 --- a/crates/tauri-cli/Cargo.toml +++ b/crates/tauri-cli/Cargo.toml @@ -3,7 +3,7 @@ name = "tauri-cli" version = "2.11.4" authors = ["Tauri Programme within The Commons Conservancy"] edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" categories = ["gui", "web-programming"] license = "Apache-2.0 OR MIT" homepage = "https://tauri.app" @@ -98,7 +98,7 @@ css-color = "0.2" resvg = "0.45.0" dunce = "1" glob = "0.3" -# 0.39 raised msrv to above 1.78 but 0.37+ can't compile on 1.77.2 either. +# 0.39 raised msrv to above 1.78 but 0.37+ can't compile on 1.90 either. oxc_parser = "0.36" oxc_span = "0.36" oxc_allocator = "0.36" diff --git a/crates/tauri-cli/src/helpers/config.rs b/crates/tauri-cli/src/helpers/config.rs index 75fb6b1ac605..c359d8b6537a 100644 --- a/crates/tauri-cli/src/helpers/config.rs +++ b/crates/tauri-cli/src/helpers/config.rs @@ -15,7 +15,7 @@ use std::{ ffi::{OsStr, OsString}, path::Path, process::exit, - sync::OnceLock, + sync::LazyLock, }; use crate::error::Context; @@ -141,15 +141,11 @@ pub fn custom_sign_settings( } } -fn config_schema_validator() -> &'static jsonschema::Validator { - // TODO: Switch to `LazyLock` when we bump MSRV to above 1.80 - static CONFIG_SCHEMA_VALIDATOR: OnceLock = OnceLock::new(); - CONFIG_SCHEMA_VALIDATOR.get_or_init(|| { - let schema: JsonValue = serde_json::from_str(include_str!("../../config.schema.json")) - .expect("Failed to parse config schema bundled in the tauri-cli"); - jsonschema::validator_for(&schema).expect("Config schema bundled in the tauri-cli is invalid") - }) -} +static CONFIG_SCHEMA_VALIDATOR: LazyLock = LazyLock::new(|| { + let schema: JsonValue = serde_json::from_str(include_str!("../../config.schema.json")) + .expect("Failed to parse config schema bundled in the tauri-cli"); + jsonschema::validator_for(&schema).expect("Config schema bundled in the tauri-cli is invalid") +}); fn load_config( merge_configs: &[&serde_json::Value], @@ -191,7 +187,7 @@ fn load_config( if config_path.extension() == Some(OsStr::new("json")) || config_path.extension() == Some(OsStr::new("json5")) { - let mut errors = config_schema_validator().iter_errors(&config).peekable(); + let mut errors = CONFIG_SCHEMA_VALIDATOR.iter_errors(&config).peekable(); if errors.peek().is_some() { for error in errors { let path = error.instance_path.into_iter().join(" > "); diff --git a/crates/tauri-cli/src/helpers/updater_signature.rs b/crates/tauri-cli/src/helpers/updater_signature.rs index c27a2c0e555d..38dae6d8d737 100644 --- a/crates/tauri-cli/src/helpers/updater_signature.rs +++ b/crates/tauri-cli/src/helpers/updater_signature.rs @@ -120,7 +120,7 @@ where { let bin_path = bin_path.as_ref(); // We need to append .sig at the end it's where the signature will be stored - // TODO: use with_added_extension when we bump MSRV to > 1.91' + // TODO: use `with_added_extension` when we bump MSRV to >= 1.91 let signature_path = if let Some(ext) = bin_path.extension() { let mut extension = ext.to_os_string(); extension.push(".sig"); diff --git a/crates/tauri-cli/src/icon.rs b/crates/tauri-cli/src/icon.rs index e5863b1a31ec..515b68e08a15 100644 --- a/crates/tauri-cli/src/icon.rs +++ b/crates/tauri-cli/src/icon.rs @@ -8,7 +8,6 @@ use crate::{ }; use std::{ - borrow::Cow, collections::HashMap, fs::{create_dir_all, File}, io::{BufWriter, Write}, @@ -895,10 +894,9 @@ fn content_bounds(img: &DynamicImage) -> Option<(u32, u32, u32, u32)> { fn resize_asset(img: &DynamicImage, target_size: u32, scale_percent: f32) -> DynamicImage { let cropped = if let Some((x, y, cw, ch)) = content_bounds(img) { - // TODO: Use `&` here instead when we raise MSRV to above 1.79 - Cow::Owned(img.crop_imm(x, y, cw, ch)) + &img.crop_imm(x, y, cw, ch) } else { - Cow::Borrowed(img) + img }; let (cw, ch) = cropped.dimensions(); @@ -908,7 +906,7 @@ fn resize_asset(img: &DynamicImage, target_size: u32, scale_percent: f32) -> Dyn let new_w = (cw as f32 * scale).round() as u32; let new_h = (ch as f32 * scale).round() as u32; - let resized = resize_image(&cropped, new_w, new_h); + let resized = resize_image(cropped, new_w, new_h); // Place on transparent square canvas let mut canvas = ImageBuffer::from_pixel(target_size, target_size, Rgba([0, 0, 0, 0])); diff --git a/crates/tauri-cli/src/interface/rust/desktop.rs b/crates/tauri-cli/src/interface/rust/desktop.rs index ddde0a4f0a44..0073f235142b 100644 --- a/crates/tauri-cli/src/interface/rust/desktop.rs +++ b/crates/tauri-cli/src/interface/rust/desktop.rs @@ -159,7 +159,7 @@ pub fn build( let out_dir = app_settings.out_dir(&options, tauri_dir)?; let bin_path = app_settings.app_binary_path(&options, tauri_dir)?; - if !std::env::var_os("STATIC_VCRUNTIME").is_some_and(|v| v == "false") { + if std::env::var_os("STATIC_VCRUNTIME").is_none_or(|v| v != "false") { std::env::set_var("STATIC_VCRUNTIME", "true"); } diff --git a/crates/tauri-cli/templates/app/src-tauri/Cargo.crate-manifest b/crates/tauri-cli/templates/app/src-tauri/Cargo.crate-manifest index 56bbeb0d6d18..bf092645cdd1 100644 --- a/crates/tauri-cli/templates/app/src-tauri/Cargo.crate-manifest +++ b/crates/tauri-cli/templates/app/src-tauri/Cargo.crate-manifest @@ -6,7 +6,7 @@ authors = ["you"] license = "" repository = "" edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/tauri-cli/templates/plugin/Cargo.crate-manifest b/crates/tauri-cli/templates/plugin/Cargo.crate-manifest index ecb96e65d770..4061bbd0bba0 100644 --- a/crates/tauri-cli/templates/plugin/Cargo.crate-manifest +++ b/crates/tauri-cli/templates/plugin/Cargo.crate-manifest @@ -4,7 +4,7 @@ version = "0.1.0" authors = [ "{{ author }}" ] description = "" edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" exclude = ["/examples", "/dist-js", "/guest-js", "/node_modules"] links = "tauri-plugin-{{ plugin_name }}" diff --git a/crates/tauri-cli/templates/plugin/__example-api/tauri-app/src-tauri/Cargo.crate-manifest b/crates/tauri-cli/templates/plugin/__example-api/tauri-app/src-tauri/Cargo.crate-manifest index 3dfd82a6ad8e..d8f3ccc735ac 100644 --- a/crates/tauri-cli/templates/plugin/__example-api/tauri-app/src-tauri/Cargo.crate-manifest +++ b/crates/tauri-cli/templates/plugin/__example-api/tauri-app/src-tauri/Cargo.crate-manifest @@ -6,7 +6,7 @@ authors = ["you"] license = "" repository = "" edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" [lib] name = "tauri_app_lib" diff --git a/crates/tauri-cli/templates/plugin/__example-basic/vanilla/src-tauri/Cargo.crate-manifest b/crates/tauri-cli/templates/plugin/__example-basic/vanilla/src-tauri/Cargo.crate-manifest index 4f854da7bdd4..a3481b7d087c 100644 --- a/crates/tauri-cli/templates/plugin/__example-basic/vanilla/src-tauri/Cargo.crate-manifest +++ b/crates/tauri-cli/templates/plugin/__example-basic/vanilla/src-tauri/Cargo.crate-manifest @@ -6,7 +6,7 @@ authors = ["you"] license = "" repository = "" edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" [lib] name = "tauri_app_lib" diff --git a/crates/tauri-driver/Cargo.toml b/crates/tauri-driver/Cargo.toml index db0197ec337a..66eb25962189 100644 --- a/crates/tauri-driver/Cargo.toml +++ b/crates/tauri-driver/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/tauri-apps/tauri" description = "Webdriver server for Tauri applications" readme = "README.md" edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" [dependencies] anyhow = "1" diff --git a/crates/tauri-macos-sign/Cargo.toml b/crates/tauri-macos-sign/Cargo.toml index a8b444d6021d..e8a511bda730 100644 --- a/crates/tauri-macos-sign/Cargo.toml +++ b/crates/tauri-macos-sign/Cargo.toml @@ -7,7 +7,7 @@ keywords = ["codesign", "signing", "macos", "ios", "tauri"] repository = "https://github.com/tauri-apps/tauri" description = "Code signing utilities for macOS and iOS apps" edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" [dependencies] thiserror = "2" diff --git a/crates/tauri-macros/src/command/wrapper.rs b/crates/tauri-macros/src/command/wrapper.rs index 7eb85510e7ad..36bccbeec5e7 100644 --- a/crates/tauri-macros/src/command/wrapper.rs +++ b/crates/tauri-macros/src/command/wrapper.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use std::{env::var, sync::OnceLock}; +use std::env::var; use heck::{ToLowerCamelCase, ToSnakeCase}; use proc_macro::TokenStream; @@ -211,13 +211,7 @@ pub fn wrapper(attributes: TokenStream, item: TokenStream) -> TokenStream { // only implemented by `Result`. That way we don't exclude renamed result types // which we wouldn't otherwise be able to detect purely from the token stream. // The "error message" displayed to the user is simply the trait name. - // - // TODO: remove this check once our MSRV is high enough - let diagnostic = if is_rustc_at_least(1, 78) { - quote!(#[diagnostic::on_unimplemented(message = "async commands that contain references as inputs must return a `Result`")]) - } else { - quote!() - }; + let diagnostic = quote!(#[diagnostic::on_unimplemented(message = "async commands that contain references as inputs must return a `Result`")]); async_command_check = quote_spanned! {return_type.span() => #[allow(unreachable_code, clippy::diverging_sub_expression, clippy::used_underscore_binding)] @@ -528,45 +522,3 @@ fn parse_arg( } ))) } - -fn is_rustc_at_least(major: u32, minor: u32) -> bool { - let version = rustc_version(); - version.0 >= major && version.1 >= minor -} - -fn rustc_version() -> &'static (u32, u32) { - static RUSTC_VERSION: OnceLock<(u32, u32)> = OnceLock::new(); - RUSTC_VERSION.get_or_init(|| { - cross_command("rustc") - .arg("-V") - .output() - .ok() - .and_then(|o| { - let version = String::from_utf8_lossy(&o.stdout) - .trim() - .split(' ') - .nth(1) - .unwrap_or_default() - .split('.') - .take(2) - .flat_map(|p| p.parse::().ok()) - .collect::>(); - version - .first() - .and_then(|major| version.get(1).map(|minor| (*major, *minor))) - }) - .unwrap_or((1, 0)) - }) -} - -fn cross_command(bin: &str) -> std::process::Command { - #[cfg(target_os = "windows")] - let cmd = { - let mut cmd = std::process::Command::new("cmd"); - cmd.arg("/c").arg(bin); - cmd - }; - #[cfg(not(target_os = "windows"))] - let cmd = std::process::Command::new(bin); - cmd -} diff --git a/crates/tauri-runtime-wry/src/lib.rs b/crates/tauri-runtime-wry/src/lib.rs index aef855ca7e62..6c82be330c33 100644 --- a/crates/tauri-runtime-wry/src/lib.rs +++ b/crates/tauri-runtime-wry/src/lib.rs @@ -5325,9 +5325,7 @@ You may have it installed on another user account, but it is not available for t // on multiwebview mode if we change focus to a different webview // we get the gotFocus event of the other webview before the lostFocus // so this check makes sense - let lost_window_focus = focused_webview.as_ref().map_or(true, |w| w == &label_); - // TODO: Use `is_none_or` instead when MSRV gets raised above 1.82 - // let lost_window_focus = focused_webview.as_ref().is_none_or(|t| t == &label_); + let lost_window_focus = focused_webview.as_ref().is_none_or(|t| t == &label_); if lost_window_focus { // only reset when we lost window focus - otherwise some other webview is focused diff --git a/crates/tauri-utils/Cargo.toml b/crates/tauri-utils/Cargo.toml index 8d1680db9918..3a9da3ce16d2 100644 --- a/crates/tauri-utils/Cargo.toml +++ b/crates/tauri-utils/Cargo.toml @@ -33,10 +33,7 @@ serde_with = "3" aes-gcm = { version = "0.10", optional = true } getrandom = { version = "0.3", optional = true, features = ["std"] } serialize-to-javascript = { version = "0.1.2", optional = true } -ctor = { version = "0.8", default-features = false, features = [ - "std", - "proc_macro", -] } +ctor = { version = "1.0", default-features = false } json5 = { version = "0.4", optional = true } # Part of public api in error type toml = { version = ">=0.9, <=1", features = ["parse"] } diff --git a/crates/tauri-utils/src/config.rs b/crates/tauri-utils/src/config.rs index a54c619e3f6f..9b82a3033036 100644 --- a/crates/tauri-utils/src/config.rs +++ b/crates/tauri-utils/src/config.rs @@ -1745,10 +1745,9 @@ impl FromStr for Color { fn from_str(mut color: &str) -> Result { color = color.trim().strip_prefix('#').unwrap_or(color); let color = match color.len() { - // TODO: use repeat_n once our MSRV is bumped to 1.82 3 => color.chars() - .flat_map(|c| std::iter::repeat(c).take(2)) - .chain(std::iter::repeat('f').take(2)) + .flat_map(|c| std::iter::repeat_n(c, 2)) + .chain(std::iter::repeat_n('f', 2)) .collect(), 6 => format!("{color}FF"), 8 => color.to_string(), diff --git a/crates/tauri-utils/src/platform/starting_binary.rs b/crates/tauri-utils/src/platform/starting_binary.rs index 14db842ff9b8..4c0be3f85405 100644 --- a/crates/tauri-utils/src/platform/starting_binary.rs +++ b/crates/tauri-utils/src/platform/starting_binary.rs @@ -2,16 +2,17 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use ctor::ctor; +use ctor::declarative::ctor; use std::{ io::{Error, ErrorKind, Result}, path::{Path, PathBuf}, }; -/// A cached version of the current binary using [`ctor`] to cache it before even `main` runs. -#[ctor] -#[used] -pub(super) static STARTING_BINARY: StartingBinary = unsafe { StartingBinary::new() }; +ctor! { + /// A cached version of the current binary using [`ctor`] to cache it before even `main` runs. + #[ctor(unsafe)] + pub(super) static STARTING_BINARY: StartingBinary = unsafe { StartingBinary::new() }; +} /// Represents a binary path that was cached when the program was loaded. pub(super) struct StartingBinary(std::io::Result); diff --git a/crates/tauri/src/resources/mod.rs b/crates/tauri/src/resources/mod.rs index 3a65c3a6fd6f..90da8c0175a5 100644 --- a/crates/tauri/src/resources/mod.rs +++ b/crates/tauri/src/resources/mod.rs @@ -45,7 +45,7 @@ impl dyn Resource { } #[inline(always)] - pub(crate) fn downcast_arc<'a, T: Resource>(self: &'a Arc) -> Option<&'a Arc> { + pub(crate) fn downcast_arc(self: &Arc) -> Option<&Arc> { if self.is::() { // A resource is stored as `Arc` in a BTreeMap // and is safe to cast to `Arc` because of the runtime diff --git a/examples/api/src-tauri/Cargo.toml b/examples/api/src-tauri/Cargo.toml index b09e4fd1acb6..043d4a9fc527 100644 --- a/examples/api/src-tauri/Cargo.toml +++ b/examples/api/src-tauri/Cargo.toml @@ -3,7 +3,7 @@ name = "api" version = "0.1.0" description = "An example Tauri Application showcasing the api" edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" license = "Apache-2.0 OR MIT" [lib] diff --git a/examples/file-associations/src-tauri/Cargo.toml b/examples/file-associations/src-tauri/Cargo.toml index bfdcac621e69..1329f4d0b929 100644 --- a/examples/file-associations/src-tauri/Cargo.toml +++ b/examples/file-associations/src-tauri/Cargo.toml @@ -3,7 +3,7 @@ name = "tauri-file-associations-demo" version = "0.1.0" description = "A Tauri application that associate file types" edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" [build-dependencies] tauri-build = { path = "../../../crates/tauri-build", features = ["codegen"] } diff --git a/examples/resources/src-tauri/Cargo.toml b/examples/resources/src-tauri/Cargo.toml index dfd0c261eff2..c82229d9db4c 100644 --- a/examples/resources/src-tauri/Cargo.toml +++ b/examples/resources/src-tauri/Cargo.toml @@ -3,7 +3,7 @@ name = "resources" version = "0.1.0" description = "A Tauri application that uses Node.js with app resources" edition = "2021" -rust-version = "1.77.2" +rust-version = "1.90" [build-dependencies] tauri-build = { path = "../../../crates/tauri-build", features = ["codegen"] }