From 1788d60a3c833521b6ed801ab84c9f0bb4ed7b19 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 17:36:56 +0900 Subject: [PATCH 1/2] Update dependency Rust to v1.77.2 (#781) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- rust-toolchain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain b/rust-toolchain index b1131583c..369f9966f 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.77.1 +1.77.2 From 7afc2761477d47c4bb031aa14d1d9c9fb8d40f8a Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Tue, 16 Apr 2024 05:16:43 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Rust=20API=E3=81=AE`unsafe=5Fcode`=E3=82=92?= =?UTF-8?q?`allow`=E3=81=AB=E3=81=99=E3=82=8B=20(#773)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit voicevox_coreの`unsafe_code`を`allow`にする --- crates/voicevox_core/Cargo.toml | 5 ++++- crates/voicevox_core/src/engine/open_jtalk.rs | 1 - crates/voicevox_core/src/infer/runtimes/onnxruntime.rs | 1 - crates/voicevox_core/src/synthesizer.rs | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/voicevox_core/Cargo.toml b/crates/voicevox_core/Cargo.toml index 02f1860cf..bd3456abb 100644 --- a/crates/voicevox_core/Cargo.toml +++ b/crates/voicevox_core/Cargo.toml @@ -56,5 +56,8 @@ humansize.workspace = true windows = { workspace = true, features = ["Win32_Foundation", "Win32_Graphics_Dxgi"] } [lints.rust] -unsafe_code = "deny" # FIXME: あまり意味が無くなっているため潔く`allow`にする。あるいはunsafeを撲滅する +# FIXME: `unsafe impl Send`のもあるが、以下2つのマージにより消える予定 +# * https://github.com/VOICEVOX/voicevox_core/pull/725 +# * https://github.com/VOICEVOX/voicevox_core/pull/772 +unsafe_code = "allow" # WindowsのGPU情報表示に、Win32を利用 rust_2018_idioms = "warn" diff --git a/crates/voicevox_core/src/engine/open_jtalk.rs b/crates/voicevox_core/src/engine/open_jtalk.rs index 7c272cb74..1ec737f95 100644 --- a/crates/voicevox_core/src/engine/open_jtalk.rs +++ b/crates/voicevox_core/src/engine/open_jtalk.rs @@ -183,7 +183,6 @@ pub(crate) mod blocking { } // FIXME: open_jtalk-rs側で宣言する - #[allow(unsafe_code)] unsafe impl Send for Resources {} } diff --git a/crates/voicevox_core/src/infer/runtimes/onnxruntime.rs b/crates/voicevox_core/src/infer/runtimes/onnxruntime.rs index a22503055..0556b6d51 100644 --- a/crates/voicevox_core/src/infer/runtimes/onnxruntime.rs +++ b/crates/voicevox_core/src/infer/runtimes/onnxruntime.rs @@ -249,6 +249,5 @@ mod assert_send { } // SAFETY: `Session` is probably "send"able. - #[allow(unsafe_code)] unsafe impl Send for AssertSend {} } diff --git a/crates/voicevox_core/src/synthesizer.rs b/crates/voicevox_core/src/synthesizer.rs index e6ef3a9bb..b90139434 100644 --- a/crates/voicevox_core/src/synthesizer.rs +++ b/crates/voicevox_core/src/synthesizer.rs @@ -1017,7 +1017,6 @@ pub(crate) mod blocking { } fn list_windows_video_cards() -> windows::core::Result> { - #[allow(unsafe_code)] unsafe { let factory = CreateDXGIFactory::()?; (0..)