Open nbro opened 1 year ago
So, I tried to install the nightly toolchain by doing rustup default nightly
. I then tried with cargo +nightly run --bin quake-client
, and now I get 3 errors
Compiling richter v0.1.0 (C:\Users\me\Desktop\richter)
warning: unused import: `iter::FromIterator`
--> src\client\render\ui\hud.rs:1:33
|
1 | use std::{collections::HashMap, iter::FromIterator};
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `arrayvec::ArrayVec`
--> src\client\render\ui\hud.rs:22:5
|
22 | use arrayvec::ArrayVec;
| ^^^^^^^^^^^^^^^^^^
warning: unused import: `std::cell::RefCell`
--> src\client\render\ui\mod.rs:8:5
|
8 | use std::cell::RefCell;
| ^^^^^^^^^^^^^^^^^^
warning: unused imports: `DynamicUniformBufferBlock`, `QuadUniforms`, `self`, `util::any_slice_as_bytes`
--> src\client\render\ui\mod.rs:19:59
|
19 | quad::{QuadRenderer, QuadRendererCommand, QuadUniforms},
| ^^^^^^^^^^^^
20 | },
21 | uniform::{self, DynamicUniformBufferBlock},
| ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^
...
25 | common::{console::Console, util::any_slice_as_bytes},
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused imports: `InnerSpace`, `Vector2`
--> src\client\render\warp.rs:5:14
|
5 | use cgmath::{InnerSpace, Vector2, Vector3};
| ^^^^^^^^^^ ^^^^^^^
warning: unused imports: `model::Model`, `net::SignOnStage`
--> src\client\render\mod.rs:102:9
|
102 | model::Model,
| ^^^^^^^^^^^^
103 | net::SignOnStage,
| ^^^^^^^^^^^^^^^^
warning: unused import: `InnerSpace`
--> src\client\render\mod.rs:111:19
|
111 | use cgmath::{Deg, InnerSpace, Vector3, Zero};
| ^^^^^^^^^^
warning: unused import: `Duration`
--> src\client\render\mod.rs:112:24
|
112 | use chrono::{DateTime, Duration, Utc};
| ^^^^^^^^
warning: unused import: `BufReader`
--> src\client\sound\mod.rs:26:16
|
26 | io::{self, BufReader, Cursor, Read},
| ^^^^^^^^^
warning: unused import: `chrono::Duration`
--> src\common\bsp\load.rs:40:5
|
40 | use chrono::Duration;
| ^^^^^^^^^^^^^^^^
warning: unused import: `std::path::PathBuf`
--> src\common\mod.rs:38:5
|
38 | use std::path::PathBuf;
| ^^^^^^^^^^^^^^^^^^
error[E0635]: unknown feature `drain_filter`
--> src\lib.rs:19:12
|
19 | #![feature(drain_filter)]
| ^^^^^^^^^^^^
error[E0599]: no method named `drain_filter` found for struct `LinkedList` in the current scope
--> src\common\alloc.rs:86:24
|
86 | self.allocated.drain_filter(|k| *k == key);
| ^^^^^^^^^^^^ method not found in `LinkedList<usize>`
error[E0599]: no method named `drain_filter` found for struct `LinkedList` in the current scope
--> src\common\alloc.rs:110:19
|
110 | allocated.drain_filter(|k| {
| ----------^^^^^^^^^^^^ method not found in `LinkedList<usize>`
warning: use of deprecated method `std::error::Error::description`: use the Display impl or to_string()
--> src\common\bsp\mod.rs:173:42
|
173 | BspError::Io(ref err) => err.description(),
| ^^^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
warning: use of deprecated method `std::error::Error::description`: use the Display impl or to_string()
--> src\common\net\mod.rs:98:42
|
98 | NetError::Io(ref err) => err.description(),
| ^^^^^^^^^^^
warning: unreachable expression
--> src\server\mod.rs:956:9
|
954 | todo!("SV_CheckWaterTransition");
| -------------------------------- any code following this expression is unreachable
955 |
956 | Ok(())
| ^^^^^^ unreachable expression
|
= note: `#[warn(unreachable_code)]` on by default
Some errors have detailed explanations: E0599, E0635.
For more information about an error, try `rustc --explain E0599`.
warning: `richter` (lib) generated 14 warnings
error: could not compile `richter` (lib) due to 3 previous errors; 14 warnings emitted
The 3 errors are related to drain_filter
feature/method, which seems to have been renamed https://github.com/rust-lang/rust/issues/43244. The other errors also seem to be related. So, maybe just need to rename the filter in the code to fix this.
It seems that if we replace drain_filter
with extract_if
and assign the result to unnamed variable with let _ = ...
, we are able to compile the code. This needs to be done in src\common\alloc.rs
in 2 places and in src/lib.rs
, which needs to use #![feature(extract_if)]
.
I'm getting the following error when I do
cargo run --bin quake-client
. Before this error, I was getting this error https://github.com/cormac-obrien/richter/issues/56, which I solved by installing ninja withwinget
. Before that, I was getting a similar error, which I solved by install cmake. I am on Windows 11.