From a4b31fbe2e2fe30a67c9957f1366c404f61e592f Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 6 May 2021 19:03:52 +0200 Subject: [PATCH] CI: -W was not enough to override the -D, use -A instead Also fix a warning about the usage of std::any::Any without dyn --- .github/workflows/ci.yaml | 8 ++++---- sixtyfps_runtime/rendering_backends/qt/qt_window.rs | 10 +++++----- sixtyfps_runtime/rendering_backends/qt/widgets.rs | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 42bedf688..ec260ac64 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,7 +21,7 @@ jobs: env: DYLD_FRAMEWORK_PATH: /Users/runner/work/sixtyfps/Qt/5.15.2/clang_64/lib QT_QPA_PLATFORM: offscreen - RUSTFLAGS: -D warnings -W deprecated + RUSTFLAGS: -D warnings -A deprecated strategy: matrix: os: [ubuntu-20.04, macos-latest, windows-latest] @@ -148,7 +148,7 @@ jobs: env: DYLD_FRAMEWORK_PATH: /Users/runner/work/sixtyfps/Qt/5.15.2/clang_64/lib QT_QPA_PLATFORM: offscreen - RUSTFLAGS: -D warnings -W deprecated + RUSTFLAGS: -D warnings -A deprecated strategy: matrix: os: [ubuntu-20.04, macos-latest, windows-latest] @@ -302,8 +302,8 @@ jobs: env: # allow deprecated warning because we are using nightly and some things might be deprecated in nightly # for which the stable alternative is not yet available - RUSTFLAGS: -D warnings -W deprecated - RUSTDOCFLAGS: --html-in-header=/home/runner/work/sixtyfps/sixtyfps/api/sixtyfps-rs/sixtyfps-docs-integration.html -D warnings -W deprecated + RUSTFLAGS: -D warnings -A deprecated + RUSTDOCFLAGS: --html-in-header=/home/runner/work/sixtyfps/sixtyfps/api/sixtyfps-rs/sixtyfps-docs-integration.html -D warnings -A deprecated SIXTYFPS_NO_QT: 1 steps: - uses: actions/checkout@v2 diff --git a/sixtyfps_runtime/rendering_backends/qt/qt_window.rs b/sixtyfps_runtime/rendering_backends/qt/qt_window.rs index 77755cae7..c85a5d446 100644 --- a/sixtyfps_runtime/rendering_backends/qt/qt_window.rs +++ b/sixtyfps_runtime/rendering_backends/qt/qt_window.rs @@ -1060,7 +1060,7 @@ impl PlatformWindow for QtWindow { let window = sixtyfps_corelib::window::Window::new(|window| QtWindow::new(window)); let popup_window: &QtWindow = - std::any::Any::downcast_ref(window.as_ref().as_any()).unwrap(); + ::downcast_ref(window.as_ref().as_any()).unwrap(); window.set_component(popup); let popup_ptr = popup_window.widget_ptr(); let pos = qttypes::QPoint { x: position.x as _, y: position.y as _ }; @@ -1295,7 +1295,6 @@ fn qt_key_to_string(key: key_generated::Qt_Key, event_text: String) -> SharedStr } pub(crate) mod ffi { - use std::any::Any; use std::ffi::c_void; use super::QtWindow; @@ -1304,8 +1303,9 @@ pub(crate) mod ffi { pub extern "C" fn sixtyfps_qt_get_widget( window: &sixtyfps_corelib::window::ComponentWindow, ) -> *mut c_void { - Any::downcast_ref(window.0.as_any()).map_or(std::ptr::null_mut(), |win: &QtWindow| { - win.widget_ptr().cast::().as_ptr() - }) + ::downcast_ref(window.0.as_any()) + .map_or(std::ptr::null_mut(), |win: &QtWindow| { + win.widget_ptr().cast::().as_ptr() + }) } } diff --git a/sixtyfps_runtime/rendering_backends/qt/widgets.rs b/sixtyfps_runtime/rendering_backends/qt/widgets.rs index be10f0f4a..a9559caa4 100644 --- a/sixtyfps_runtime/rendering_backends/qt/widgets.rs +++ b/sixtyfps_runtime/rendering_backends/qt/widgets.rs @@ -62,7 +62,7 @@ macro_rules! fn_render { ($this:ident $dpr:ident $size:ident $painter:ident => $($tt:tt)*) => { fn render(self: Pin<&Self>, backend: &mut &mut dyn ItemRenderer) { let $dpr: f32 = backend.scale_factor(); - if let Some(painter) = std::any::Any::downcast_mut::(backend.as_any()) { + if let Some(painter) = ::downcast_mut::(backend.as_any()) { let $size: qttypes::QSize = get_size!(self); let $this = self; painter.save_state();