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

nightly-2024-04-05 regression: error[E0275]: overflow evaluating the requirement #123573

Closed
stepancheg opened this issue Apr 6, 2024 · 5 comments · Fixed by #123594
Closed

nightly-2024-04-05 regression: error[E0275]: overflow evaluating the requirement #123573

stepancheg opened this issue Apr 6, 2024 · 5 comments · Fixed by #123594
Labels
C-bug Category: This is a bug. P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@stepancheg
Copy link
Contributor

stepancheg commented Apr 6, 2024

Code

Sorry, I don't have simple code to reproduce the issue, because the project is large.

The repro is this:

$ git clone https://github.com/facebook/starlark-rust

$ git co 96a2bf3d164d99cccc6cf330433d770e7d01b15a  # Latest revision

$ cargo +nightly-2024-04-05-aarch64-apple-darwin test -p starlark --lib --no-run

This works (warnings are unrelated)

$ cargo +nightly-2024-04-06-aarch64-apple-darwin test -p starlark --lib --no-run

...

error[E0275]: overflow evaluating the requirement `&_: StarlarkTypeRepr`
    |
    = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`starlark`)
note: required for `&[_]` to implement `StarlarkTypeRepr`
   --> starlark/src/values/types/list/value.rs:251:17
    |
251 | impl<'a, V: 'a> StarlarkTypeRepr for &'a [V]
    |                 ^^^^^^^^^^^^^^^^     ^^^^^^^
252 | where
253 |     &'a V: StarlarkTypeRepr,
    |            ---------------- unsatisfied trait bound introduced here
    = note: 126 redundant requirements hidden
    = note: required for `&[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[...]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]` to implement `StarlarkTypeRepr`
    = note: the full name for the type has been written to '/Users/nga/devel/starlark-rust/target/debug/deps/starlark-e78de373a7652cbb.long-type-11371795697589288004.txt'

Contents of the mentioned file is:

&[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

I tried increasing #![recursion_limit = "256"], did not help.

Version it worked on

$ cargo +nightly-2024-04-05-aarch64-apple-darwin --version
cargo 1.79.0-nightly (0637083df 2024-04-02)
$ rustc +nightly-2024-04-05-aarch64-apple-darwin --version
rustc 1.79.0-nightly (385fa9d84 2024-04-04)

Also works on stable.

Version with regression

$ cargo +nightly-2024-04-06-aarch64-apple-darwin --version
cargo 1.79.0-nightly (0637083df 2024-04-02)
$ rustc +nightly-2024-04-06-aarch64-apple-darwin --version
rustc 1.79.0-nightly (9d79cd5f7 2024-04-05)

This may be duplicate of #123493 because timing.

@stepancheg stepancheg added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Apr 6, 2024
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 6, 2024
@stepancheg stepancheg changed the title nightly-2024-04-05: error[E0275]: overflow evaluating the requirement nightly-2024-04-05 regression: error[E0275]: overflow evaluating the requirement Apr 6, 2024
@SergioBenitez
Copy link
Contributor

This is also affecting diesel:

error[E0275]: overflow evaluating the requirement `(&_, &_, &_, ..., ..., ...): diesel::Insertable<...>`
  |
  = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`rust_out`)
  = note: required for `&(_, _, _, _, _, _)` to implement `diesel::Insertable<table>`
  = note: 127 redundant requirements hidden
  = note: required for `(&((..., ..., ..., ..., ..., ...), ..., ..., ..., ..., ...), ..., ..., ..., ..., ...)` to implement `diesel::Insertable<table>`
  = note: the full name for the type has been written to '/tmp/rustdoctestmnF1pz/rust_out.long-type-2635572469679000095.txt'
  = note: consider using `--verbose` to print the full type name to the console

error: aborting due to 1 previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0275`.
Couldn't compile the test.

failures:
    contrib/db_pools/lib/src/diesel.rs - diesel (line 26)

@dtolnay
Copy link
Member

dtolnay commented Apr 7, 2024

Using the starlark-rust repro, this bisects to #122747. @Urgau @lcnr

@dtolnay dtolnay added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed regression-untriaged Untriaged performance or correctness regression. labels Apr 7, 2024
@lcnr
Copy link
Contributor

lcnr commented Apr 7, 2024

overflow is fatal in the old trait solver, so by proving additional goals, especially if they have inference variables, we can end up with new sources of overflow causing an error.

the most straightforward fix is to use the new solver for this lint 😁 given that the lint uses an empty environment it uses pretty much the same parts of the solver as coherence so it should already be ready for that

bors added a commit to rust-lang-ci/rust that referenced this issue Apr 8, 2024
…w, r=<try>

Fix trait solver overflow with `non_local_definitions` lint

This PR fixes the trait solver overflow with the `non_local_definitions` lint reported in rust-lang#123573 using the suggestion from `@lcnr:` rust-lang#123573 (comment) to use the next trait solver.

~~I have not (yet) tried to create a minimized repro~~ ``@compiler-errors`` did the minimization (thanks you) but I have manually tested on the `starlark-rust` project that it fixes the issue.

Fixes rust-lang#123573
r? `@lcnr`
@apiraino
Copy link
Contributor

apiraino commented Apr 8, 2024

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-high

@rustbot rustbot added P-high High priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Apr 8, 2024
@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 8, 2024
@rcorre
Copy link
Contributor

rcorre commented Apr 9, 2024

I have a somewhat minimal repro, it has a lot of deps (via bevy) but not much code:
example.zip

use bevy::{gltf::GltfMesh, prelude::*};

fn main() {
    App::new().add_plugins(DefaultPlugins).run();
}

fn parse(gltf_meshes: Res<Assets<GltfMesh>>) {
    for (transform, aabb) in &gltf_meshes {}
}

Where gltf_meshes is not something (I think) that can be decomposed into a tuple.

@bors bors closed this as completed in f22a0c2 Apr 21, 2024
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Apr 23, 2024
Fix trait solver overflow with `non_local_definitions` lint

This PR fixes the trait solver overflow with the `non_local_definitions` lint reported in rust-lang/rust#123573 using the suggestion from `@lcnr:` rust-lang/rust#123573 (comment) to use the next trait solver.

~~I have not (yet) tried to create a minimized repro~~ ``@compiler-errors`` did the minimization (thanks you) but I have manually tested on the `starlark-rust` project that it fixes the issue.

Fixes #123573
r? `@lcnr`
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 27, 2024
Fix trait solver overflow with `non_local_definitions` lint

This PR fixes the trait solver overflow with the `non_local_definitions` lint reported in rust-lang/rust#123573 using the suggestion from `@lcnr:` rust-lang/rust#123573 (comment) to use the next trait solver.

~~I have not (yet) tried to create a minimized repro~~ ``@compiler-errors`` did the minimization (thanks you) but I have manually tested on the `starlark-rust` project that it fixes the issue.

Fixes #123573
r? `@lcnr`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants