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

[docs] recommend or suggest --locked on failed compilatoin #766

Open
totallyuniquelily opened this issue Aug 27, 2024 · 0 comments
Open

Comments

@totallyuniquelily
Copy link

At the present, attempting to install crev with cargo install cargo-crev will fail, with the following error (in a dependency).

error message (only included for completeness)
error[E0283]: type annotations needed
  --> /home/neko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-credentials-0.22.0/src/program/mod.rs:83:63
   |
83 |                 gix_command::prepare(gix_path::from_bstr(args.as_ref()).into_owned())
   |                                                               ^^^^^^
   |
   = note: multiple `impl`s satisfying `BString: AsRef<_>` found in the `bstr` crate:
           - impl AsRef<BStr> for BString;
           - impl AsRef<[u8]> for BString;
help: try using a fully qualified path to specify the expected types
   |
83 |                 gix_command::prepare(gix_path::from_bstr(<BString as AsRef<T>>::as_ref(&args)).into_owned())
   |                                                          +++++++++++++++++++++++++++++++    ~

error[E0283]: type annotations needed
   --> /home/neko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-credentials-0.22.0/src/program/mod.rs:83:38
    |
83  |                 gix_command::prepare(gix_path::from_bstr(args.as_ref()).into_owned())
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for reference `&_`
    |
    = note: multiple `impl`s satisfying `Cow<'_, BStr>: From<&_>` found in the `bstr` crate:
            - impl<'a> From<&'a BStr> for Cow<'a, BStr>;
            - impl<'a> From<&'a BString> for Cow<'a, BStr>;
    = note: required for `&_` to implement `Into<Cow<'_, BStr>>`
note: required by a bound in `from_bstr`
   --> /home/neko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-path-0.10.10/src/convert.rs:135:34
    |
135 | pub fn from_bstr<'a>(input: impl Into<Cow<'a, BStr>>) -> Cow<'a, Path> {
    |                                  ^^^^^^^^^^^^^^^^^^^ required by this bound in `from_bstr`

   Compiling toml_datetime v0.6.8
For more information about this error, try `rustc --explain E0283`.
error: could not compile `gix-credentials` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...

However, this is easily resolved by using cargo install --locked cargo-crev. Neither install or build instructions mention --locked, and it may not be obvious to users that it exists. So, the request is to either recommend it as the default in getting started, or mention it as an option in the case of compilation errors (depending on how desirable or undesirable getting the newest version of dependencies is).

@totallyuniquelily totallyuniquelily changed the title [DOCS] recommend or suggest --locked on failed compilatoin [docs] recommend or suggest --locked on failed compilatoin Aug 27, 2024
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

1 participant