ITADN

Doesn't compile with rust 1.89.0+nightly

#300Closedgepbird 创建于 2025-10-30
G
gepbirdcommented
After updating the rust toolchain, some changes need to be made. The `let_chains` experimental feature was stabilized, but it is only available in the 2024 edition: ```console mint-mod-manager> error: let chains are only allowed in Rust 2024 or later mint-mod-manager> --> src/providers/cache.rs:143:20 mint-mod-manager> | mint-mod-manager> 143 | && let serde_json::Value::String(vs) = v mint-mod-manager> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mint-mod-manager> warning: the feature `let_chains` has been stable since 1.88.0 and no longer requires an attribute to enable mint-mod-manager> --> src/lib.rs:1:12 mint-mod-manager> | mint-mod-manager> 1 | #![feature(let_chains)] ``` Trying to bump the edition from 2021 to 2024 isn't trivial, it generates quite a few errors and warnings: <details><summary>logs</summary> ``` mint> warning[E0133]: call to unsafe function `retour::StaticDetour::<T>::enable` is unsafe and requires unsafe block mint> --> hook/src/hooks/server_list.rs:24:9 mint> | mint> 24 | / GetServerName mint> 25 | | .initialize( mint> 26 | | std::mem::transmute(server_name.get_server_name.0), mint> 27 | | detour_get_server_name, mint> 28 | | )? mint> 29 | | .enable()?; mint> | |_____________________^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> note: an unsafe function restricts its caller, but its body is safe by default mint> --> hook/src/hooks/server_list.rs:22:1 mint> | mint> 22 | pub unsafe fn init_hooks() -> Result<()> { mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mint> = note: `#[warn(unsafe_op_in_unsafe_fn)]` on by default mint> mint> warning[E0133]: call to unsafe function `retour::StaticDetour::<T>::initialize` is unsafe and requires unsafe block mint> --> hook/src/hooks/server_list.rs:24:9 mint> | mint> 24 | / GetServerName mint> 25 | | .initialize( mint> 26 | | std::mem::transmute(server_name.get_server_name.0), mint> 27 | | detour_get_server_name, mint> 28 | | )? mint> | |_____________^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::intrinsics::transmute` is unsafe and requires unsafe block mint> --> hook/src/hooks/server_list.rs:26:17 mint> | mint> 26 | std::mem::transmute(server_name.get_server_name.0), mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `retour::StaticDetour::<T>::enable` is unsafe and requires unsafe block mint> --> hook/src/hooks/server_list.rs:33:9 mint> | mint> 33 | / USessionHandlingFSDFillSessionSetting mint> 34 | | .initialize( mint> 35 | | std::mem::transmute(server_mods.fill_session_setting.0), mint> 36 | | detour_fill_session_setting, mint> 37 | | )? mint> 38 | | .enable()?; mint> | |_____________________^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `retour::StaticDetour::<T>::initialize` is unsafe and requires unsafe block mint> --> hook/src/hooks/server_list.rs:33:9 mint> | mint> 33 | / USessionHandlingFSDFillSessionSetting mint> 34 | | .initialize( mint> 35 | | std::mem::transmute(server_mods.fill_session_setting.0), mint> 36 | | detour_fill_session_setting, mint> 37 | | )? mint> | |_____________^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::intrinsics::transmute` is unsafe and requires unsafe block mint> --> hook/src/hooks/server_list.rs:35:17 mint> | mint> 35 | std::mem::transmute(server_mods.fill_session_setting.0), mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::ptr::mut_ptr::<impl *mut T>::as_mut` is unsafe and requires unsafe block mint> --> hook/src/hooks/server_list.rs:258:17 mint> | mint> 258 | let stack = stack.as_mut().unwrap(); mint> | ^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> note: an unsafe function restricts its caller, but its body is safe by default mint> --> hook/src/hooks/server_list.rs:253:1 mint> | mint> 253 | / unsafe extern "system" fn exec_get_mods_installed( mint> 254 | | _context: *mut ue::UObject, mint> 255 | | stack: *mut ue::kismet::FFrame, mint> 256 | | result: *mut c_void, mint> 257 | | ) { mint> | |_^ mint> mint> warning[E0133]: call to unsafe function `ue::kismet::FFrame::arg` is unsafe and requires unsafe block mint> --> hook/src/hooks/server_list.rs:260:44 mint> | mint> 260 | let session: FBlueprintSessionResult = stack.arg(); mint> | ^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `ue::kismet::FFrame::arg` is unsafe and requires unsafe block mint> --> hook/src/hooks/server_list.rs:261:40 mint> | mint> 261 | let _exclude_verified_mods: bool = stack.arg(); mint> | ^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: dereference of raw pointer is unsafe and requires unsafe block mint> --> hook/src/hooks/server_list.rs:263:23 mint> | mint> 263 | let result = &mut *(result as *mut TArray<FString>); mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior mint> mint> warning[E0133]: access to union field is unsafe and requires unsafe block mint> --> hook/src/hooks/server_list.rs:272:40 mint> | mint> 272 | value: FVariantDataValue { as_tchar }, mint> | ^^^^^^^^ access to union field mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior mint> mint> warning[E0133]: call to unsafe function `widestring::U16CStr::from_ptr_str` is unsafe and requires unsafe block mint> --> hook/src/hooks/server_list.rs:275:33 mint> | mint> 275 | if let Ok(string) = widestring::U16CStr::from_ptr_str(as_tchar).to_string() { mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::ptr::const_ptr::<impl *const T>::add` is unsafe and requires unsafe block mint> --> hook/src/hooks/server_list.rs:289:22 mint> | mint> 289 | stack.code = stack.code.add(1); mint> | ^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `retour::StaticDetour::<T>::initialize` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:63:5 mint> | mint> 63 | / WinMain.initialize( mint> 64 | | std::mem::transmute(globals().resolution.core.as_ref().unwrap().main.0), mint> 65 | | detour_main, mint> 66 | | )?; mint> | |_____^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> note: an unsafe function restricts its caller, but its body is safe by default mint> --> hook/src/hooks/mod.rs:43:1 mint> | mint> 43 | pub unsafe fn initialize() -> Result<()> { mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mint> mint> warning[E0133]: call to unsafe function `std::intrinsics::transmute` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:64:9 mint> | mint> 64 | std::mem::transmute(globals().resolution.core.as_ref().unwrap().main.0), mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `retour::StaticDetour::<T>::enable` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:67:5 mint> | mint> 67 | WinMain.enable()?; mint> | ^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `retour::StaticDetour::<T>::initialize` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:69:5 mint> | mint> 69 | / HookUFunctionBind.initialize( mint> 70 | | std::mem::transmute(globals().resolution.core.as_ref().unwrap().ufunction_bind.0), mint> 71 | | move |function| { mint> 72 | | HookUFunctionBind.call(function); mint> ... | mint> 88 | | }, mint> 89 | | )?; mint> | |_____^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::intrinsics::transmute` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:70:9 mint> | mint> 70 | std::mem::transmute(globals().resolution.core.as_ref().unwrap().ufunction_bind.0), mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `retour::traits::<impl retour::StaticDetour<unsafe extern "system" fn(A) -> Ret>>::call` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:72:13 mint> | mint> 72 | HookUFunctionBind.call(function); mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::ptr::mut_ptr::<impl *mut T>::as_mut` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:73:37 mint> | mint> 73 | if let Some(function) = function.as_mut() { mint> | ^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `retour::StaticDetour::<T>::enable` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:90:5 mint> | mint> 90 | HookUFunctionBind.enable()?; mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `hooks::server_list::init_hooks` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:92:5 mint> | mint> 92 | server_list::init_hooks()?; mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `hooks::patch_mem` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:99:17 mint> | mint> 99 | / patch_mem( mint> 100 | | (address.0 as *mut u8).add(29), mint> 101 | | [0xB8, 0x01, 0x00, 0x00, 0x00], mint> 102 | | )?; mint> | |_________________^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::ptr::mut_ptr::<impl *mut T>::add` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:100:21 mint> | mint> 100 | (address.0 as *mut u8).add(29), mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `retour::StaticDetour::<T>::enable` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:118:17 mint> | mint> 118 | / SaveGameToSlot mint> 119 | | .initialize( mint> 120 | | std::mem::transmute(save_game.save_game_to_slot.0), mint> 121 | | save_game_to_slot_detour, mint> 122 | | )? mint> 123 | | .enable()?; mint> | |_____________________________^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `retour::StaticDetour::<T>::initialize` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:118:17 mint> | mint> 118 | / SaveGameToSlot mint> 119 | | .initialize( mint> 120 | | std::mem::transmute(save_game.save_game_to_slot.0), mint> 121 | | save_game_to_slot_detour, mint> 122 | | )? mint> | |_____________________^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::intrinsics::transmute` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:120:25 mint> | mint> 120 | std::mem::transmute(save_game.save_game_to_slot.0), mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `retour::StaticDetour::<T>::enable` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:124:17 mint> | mint> 124 | / LoadGameFromSlot mint> 125 | | .initialize( mint> 126 | | std::mem::transmute(save_game.load_game_from_slot.0), mint> 127 | | load_game_from_slot_detour, mint> 128 | | )? mint> 129 | | .enable()?; mint> | |_____________________________^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `retour::StaticDetour::<T>::initialize` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:124:17 mint> | mint> 124 | / LoadGameFromSlot mint> 125 | | .initialize( mint> 126 | | std::mem::transmute(save_game.load_game_from_slot.0), mint> 127 | | load_game_from_slot_detour, mint> 128 | | )? mint> | |_____________________^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::intrinsics::transmute` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:126:25 mint> | mint> 126 | std::mem::transmute(save_game.load_game_from_slot.0), mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `retour::StaticDetour::<T>::enable` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:131:17 mint> | mint> 131 | / DoesSaveGameExist mint> 132 | | .initialize( mint> 133 | | std::mem::transmute(save_game.does_save_game_exist.0), mint> 134 | | does_save_game_exist_detour, mint> 135 | | )? mint> 136 | | .enable()?; mint> | |_____________________________^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `retour::StaticDetour::<T>::initialize` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:131:17 mint> | mint> 131 | / DoesSaveGameExist mint> 132 | | .initialize( mint> 133 | | std::mem::transmute(save_game.does_save_game_exist.0), mint> 134 | | does_save_game_exist_detour, mint> 135 | | )? mint> | |_____________________^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::intrinsics::transmute` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:133:25 mint> | mint> 133 | std::mem::transmute(save_game.does_save_game_exist.0), mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::slice::from_raw_parts_mut` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:145:21 mint> | mint> 145 | let patch_mem = std::slice::from_raw_parts_mut(address, patch.len()); mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> note: an unsafe function restricts its caller, but its body is safe by default mint> --> hook/src/hooks/mod.rs:143:1 mint> | mint> 143 | unsafe fn patch_mem(address: *mut u8, patch: impl AsRef<[u8]>) -> Result<()> { mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mint> mint> warning[E0133]: call to unsafe function `windows::Win32::System::Memory::VirtualProtect` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:148:5 mint> | mint> 148 | / VirtualProtect( mint> 149 | | patch_mem.as_ptr() as *const c_void, mint> 150 | | patch_mem.len(), mint> 151 | | PAGE_EXECUTE_READWRITE, mint> 152 | | &mut old, mint> 153 | | )?; mint> | |_____^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `windows::Win32::System::Memory::VirtualProtect` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:157:5 mint> | mint> 157 | / VirtualProtect( mint> 158 | | patch_mem.as_ptr() as *const c_void, mint> 159 | | patch_mem.len(), mint> 160 | | old, mint> 161 | | &mut old, mint> 162 | | )?; mint> | |_____^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::ptr::mut_ptr::<impl *mut T>::as_mut` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:270:17 mint> | mint> 270 | let stack = stack.as_mut().unwrap(); mint> | ^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> note: an unsafe function restricts its caller, but its body is safe by default mint> --> hook/src/hooks/mod.rs:265:1 mint> | mint> 265 | / unsafe extern "system" fn exec_get_mod_json( mint> 266 | | _context: *mut ue::UObject, mint> 267 | | stack: *mut ue::kismet::FFrame, mint> 268 | | _result: *mut c_void, mint> 269 | | ) { mint> | |_^ mint> mint> warning[E0133]: call to unsafe function `ue::kismet::FFrame::arg` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:272:38 mint> | mint> 272 | let _ctx: Option<&ue::UObject> = stack.arg(); mint> | ^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `ue::kismet::FFrame::arg` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:275:36 mint> | mint> 275 | let ret: Option<ue::FString> = stack.arg(); mint> | ^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::ptr::mut_ptr::<impl *mut T>::as_mut` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:276:23 mint> | mint> 276 | let ret_address = (stack.most_recent_property_address as *mut ue::FString) mint> | _______________________^ mint> 277 | | .as_mut() mint> | |_________________^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::ptr::const_ptr::<impl *const T>::add` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:288:22 mint> | mint> 288 | stack.code = stack.code.add(1); mint> | ^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::ptr::mut_ptr::<impl *mut T>::as_mut` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:297:17 mint> | mint> 297 | let stack = stack.as_mut().unwrap(); mint> | ^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> note: an unsafe function restricts its caller, but its body is safe by default mint> --> hook/src/hooks/mod.rs:292:1 mint> | mint> 292 | / unsafe extern "system" fn exec_get_update_available( mint> 293 | | _context: *mut ue::UObject, mint> 294 | | stack: *mut ue::kismet::FFrame, mint> 295 | | _result: *mut c_void, mint> 296 | | ) { mint> | |_^ mint> mint> warning[E0133]: call to unsafe function `ue::kismet::FFrame::arg` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:299:38 mint> | mint> 299 | let _ctx: Option<&ue::UObject> = stack.arg(); mint> | ^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `ue::kismet::FFrame::arg` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:301:5 mint> | mint> 301 | stack.arg::<bool>(); mint> | ^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: dereference of raw pointer is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:302:30 mint> | mint> 302 | let done_checking = &mut *(stack.most_recent_property_address as *mut bool); mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior mint> mint> warning[E0133]: call to unsafe function `ue::kismet::FFrame::arg` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:305:5 mint> | mint> 305 | stack.arg::<bool>(); mint> | ^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: dereference of raw pointer is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:306:26 mint> | mint> 306 | let available = &mut *(stack.most_recent_property_address as *mut bool); mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior mint> mint> warning[E0133]: call to unsafe function `ue::kismet::FFrame::arg` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:309:22 mint> | mint> 309 | std::mem::forget(stack.arg::<ue::FString>()); mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: dereference of raw pointer is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:310:24 mint> | mint> 310 | let version = &mut *(stack.most_recent_property_address as *mut ue::FString); mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::ptr::const_ptr::<impl *const T>::add` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:314:22 mint> | mint> 314 | stack.code = stack.code.add(1); mint> | ^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::ptr::mut_ptr::<impl *mut T>::as_mut` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:323:17 mint> | mint> 323 | let stack = stack.as_mut().unwrap(); mint> | ^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> note: an unsafe function restricts its caller, but its body is safe by default mint> --> hook/src/hooks/mod.rs:318:1 mint> | mint> 318 | / unsafe extern "system" fn exec_print_string( mint> 319 | | _context: *mut ue::UObject, mint> 320 | | stack: *mut ue::kismet::FFrame, mint> 321 | | _result: *mut c_void, mint> 322 | | ) { mint> | |_^ mint> mint> warning[E0133]: call to unsafe function `ue::kismet::FFrame::arg` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:325:42 mint> | mint> 325 | let _ctx: Option<NonNull<UObject>> = stack.arg(); mint> | ^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `ue::kismet::FFrame::arg` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:326:31 mint> | mint> 326 | let string: ue::FString = stack.arg(); mint> | ^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `ue::kismet::FFrame::arg` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:327:34 mint> | mint> 327 | let _print_to_screen: bool = stack.arg(); mint> | ^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `ue::kismet::FFrame::arg` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:328:31 mint> | mint> 328 | let _print_to_log: bool = stack.arg(); mint> | ^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `ue::kismet::FFrame::arg` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:329:32 mint> | mint> 329 | let _color: FLinearColor = stack.arg(); mint> | ^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `ue::kismet::FFrame::arg` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:330:26 mint> | mint> 330 | let _duration: f32 = stack.arg(); mint> | ^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::ptr::const_ptr::<impl *const T>::add` is unsafe and requires unsafe block mint> --> hook/src/hooks/mod.rs:335:22 mint> | mint> 335 | stack.code = stack.code.add(1); mint> | ^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: dereference of raw pointer is unsafe and requires unsafe block mint> --> hook/src/ue/kismet.rs:30:51 mint> | mint> 30 | self.property_chain_for_compiled_in = (*cur).next; mint> | ^^^^^^ dereference of raw pointer mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior mint> note: an unsafe function restricts its caller, but its body is safe by default mint> --> hook/src/ue/kismet.rs:24:5 mint> | mint> 24 | pub unsafe fn arg<T: Sized>(self: &mut FFrame) -> T { mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mint> mint> warning[E0133]: call to unsafe function is unsafe and requires unsafe block mint> --> hook/src/ue/kismet.rs:31:13 mint> | mint> 31 | (globals().fframe_step_explicit_property())(self, ptr, cur as *const FProperty); mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function is unsafe and requires unsafe block mint> --> hook/src/ue/kismet.rs:33:13 mint> | mint> 33 | (globals().fframe_step())(self, self.object, ptr); mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: call to unsafe function `std::mem::MaybeUninit::<T>::assume_init` is unsafe and requires unsafe block mint> --> hook/src/ue/kismet.rs:36:9 mint> | mint> 36 | value.assume_init() mint> | ^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> warning[E0133]: use of mutable static is unsafe and requires unsafe block mint> --> hook/src/lib.rs:128:5 mint> | mint> 128 | GLOBALS = Some(Globals { resolution, meta }); mint> | ^^^^^^^ use of mutable static mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior mint> note: an unsafe function restricts its caller, but its body is safe by default mint> --> hook/src/lib.rs:102:1 mint> | mint> 102 | unsafe fn patch() -> Result<()> { mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mint> mint> warning[E0133]: call to unsafe function `hooks::initialize` is unsafe and requires unsafe block mint> --> hook/src/lib.rs:131:5 mint> | mint> 131 | hooks::initialize()?; mint> | ^^^^^^^^^^^^^^^^^^^ call to unsafe function mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> mint> = note: consult the function's documentation for information on how to avoid undefined behavior mint> mint> For more information about this error, try `rustc --explain E0133`. mint> warning: `hook` (lib) generated 64 warnings (run `cargo fix --lib -p hook` to apply 9 suggestions) mint> Compiling mint v0.2.10 (/build/source) mint> error: binding modifiers may only be written when the default binding mode is `move` mint> --> src/lib.rs:216:58 mint> | mint> 216 | if let IntegrationError::ProviderError { ref source } = e mint> | ^^^ binding modifier not allowed under `ref` default binding mode mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> mint> note: matching on a reference type with a non-reference pattern changes the default binding mode mint> --> src/lib.rs:216:24 mint> | mint> 216 | if let IntegrationError::ProviderError { ref source } = e mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_` mint> help: remove the unnecessary binding modifier mint> | mint> 216 - if let IntegrationError::ProviderError { ref source } = e mint> 216 + if let IntegrationError::ProviderError { source } = e mint> | mint> mint> error: binding modifiers may only be written when the default binding mode is `move` mint> --> src/lib.rs:217:56 mint> | mint> 217 | && let ProviderError::NoProvider { ref url, factory } = source => mint> | ^^^ binding modifier not allowed under `ref` default binding mode mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> mint> note: matching on a reference type with a non-reference pattern changes the default binding mode mint> --> src/lib.rs:217:28 mint> | mint> 217 | && let ProviderError::NoProvider { ref url, factory } = source => mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_` mint> help: remove the unnecessary binding modifier mint> | mint> 217 - && let ProviderError::NoProvider { ref url, factory } = source => mint> 217 + && let ProviderError::NoProvider { url, factory } = source => mint> | mint> mint> error: binding modifiers may only be written when the default binding mode is `move` mint> --> src/lib.rs:239:54 mint> | mint> 239 | if let MintError::IntegrationError { ref source } = e mint> | ^^^ binding modifier not allowed under `ref` default binding mode mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> mint> note: matching on a reference type with a non-reference pattern changes the default binding mode mint> --> src/lib.rs:239:24 mint> | mint> 239 | if let MintError::IntegrationError { ref source } = e mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_` mint> help: remove the unnecessary binding modifier mint> | mint> 239 - if let MintError::IntegrationError { ref source } = e mint> 239 + if let MintError::IntegrationError { source } = e mint> | mint> mint> error: binding modifiers may only be written when the default binding mode is `move` mint> --> src/lib.rs:240:62 mint> | mint> 240 | && let IntegrationError::ProviderError { ref source } = source mint> | ^^^ binding modifier not allowed under `ref` default binding mode mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> mint> note: matching on a reference type with a non-reference pattern changes the default binding mode mint> --> src/lib.rs:240:28 mint> | mint> 240 | && let IntegrationError::ProviderError { ref source } = source mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_` mint> help: remove the unnecessary binding modifier mint> | mint> 240 - && let IntegrationError::ProviderError { ref source } = source mint> 240 + && let IntegrationError::ProviderError { source } = source mint> | mint> mint> error: binding modifiers may only be written when the default binding mode is `move` mint> --> src/lib.rs:241:56 mint> | mint> 241 | && let ProviderError::NoProvider { ref url, factory } = source => mint> | ^^^ binding modifier not allowed under `ref` default binding mode mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> mint> note: matching on a reference type with a non-reference pattern changes the default binding mode mint> --> src/lib.rs:241:28 mint> | mint> 241 | && let ProviderError::NoProvider { ref url, factory } = source => mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_` mint> help: remove the unnecessary binding modifier mint> | mint> 241 - && let ProviderError::NoProvider { ref url, factory } = source => mint> 241 + && let ProviderError::NoProvider { url, factory } = source => mint> | mint> mint> error: binding modifiers may only be written when the default binding mode is `move` mint> --> src/gui/message.rs:218:62 mint> | mint> 218 | if let IntegrationError::ProviderError { ref source } = e mint> | ^^^ binding modifier not allowed under `ref` default binding mode mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> mint> note: matching on a reference type with a non-reference pattern changes the default binding mode mint> --> src/gui/message.rs:218:28 mint> | mint> 218 | if let IntegrationError::ProviderError { ref source } = e mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_` mint> help: remove the unnecessary binding modifier mint> | mint> 218 - if let IntegrationError::ProviderError { ref source } = e mint> 218 + if let IntegrationError::ProviderError { source } = e mint> | mint> mint> error: binding modifiers may only be written when the default binding mode is `move` mint> --> src/gui/message.rs:479:62 mint> | mint> 479 | if let IntegrationError::ProviderError { ref source } = e mint> | ^^^ binding modifier not allowed under `ref` default binding mode mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> mint> note: matching on a reference type with a non-reference pattern changes the default binding mode mint> --> src/gui/message.rs:479:28 mint> | mint> 479 | if let IntegrationError::ProviderError { ref source } = e mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_` mint> help: remove the unnecessary binding modifier mint> | mint> 479 - if let IntegrationError::ProviderError { ref source } = e mint> 479 + if let IntegrationError::ProviderError { source } = e mint> | mint> mint> error: binding modifiers may only be written when the default binding mode is `move` mint> --> src/gui/mod.rs:687:29 mint> | mint> 687 | ... ref group_name, mint> | ^^^ binding modifier not allowed under `ref mut` default binding mode mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> mint> note: matching on a reference type with a non-reference pattern changes the default binding mode mint> --> src/gui/mod.rs:686:25 mint> | mint> 686 | / ModOrGroup::Group { mint> 687 | | ref group_name, mint> 688 | | enabled, mint> 689 | | } => { mint> | |_________________________^ this matches on type `&mut _` mint> help: make the implied reference pattern and variable binding mode explicit mint> | mint> 686 ~ &mut ModOrGroup::Group { mint> 687 | ref group_name, mint> 688 ~ ref mut enabled, mint> | mint> mint> error: binding modifiers may only be written when the default binding mode is `move` mint> --> src/state/mod.rs:178:40 mint> | mint> 178 | ModOrGroup::Individual(ref mc) => f(mc, None), mint> | ^^^ binding modifier not allowed under `ref` default binding mode mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> mint> note: matching on a reference type with a non-reference pattern changes the default binding mode mint> --> src/state/mod.rs:178:17 mint> | mint> 178 | ModOrGroup::Individual(ref mc) => f(mc, None), mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_` mint> help: remove the unnecessary binding modifier mint> | mint> 178 - ModOrGroup::Individual(ref mc) => f(mc, None), mint> 178 + ModOrGroup::Individual(mc) => f(mc, None), mint> | mint> mint> error: binding modifiers may only be written when the default binding mode is `move` mint> --> src/state/mod.rs:208:44 mint> | mint> 208 | ModOrGroup::Individual(ref mut mc) => f(mc, None), mint> | ^^^^^^^ binding modifier not allowed under `ref mut` default binding mode mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> mint> note: matching on a reference type with a non-reference pattern changes the default binding mode mint> --> src/state/mod.rs:208:21 mint> | mint> 208 | ModOrGroup::Individual(ref mut mc) => f(mc, None), mint> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&mut _` mint> help: remove the unnecessary binding modifier mint> | mint> 208 - ModOrGroup::Individual(ref mut mc) => f(mc, None), mint> 208 + ModOrGroup::Individual(mc) => f(mc, None), mint> | mint> mint> error: binding modifiers may only be written when the default binding mode is `move` mint> --> src/state/mod.rs:211:25 mint> | mint> 211 | ref mut enabled, mint> | ^^^^^^^ binding modifier not allowed under `ref mut` default binding mode mint> | mint> = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> mint> note: matching on a reference type with a non-reference pattern changes the default binding mode mint> --> src/state/mod.rs:209:21 mint> | mint> 209 | / ModOrGroup::Group { mint> 210 | | group_name, mint> 211 | | ref mut enabled, mint> 212 | | } => self mint> | |_____________________^ this matches on type `&mut _` mint> help: remove the unnecessary binding modifier mint> | mint> 211 - ref mut enabled, mint> 211 + enabled, mint> | mint> mint> error: could not compile `mint` (lib) due to 11 previous errors ``` </details> I don't have enough rust experience and time to submit a patch, anyone feel free to take it.
关闭于 2025-12-30 2 条评论