Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No method named remove_item #118

Open
rien333 opened this issue Jan 31, 2021 · 7 comments
Open

No method named remove_item #118

rien333 opened this issue Jan 31, 2021 · 7 comments

Comments

@rien333
Copy link

rien333 commented Jan 31, 2021

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.

@rien333
Copy link
Author

rien333 commented Feb 1, 2021

This error goes away when I apply #109, btw.

@MooseV2
Copy link

MooseV2 commented Feb 9, 2021

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 .

@vaheqelyan
Copy link

Any updates ? Still getting this error when compiling.
Arch linux rustc 1.52.0-nightly (8e54a2113 2021-02-13)

@pyramid3d
Copy link

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

@lisael
Copy link

lisael commented Mar 4, 2021

@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

@cryolithic
Copy link

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

@afd-bai
Copy link

afd-bai commented Sep 6, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants