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

cargo install --locked doesn't work for 1.31.2 #18151

Closed
mvolfik opened this issue Mar 12, 2023 · 4 comments
Closed

cargo install --locked doesn't work for 1.31.2 #18151

mvolfik opened this issue Mar 12, 2023 · 4 comments

Comments

@mvolfik
Copy link

mvolfik commented Mar 12, 2023

I just tried installing Deno with cargo install --locked deno on my Linux Mint system, and it failed with the following error:

error: `impl` item signature doesn't match `trait` item signature
  --> /home/username/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-plugin-json-0.17.0/src/generation/token_finder.rs:42:3
   |
42 |   fn get_token_at_index(&self, index: usize) -> &'a TokenAndRange {
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&'1 LocalTokenCollection<'a>, usize) -> &'a TokenAndRange<'1>`
   |
  ::: /home/username/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-core-0.60.0/src/formatting/tokens/token_finder.rs:13:3
   |
13 |   fn get_token_at_index(&self, index: usize) -> &'a Self::TToken;
   |   --------------------------------------------------------------- expected `fn(&'1 LocalTokenCollection<'a>, usize) -> &'a TokenAndRange<'a>`
   |
   = note: expected signature `fn(&'1 LocalTokenCollection<'a>, usize) -> &'a TokenAndRange<'a>`
              found signature `fn(&'1 LocalTokenCollection<'a>, usize) -> &'a TokenAndRange<'1>`
   = help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait`
   = help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output

error: could not compile `dprint-plugin-json` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `deno v1.31.2`, intermediate artifacts can be found at `/tmp/cargo-installUtEg8U`
@dsherret
Copy link
Member

What version of Rust are you using? That code hasn't changed in a long time.

@mvolfik
Copy link
Author

mvolfik commented Mar 12, 2023

rustup update shows this:

   stable-x86_64-unknown-linux-gnu unchanged - rustc 1.68.0 (2c8cc3432 2023-03-06)
  nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.70.0-nightly (8a73f50d8 2023-03-11)

Edit to add: rustup default says stable, which is what I suppose is used for global installs.

@mvolfik
Copy link
Author

mvolfik commented Mar 12, 2023

Hmm, turns out that I was installing it while cd'd into a folder which had cargo override set nightly. When I ran cargo install --locked from home directory, it worked. Sorry for confusion, this unexpected behavior is already reported in rust-lang/cargo#7312

@mvolfik mvolfik closed this as completed Mar 12, 2023
@dsherret
Copy link
Member

It's no problem! That's annoying cargo install behaviour.

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

2 participants