GitoxideLabs / gitoxide

An idiomatic, lean, fast & safe pure Rust implementation of Git
Apache License 2.0
8.91k stars 303 forks source link

gitoxide fails to compile with bstr 1.9.2 #1467

Closed epage closed 2 months ago

epage commented 2 months ago

Current behavior 😯

$ cargo check
    Checking gix-date v0.8.6
    Checking gix-credentials v0.24.2
error[E0283]: type annotations needed
  --> /home/epage/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-credentials-0.24.2/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/epage/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-credentials-0.24.2/src/program/mod.rs:83:3
8
    |
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/epage/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-path-0.10.7/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`

    Checking gix-actor v0.31.2
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...

Expected behavior 🤔

Builds

Git behavior

N/A

Steps to reproduce 🕹

$ cd cargo
$ cargo update bstr --precise 1.9.2
epage commented 2 months ago

Closing in favor of #1466