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

overflow evaluating the requirement <I as ToOwned>::Owned normalizes-to _ with -Znew-solver and winnow #119608

Closed
weiznich opened this issue Jan 5, 2024 · 1 comment · Fixed by #122171
Labels
A-trait-system Area: Trait system C-bug Category: This is a bug. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Comments

@weiznich
Copy link
Contributor

weiznich commented Jan 5, 2024

I tried this code:

cargo +nightly create test_winnow
cd test_winnow
cargo +nightly add winnow@0.5.32
RUSTFLAGS="-Znext-solver" cargo +nightly check

I expected to see this happen: Code compiles without error as it does without -Znext-solver

Instead, this happened: Compilation fails

error[E0275]: overflow evaluating the requirement `<I as ToOwned>::Owned normalizes-to _`
   --> /home/weiznich/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winnow-0.5.32/src/error.rs:368:32
    |
368 |     pub fn into_owned(self) -> InputError<<I as ToOwned>::Owned> {
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`winnow`)

error[E0275]: overflow evaluating the requirement `<I as ToOwned>::Owned normalizes-to _`
   --> /home/weiznich/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winnow-0.5.32/src/error.rs:753:32
    |
753 |     pub fn into_owned(self) -> TreeError<<I as ToOwned>::Owned, C> {
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`winnow`)

error[E0275]: overflow evaluating the requirement `<I as ToOwned>::Owned normalizes-to _`
   --> /home/weiznich/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winnow-0.5.32/src/error.rs:997:32
    |
997 |     pub fn into_owned(self) -> VerboseError<<I as ToOwned>::Owned, C> {
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`winnow`)

error[E0311]: the associated type `<(I, usize) as Stream>::Checkpoint` may not live long enough
     |
help: consider adding an explicit lifetime bound
    -->  /home/weiznich/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winnow-0.5.32/src/stream/mod.rs:1392:19
     |
1392 |     fn offset_from<'a>(&self, other: &'a <(I, usize) as Stream>::Checkpoint) -> usize where <(I, usize) as Stream>::Checkpoint: 'a {
     |                   ++++                ++                                              ++++++++++++++++++++++++++++++++++++++++++++

error[E0311]: the associated type `<Located<I> as Stream>::Checkpoint` may not live long enough
     |
help: consider adding an explicit lifetime bound
    -->  /home/weiznich/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winnow-0.5.32/src/stream/mod.rs:1412:19
     |
1412 |     fn offset_from<'a>(&self, other: &'a <Located<I> as Stream>::Checkpoint) -> usize where <Located<I> as Stream>::Checkpoint: 'a {
     |                   ++++                ++                                              ++++++++++++++++++++++++++++++++++++++++++++

error[E0311]: the associated type `<Stateful<I, S> as Stream>::Checkpoint` may not live long enough
     |
help: consider adding an explicit lifetime bound
    -->  /home/weiznich/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winnow-0.5.32/src/stream/mod.rs:1434:19
     |
1434 |     fn offset_from<'a>(&self, other: &'a <Stateful<I, S> as Stream>::Checkpoint) -> usize where <Stateful<I, S> as Stream>::Checkpoint: 'a {
     |                   ++++                ++                                                  ++++++++++++++++++++++++++++++++++++++++++++++++

error[E0311]: the associated type `<Partial<I> as Stream>::Checkpoint` may not live long enough
     |
help: consider adding an explicit lifetime bound
    -->  /home/weiznich/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winnow-0.5.32/src/stream/mod.rs:1454:19
     |
1454 |     fn offset_from<'a>(&self, other: &'a <Partial<I> as Stream>::Checkpoint) -> usize where <Partial<I> as Stream>::Checkpoint: 'a {
     |                   ++++                ++                                              ++++++++++++++++++++++++++++++++++++++++++++

Some errors have detailed explanations: E0275, E0311.
For more information about an error, try `rustc --explain E0275`.

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

@weiznich weiznich added the C-bug Category: This is a bug. label Jan 5, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 5, 2024
@Noratrieb Noratrieb added A-trait-system Area: Trait system WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jan 5, 2024
@compiler-errors compiler-errors added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Jan 5, 2024
@Skepfyr
Copy link
Contributor

Skepfyr commented Jan 6, 2024

Smallest MCVE I could get to:

pub trait Foo {}

pub trait Bar {
    type Assoc;
}

impl<T: Foo> Bar for T {
    type Assoc = T;
}

pub fn foo<I>(_input: <I as Bar>::Assoc)
where
    I: Bar,
    <I as Bar>::Assoc: Foo,
{
}

@Noratrieb Noratrieb removed the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Jan 6, 2024
@bors bors closed this as completed in 9829ff6 Mar 8, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 8, 2024
Rollup merge of rust-lang#122171 - compiler-errors:next-solver-tests, r=lcnr

Add some new solver tests

Fixes rust-lang#119607
Fixes rust-lang#119608

r? lcnr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trait-system Area: Trait system C-bug Category: This is a bug. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants