Closed tomassedovic closed 3 years ago
These have been solved in #294. However there are now new ones with rustc 1.46.0
:
Compiling tcod v0.15.0 (/home/user/game/tcod-rs)
warning: unnecessary parentheses around block return value
--> /home/user/game/tcod-rs/src/pathfinding.rs:151:13
|
151 | (Some((x, y)))
| ^^^^^^^^^^^^^^ help: remove these parentheses
|
= note: `#[warn(unused_parens)]` on by default
warning: `...` range patterns are deprecated
--> /home/user/game/tcod-rs/src/bindings.rs:43:15
|
43 | x @ 0 ... 66 => Some(unsafe { transmute(x) }),
| ^^^ help: use `..=` for an inclusive range
|
= note: `#[warn(ellipsis_inclusive_range_patterns)]` on by default
warning: use of deprecated item 'std::mem::uninitialized': use `mem::MaybeUninit` instead
--> /home/user/game/tcod-rs/src/input.rs:193:53
|
193 | let mut c_key_state: ffi::TCOD_key_t = unsafe { mem::uninitialized() };
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
warning: use of deprecated item 'std::mem::uninitialized': use `mem::MaybeUninit` instead
--> /home/user/game/tcod-rs/src/input.rs:194:57
|
194 | let mut c_mouse_state: ffi::TCOD_mouse_t = unsafe { mem::uninitialized() };
| ^^^^^^^^^^^^^^^^^^
warning: use of deprecated item 'std::sync::ONCE_INIT': the `new` function is now preferred
--> /home/user/game/tcod-rs/src/namegen.rs:12:1
|
12 | / lazy_static! {
13 | | static ref NAMEGEN_MUTEX: Mutex<()> = Mutex::new(());
14 | | }
| |_^
|
= note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
warning: use of deprecated item 'std::sync::ONCE_INIT': the `new` function is now preferred
--> /home/user/game/tcod-rs/src/namegen.rs:12:1
|
12 | / lazy_static! {
13 | | static ref NAMEGEN_MUTEX: Mutex<()> = Mutex::new(());
14 | | }
| |_^
|
= note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
warning: 6 warnings emitted
The lazy_static ones are curious, maybe it can be solved to switching to a newer version of that.
The men::uninitialized()
warning has become breaking and has already been fixed. Updating lazy_static resolves those warnings and the others are fairly simple fixes. Latest stable rust should now give no warnings on cargo build --all-targets
.
Compiling with the latest Rust releases started showing deprecation warnings like this:
and
The first one is about adding the
dyn
keywoard wherever we use a trait object. E.g.Box<Trait>
should beBox<dyn Trait>
,&Trait
->&dyn Trait
and&mut Trait
->&mut dyn Trait
.The second comes from our bindgen-generated files so we'll probably need to get a newer version of bindgen and regenerate those files.