From b29162d149a22415cc41b1e0a62244311baadfc1 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Thu, 1 Sep 2022 12:21:25 +0100 Subject: [PATCH] Revert "Support building with 1.57.0 compiler" This reverts the changes from 66e3293f4d4726a53c3652287b8d837b3d1e7e9c to support the 1.57.0 compiler (leaving the rustdoc fixes). Making the changes to support 1.57 felt disappointing to require for the sake of Winit being able to better support Linux distro packaging. Even with the changes we still wouldn't really support 1.57 without also upstreaming changes to `cargo ndk`. The new plan is to bank on Winit bumping its own MSRV to at least 1.58 which seems more than reasonable considering that even 1.59 is already >6months old. Ref: https://github.com/rust-windowing/winit/pull/2453 This updates ci.yml to now build with 1.60, assuming that the above PR will be accepted. --- .github/workflows/ci.yml | 6 ++++-- android-activity/src/game_activity/mod.rs | 15 ++++++--------- android-activity/src/native_activity/mod.rs | 17 +++++++---------- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7048bf8..5023fd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,8 +16,10 @@ jobs: strategy: fail-fast: false matrix: - # We need to support the same compiler versions as Winit - rust_version: [1.57.0, stable] + # We need to support the same MSRV as Winit which we are currently + # assuming will be bumped to 1.60.0 soon: + # https://github.com/rust-windowing/winit/pull/2453 + rust_version: [1.60.0, stable] steps: - uses: actions/checkout@v2 diff --git a/android-activity/src/game_activity/mod.rs b/android-activity/src/game_activity/mod.rs index d023343..c551dae 100644 --- a/android-activity/src/game_activity/mod.rs +++ b/android-activity/src/game_activity/mod.rs @@ -175,10 +175,7 @@ impl AndroidAppInner { } else { -1 }; - trace!( - "Calling ALooper_pollAll, timeout = {}", - timeout_milliseconds - ); + trace!("Calling ALooper_pollAll, timeout = {timeout_milliseconds}"); let id = ALooper_pollAll( timeout_milliseconds, &mut fd, @@ -265,9 +262,9 @@ impl AndroidAppInner { _ => unreachable!(), }; - trace!("Read ID_MAIN command {} = {:?}", cmd_i, cmd); + trace!("Read ID_MAIN command {cmd_i} = {cmd:?}"); - trace!("Calling android_app_pre_exec_cmd({})", cmd_i); + trace!("Calling android_app_pre_exec_cmd({cmd_i})"); ffi::android_app_pre_exec_cmd(native_app.as_ptr(), cmd_i); match cmd { MainEvent::ConfigChanged { .. } => { @@ -294,19 +291,19 @@ impl AndroidAppInner { trace!("Invoking callback for ID_MAIN command = {:?}", cmd); callback(PollEvent::Main(cmd)); - trace!("Calling android_app_post_exec_cmd({})", cmd_i); + trace!("Calling android_app_post_exec_cmd({cmd_i})"); ffi::android_app_post_exec_cmd(native_app.as_ptr(), cmd_i); } else { panic!("ALooper_pollAll returned ID_MAIN event with NULL android_poll_source!"); } } _ => { - error!("Ignoring spurious ALooper event source: id = {}, fd = {}, events = {:?}, data = {:?}", id, fd, events, source); + error!("Ignoring spurious ALooper event source: id = {id}, fd = {fd}, events = {events:?}, data = {source:?}"); } } } _ => { - error!("Spurious ALooper_pollAll return value {} (ignored)", id); + error!("Spurious ALooper_pollAll return value {id} (ignored)"); } } } diff --git a/android-activity/src/native_activity/mod.rs b/android-activity/src/native_activity/mod.rs index b9f3deb..552dd34 100644 --- a/android-activity/src/native_activity/mod.rs +++ b/android-activity/src/native_activity/mod.rs @@ -184,17 +184,14 @@ impl AndroidAppInner { } else { -1 }; - trace!( - "Calling ALooper_pollAll, timeout = {}", - timeout_milliseconds - ); + info!("Calling ALooper_pollAll, timeout = {timeout_milliseconds}"); let id = ALooper_pollAll( timeout_milliseconds, &mut fd, &mut events, &mut source as *mut *mut core::ffi::c_void, ); - trace!("pollAll id = {}", id); + info!("pollAll id = {id}"); match id { ffi::ALOOPER_POLL_WAKE => { trace!("ALooper_pollAll returned POLL_WAKE"); @@ -260,11 +257,11 @@ impl AndroidAppInner { _ => unreachable!(), }; - trace!("Calling android_app_pre_exec_cmd({})", cmd_i); + trace!("Calling android_app_pre_exec_cmd({cmd_i})"); ffi::android_app_pre_exec_cmd(native_app.as_ptr(), cmd_i); if let Some(cmd) = cmd { - trace!("Read ID_MAIN command {} = {:?}", cmd_i, cmd); + trace!("Read ID_MAIN command {cmd_i} = {cmd:?}"); match cmd { MainEvent::ConfigChanged { .. } => { self.config.replace(Configuration::clone_from_ptr( @@ -293,7 +290,7 @@ impl AndroidAppInner { callback(PollEvent::Main(cmd)); } - trace!("Calling android_app_post_exec_cmd({})", cmd_i); + trace!("Calling android_app_post_exec_cmd({cmd_i})"); ffi::android_app_post_exec_cmd(native_app.as_ptr(), cmd_i); } else { panic!("ALooper_pollAll returned ID_MAIN event with NULL android_poll_source!"); @@ -310,12 +307,12 @@ impl AndroidAppInner { callback(PollEvent::Main(MainEvent::InputAvailable)) } _ => { - error!("Ignoring spurious ALooper event source: id = {}, fd = {}, events = {:?}, data = {:?}", id, fd, events, source); + error!("Ignoring spurious ALooper event source: id = {id}, fd = {fd}, events = {events:?}, data = {source:?}"); } } } _ => { - error!("Spurious ALooper_pollAll return value {} (ignored)", id); + error!("Spurious ALooper_pollAll return value {id} (ignored)"); } } }