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
This commit is contained in:
Olivier Goffart 2021-05-06 19:03:52 +02:00
parent 80f98c727c
commit a4b31fbe2e
3 changed files with 10 additions and 10 deletions

View file

@ -21,7 +21,7 @@ jobs:
env: env:
DYLD_FRAMEWORK_PATH: /Users/runner/work/sixtyfps/Qt/5.15.2/clang_64/lib DYLD_FRAMEWORK_PATH: /Users/runner/work/sixtyfps/Qt/5.15.2/clang_64/lib
QT_QPA_PLATFORM: offscreen QT_QPA_PLATFORM: offscreen
RUSTFLAGS: -D warnings -W deprecated RUSTFLAGS: -D warnings -A deprecated
strategy: strategy:
matrix: matrix:
os: [ubuntu-20.04, macos-latest, windows-latest] os: [ubuntu-20.04, macos-latest, windows-latest]
@ -148,7 +148,7 @@ jobs:
env: env:
DYLD_FRAMEWORK_PATH: /Users/runner/work/sixtyfps/Qt/5.15.2/clang_64/lib DYLD_FRAMEWORK_PATH: /Users/runner/work/sixtyfps/Qt/5.15.2/clang_64/lib
QT_QPA_PLATFORM: offscreen QT_QPA_PLATFORM: offscreen
RUSTFLAGS: -D warnings -W deprecated RUSTFLAGS: -D warnings -A deprecated
strategy: strategy:
matrix: matrix:
os: [ubuntu-20.04, macos-latest, windows-latest] os: [ubuntu-20.04, macos-latest, windows-latest]
@ -302,8 +302,8 @@ jobs:
env: env:
# allow deprecated warning because we are using nightly and some things might be deprecated in nightly # 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 # for which the stable alternative is not yet available
RUSTFLAGS: -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 -W 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 SIXTYFPS_NO_QT: 1
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View file

@ -1060,7 +1060,7 @@ impl PlatformWindow for QtWindow {
let window = sixtyfps_corelib::window::Window::new(|window| QtWindow::new(window)); let window = sixtyfps_corelib::window::Window::new(|window| QtWindow::new(window));
let popup_window: &QtWindow = let popup_window: &QtWindow =
std::any::Any::downcast_ref(window.as_ref().as_any()).unwrap(); <dyn std::any::Any>::downcast_ref(window.as_ref().as_any()).unwrap();
window.set_component(popup); window.set_component(popup);
let popup_ptr = popup_window.widget_ptr(); let popup_ptr = popup_window.widget_ptr();
let pos = qttypes::QPoint { x: position.x as _, y: position.y as _ }; 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 { pub(crate) mod ffi {
use std::any::Any;
use std::ffi::c_void; use std::ffi::c_void;
use super::QtWindow; use super::QtWindow;
@ -1304,8 +1303,9 @@ pub(crate) mod ffi {
pub extern "C" fn sixtyfps_qt_get_widget( pub extern "C" fn sixtyfps_qt_get_widget(
window: &sixtyfps_corelib::window::ComponentWindow, window: &sixtyfps_corelib::window::ComponentWindow,
) -> *mut c_void { ) -> *mut c_void {
Any::downcast_ref(window.0.as_any()).map_or(std::ptr::null_mut(), |win: &QtWindow| { <dyn std::any::Any>::downcast_ref(window.0.as_any())
win.widget_ptr().cast::<c_void>().as_ptr() .map_or(std::ptr::null_mut(), |win: &QtWindow| {
}) win.widget_ptr().cast::<c_void>().as_ptr()
})
} }
} }

View file

@ -62,7 +62,7 @@ macro_rules! fn_render {
($this:ident $dpr:ident $size:ident $painter:ident => $($tt:tt)*) => { ($this:ident $dpr:ident $size:ident $painter:ident => $($tt:tt)*) => {
fn render(self: Pin<&Self>, backend: &mut &mut dyn ItemRenderer) { fn render(self: Pin<&Self>, backend: &mut &mut dyn ItemRenderer) {
let $dpr: f32 = backend.scale_factor(); let $dpr: f32 = backend.scale_factor();
if let Some(painter) = std::any::Any::downcast_mut::<QPainter>(backend.as_any()) { if let Some(painter) = <dyn std::any::Any>::downcast_mut::<QPainter>(backend.as_any()) {
let $size: qttypes::QSize = get_size!(self); let $size: qttypes::QSize = get_size!(self);
let $this = self; let $this = self;
painter.save_state(); painter.save_state();