Skip to content

toml_edit 0.23.8 breaks cargo 0.92.0 #1074

@dtolnay

Description

@dtolnay

Since #1069, the most recent published version of cargo no longer compiles.

[package]
name = "repro"
edition = "2024"

[dependencies]
cargo = "0.92"
error[E0283]: type annotations needed
   --> $CARGO_HOME/registry/src/index.crates.io-1949cf8c6b5b557f/cargo-0.92.0/src/cargo/util/toml_mut/dependency.rs:439:48
    |
439 |                 table.insert("workspace", true.into());
    |                       ------                   ^^^^
    |                       |
    |                       required by a bound introduced by this call
    |
    = note: cannot satisfy `_: Into<toml_edit::Value>`
note: required by a bound in `toml_edit::InlineTable::insert`
   --> $CARGO_HOME/registry/src/index.crates.io-1949cf8c6b5b557f/toml_edit-0.23.8/src/inline_table.rs:380:22
    |
380 |     pub fn insert<V: Into<Value>>(&mut self, key: impl Into<String>, value: V) -> Option<Value> {
    |                      ^^^^^^^^^^^ required by this bound in `InlineTable::insert`
help: try using a fully qualified path to specify the expected types
    |
439 -                 table.insert("workspace", true.into());
439 +                 table.insert("workspace", <bool as Into<T>>::into(true));
    |
help: consider removing this method call, as the receiver has type `bool` and `bool: Into<toml_edit::Value>` trivially holds
    |
439 -                 table.insert("workspace", true.into());
439 +                 table.insert("workspace", true);
    |

error[E0283]: type annotations needed
   --> $CARGO_HOME/registry/src/index.crates.io-1949cf8c6b5b557f/cargo-0.92.0/src/cargo/util/toml_mut/dependency.rs:448:70
    |
448 |                         table.insert("version", src.version.as_str().into());
    |                                                                      ^^^^
    |
    = note: multiple `impl`s satisfying `_: From<&str>` found in the following crates: `bytes`, `clap_builder`, `prodash`, `winnow`:
            - impl From<&'static str> for StrContextValue;
            - impl From<&'static str> for bytes::bytes::Bytes;
            - impl From<&'static str> for clap::Id;
            - impl From<&'static str> for clap::builder::OsStr;
            - impl From<&'static str> for clap::builder::Str;
            - impl From<&'static str> for clap::builder::StyledStr;
            - impl From<&'static str> for gix::progress::Unit;
    = note: required for `&str` to implement `Into<_>`
help: try using a fully qualified path to specify the expected types
    |
448 -                         table.insert("version", src.version.as_str().into());
448 +                         table.insert("version", <&str as Into<T>>::into(src.version.as_str()));
    |

error[E0283]: type annotations needed
   --> $CARGO_HOME/registry/src/index.crates.io-1949cf8c6b5b557f/cargo-0.92.0/src/cargo/util/toml_mut/dependency.rs:454:55
    |
454 | ...                   table.insert("version", r.into());
    |                                                 ^^^^
    |
    = note: multiple `impl`s satisfying `_: From<&str>` found in the following crates: `bytes`, `clap_builder`, `prodash`, `winnow`:
            - impl From<&'static str> for StrContextValue;
            - impl From<&'static str> for bytes::bytes::Bytes;
            - impl From<&'static str> for clap::Id;
            - impl From<&'static str> for clap::builder::OsStr;
            - impl From<&'static str> for clap::builder::Str;
            - impl From<&'static str> for clap::builder::StyledStr;
            - impl From<&'static str> for gix::progress::Unit;
    = note: required for `&str` to implement `Into<_>`
help: try using a fully qualified path to specify the expected types
    |
454 -                             table.insert("version", r.into());
454 +                             table.insert("version", <&str as Into<T>>::into(r));
    |

error[E0283]: type annotations needed
   --> $CARGO_HOME/registry/src/index.crates.io-1949cf8c6b5b557f/cargo-0.92.0/src/cargo/util/toml_mut/dependency.rs:462:62
    |
462 |                         table.insert("git", src.git.as_str().into());
    |                                                              ^^^^
    |
    = note: multiple `impl`s satisfying `_: From<&str>` found in the following crates: `bytes`, `clap_builder`, `prodash`, `winnow`:
            - impl From<&'static str> for StrContextValue;
            - impl From<&'static str> for bytes::bytes::Bytes;
            - impl From<&'static str> for clap::Id;
            - impl From<&'static str> for clap::builder::OsStr;
            - impl From<&'static str> for clap::builder::Str;
            - impl From<&'static str> for clap::builder::StyledStr;
            - impl From<&'static str> for gix::progress::Unit;
    = note: required for `&str` to implement `Into<_>`
help: try using a fully qualified path to specify the expected types
    |
462 -                         table.insert("git", src.git.as_str().into());
462 +                         table.insert("git", <&str as Into<T>>::into(src.git.as_str()));
    |

error[E0283]: type annotations needed
   --> $CARGO_HOME/registry/src/index.crates.io-1949cf8c6b5b557f/cargo-0.92.0/src/cargo/util/toml_mut/dependency.rs:464:59
    |
464 | ...                   table.insert("branch", branch.into());
    |                                                     ^^^^
    |
    = note: multiple `impl`s satisfying `_: From<&str>` found in the following crates: `bytes`, `clap_builder`, `prodash`, `winnow`:
            - impl From<&'static str> for StrContextValue;
            - impl From<&'static str> for bytes::bytes::Bytes;
            - impl From<&'static str> for clap::Id;
            - impl From<&'static str> for clap::builder::OsStr;
            - impl From<&'static str> for clap::builder::Str;
            - impl From<&'static str> for clap::builder::StyledStr;
            - impl From<&'static str> for gix::progress::Unit;
    = note: required for `&str` to implement `Into<_>`
help: try using a fully qualified path to specify the expected types
    |
464 -                             table.insert("branch", branch.into());
464 +                             table.insert("branch", <&str as Into<T>>::into(branch));
    |

error[E0283]: type annotations needed
   --> $CARGO_HOME/registry/src/index.crates.io-1949cf8c6b5b557f/cargo-0.92.0/src/cargo/util/toml_mut/dependency.rs:467:53
    |
467 | ...                   table.insert("tag", tag.into());
    |                                               ^^^^
    |
    = note: multiple `impl`s satisfying `_: From<&str>` found in the following crates: `bytes`, `clap_builder`, `prodash`, `winnow`:
            - impl From<&'static str> for StrContextValue;
            - impl From<&'static str> for bytes::bytes::Bytes;
            - impl From<&'static str> for clap::Id;
            - impl From<&'static str> for clap::builder::OsStr;
            - impl From<&'static str> for clap::builder::Str;
            - impl From<&'static str> for clap::builder::StyledStr;
            - impl From<&'static str> for gix::progress::Unit;
    = note: required for `&str` to implement `Into<_>`
help: try using a fully qualified path to specify the expected types
    |
467 -                             table.insert("tag", tag.into());
467 +                             table.insert("tag", <&str as Into<T>>::into(tag));
    |

error[E0283]: type annotations needed
   --> $CARGO_HOME/registry/src/index.crates.io-1949cf8c6b5b557f/cargo-0.92.0/src/cargo/util/toml_mut/dependency.rs:470:53
    |
470 | ...                   table.insert("rev", rev.into());
    |                                               ^^^^
    |
    = note: multiple `impl`s satisfying `_: From<&str>` found in the following crates: `bytes`, `clap_builder`, `prodash`, `winnow`:
            - impl From<&'static str> for StrContextValue;
            - impl From<&'static str> for bytes::bytes::Bytes;
            - impl From<&'static str> for clap::Id;
            - impl From<&'static str> for clap::builder::OsStr;
            - impl From<&'static str> for clap::builder::Str;
            - impl From<&'static str> for clap::builder::StyledStr;
            - impl From<&'static str> for gix::progress::Unit;
    = note: required for `&str` to implement `Into<_>`
help: try using a fully qualified path to specify the expected types
    |
470 -                             table.insert("rev", rev.into());
470 +                             table.insert("rev", <&str as Into<T>>::into(rev));
    |

error[E0283]: type annotations needed
   --> $CARGO_HOME/registry/src/index.crates.io-1949cf8c6b5b557f/cargo-0.92.0/src/cargo/util/toml_mut/dependency.rs:473:55
    |
473 | ...                   table.insert("version", r.into());
    |                                                 ^^^^
    |
    = note: multiple `impl`s satisfying `_: From<&str>` found in the following crates: `bytes`, `clap_builder`, `prodash`, `winnow`:
            - impl From<&'static str> for StrContextValue;
            - impl From<&'static str> for bytes::bytes::Bytes;
            - impl From<&'static str> for clap::Id;
            - impl From<&'static str> for clap::builder::OsStr;
            - impl From<&'static str> for clap::builder::Str;
            - impl From<&'static str> for clap::builder::StyledStr;
            - impl From<&'static str> for gix::progress::Unit;
    = note: required for `&str` to implement `Into<_>`
help: try using a fully qualified path to specify the expected types
    |
473 -                             table.insert("version", r.into());
473 +                             table.insert("version", <&str as Into<T>>::into(r));
    |

error[E0283]: type annotations needed
   --> $CARGO_HOME/registry/src/index.crates.io-1949cf8c6b5b557f/cargo-0.92.0/src/cargo/util/toml_mut/dependency.rs:483:52
    |
483 |                         table.insert("registry", r.into());
    |                                                    ^^^^
    |
    = note: multiple `impl`s satisfying `_: From<&str>` found in the following crates: `bytes`, `clap_builder`, `prodash`, `winnow`:
            - impl From<&'static str> for StrContextValue;
            - impl From<&'static str> for bytes::bytes::Bytes;
            - impl From<&'static str> for clap::Id;
            - impl From<&'static str> for clap::builder::OsStr;
            - impl From<&'static str> for clap::builder::Str;
            - impl From<&'static str> for clap::builder::StyledStr;
            - impl From<&'static str> for gix::progress::Unit;
    = note: required for `&str` to implement `Into<_>`
help: try using a fully qualified path to specify the expected types
    |
483 -                         table.insert("registry", r.into());
483 +                         table.insert("registry", <&str as Into<T>>::into(r));
    |

error[E0283]: type annotations needed
   --> $CARGO_HOME/registry/src/index.crates.io-1949cf8c6b5b557f/cargo-0.92.0/src/cargo/util/toml_mut/dependency.rs:488:64
    |
488 |                     table.insert("package", self.name.as_str().into());
    |                                                                ^^^^
    |
    = note: multiple `impl`s satisfying `_: From<&str>` found in the following crates: `bytes`, `clap_builder`, `prodash`, `winnow`:
            - impl From<&'static str> for StrContextValue;
            - impl From<&'static str> for bytes::bytes::Bytes;
            - impl From<&'static str> for clap::Id;
            - impl From<&'static str> for clap::builder::OsStr;
            - impl From<&'static str> for clap::builder::Str;
            - impl From<&'static str> for clap::builder::StyledStr;
            - impl From<&'static str> for gix::progress::Unit;
    = note: required for `&str` to implement `Into<_>`
help: try using a fully qualified path to specify the expected types
    |
488 -                     table.insert("package", self.name.as_str().into());
488 +                     table.insert("package", <&str as Into<T>>::into(self.name.as_str()));
    |

For more information about this error, try `rustc --explain E0283`.
error: could not compile `cargo` (lib) due to 10 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions