Skip to content

type annotations required with -Znew-solver strsim:0.10.0 #119607

Closed
@weiznich

Description

@weiznich

I tried this code:

cargo +nightly new test_strsim
cd test_strsim
cargo +nightly add [email protected]
RUSTFLAGS="-Znext-solver" cargo +nightly check

I expected to see this happen: Code compiles (as without the -Znew-solver flag)

Instead, this happened: Compilation failed

error[E0282]: type annotations needed
  --> /home/weiznich/.cargo/registry/src/index.crates.io-6f17d22bba15001f/strsim-0.10.0/src/lib.rs:93:13
   |
93 |     for (i, a_elem) in a.into_iter().enumerate() {
   |             ^^^^^^ cannot infer type for associated type `<<&'a Iter1 as IntoIterator>::IntoIter as Iterator>::Item`

error[E0282]: type annotations needed
   --> /home/weiznich/.cargo/registry/src/index.crates.io-6f17d22bba15001f/strsim-0.10.0/src/lib.rs:212:13
    |
212 |     for (i, a_elem) in a.into_iter().enumerate() {
    |             ^^^^^^ cannot infer type for associated type `<<&'a Iter1 as IntoIterator>::IntoIter as Iterator>::Item`

For more information about this error, try `rustc --explain E0282`.

Meta

rustc --version --verbose:

rustc 1.77.0-nightly (f688dd684 2024-01-04)
binary: rustc
commit-hash: f688dd684faca5b31b156fac2c6e0ae81fc9bc90
commit-date: 2024-01-04
host: x86_64-unknown-linux-gnu
release: 1.77.0-nightly
LLVM version: 17.0.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-trait-systemArea: Trait systemC-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleWG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions