hunter
hunter copied to clipboard
No method named remove_item
I'm quite new to rust, so sorry if this is problem purely caused by my incompetence.
Still, whenever I try to build this program, I get the following error(s):
$ cargo install --no-default-features hunter
...
Compiling derivative v1.0.4
Compiling strum_macros v0.15.0
Compiling failure v0.1.8
Compiling async_value v0.2.7
error[E0599]: no method named `remove_item` found for struct `Vec<files::File>` in the current scope
--> /home/rw/.cargo/registry/src/github.com-1ecc6299db9ec823/hunter-1.3.5/src/files.rs:520:43
|
520 | .map(|placeholder| self.files.remove_item(&placeholder));
| ^^^^^^^^^^^ method not found in `Vec<files::File>`
error[E0599]: no method named `remove_item` found for struct `Vec<PathBuf>` in the current scope
--> /home/rw/.cargo/registry/src/github.com-1ecc6299db9ec823/hunter-1.3.5/src/files.rs:1079:40
|
1079 | false => { TAGS.write()?.1.remove_item(&self.path); },
| ^^^^^^^^^^^ method not found in `Vec<PathBuf>`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0599`.
error: failed to compile `hunter v1.3.5`, intermediate artifacts can be found at `/tmp/cargo-install3Wenh4`
Caused by:
could not compile `hunter`
To learn more, run the command again with --verbose.
I'm running Arch linux (kernel version 5.10.11), and rustup (1.23.1), and rustup show
shows me I'm using nightly (not using nightly also doesn't work ofc, though that gives a different error):
Default host: x86_64-unknown-linux-gnu
rustup home: /home/rw/.rustup
installed toolchains
--------------------
stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)
active toolchain
----------------
nightly-x86_64-unknown-linux-gnu (default)
rustc 1.51.0-nightly (04caa632d 2021-01-30)
I've ran rustup update
as well.
This error goes away when I apply https://github.com/rabite0/hunter/pull/109, btw.
Thanks for the tip on #109 , for anyone looking for a quick solution: (Also allows you to build without Rust nightly)
git clone https://github.com/06kellyjac/hunter.git
cd hunter
git checkout hunter_rust_stable
cargo install --path .
Any updates ? Still getting this error when compiling.
Arch linux rustc 1.52.0-nightly (8e54a2113 2021-02-13)
Same error when compiling with cargo install --path .
| git checkout hunter_rust_stable
does not work (error: pathspec 'hunter_rust_stable' did not match any file(s) known to git)
Compiling async_value v0.2.7
warning: unnecessary trailing semicolon
--> src/quick_actions.rs:365:51
|
365 | use crate::minibuffer::MiniBufferEvent::*;;
| ^ help: remove this semicolon
|
= note: `#[warn(redundant_semicolons)]` on by default
error[E0599]: no method named `remove_item` found for struct `Vec<files::File>` in the current scope
--> src/files.rs:955:28
|
955 | self.files.remove_item(&placeholder);
| ^^^^^^^^^^^ method not found in `Vec<files::File>`
error: aborting due to previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0599`.
error: could not compile `hunter`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `hunter v1.3.5 (/data/transfer/hunter)`, intermediate artifacts can be found at `/data/transfer/hunter/target`
Caused by:
build failed
@pyramid3d hunter_rust_stable is a branch from another repo, https://github.com/06kellyjac/hunter.git
EDIT: looks like the branch is now hunter_rust_stable_updated
Thanks for the tip on #109 , for anyone looking for a quick solution: (Also allows you to build without Rust nightly)
git clone https://github.com/06kellyjac/hunter.git cd hunter git checkout hunter_rust_stable cargo install --path .
you can one liner it with
cargo install --git https://github.com/06kellyjac/hunter.git --branch hunter_rust_stable_updated
Vec::remove_item
has been deprecated via #73539, this is why it does not work anymore. You can try compiling with an older toolchain like nightly-2020-06-04
. This seems to work on my machine; I just cloned the repository, installed the nightly with rustup
and built the program with a directory override for this particular compiler