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

New overflow error while compiling wundergraph #104322

Closed
weiznich opened this issue Nov 12, 2022 · 7 comments
Closed

New overflow error while compiling wundergraph #104322

weiznich opened this issue Nov 12, 2022 · 7 comments
Labels
C-bug Category: This is a bug. P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@weiznich
Copy link
Contributor

Code

I tried this code:

git clone https://github.com/weiznich/wundergraph 
cd wundergraph
git checkout 5752de6   
cd wundergraph # That one is important as well
cargo +stable check

I expected to see this happen: Code compiles, is it does with rust 1.64
Instead, this happened: Compiler emits new overflow error

error[E0275]: overflow evaluating the requirement `<R as HasTable>::Table`
  --> wundergraph/src/query_builder/mutations/delete.rs:35:15
   |
35 |     R::Table: HandleDelete<R, D, DB, Ctx> + 'static,
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`wundergraph`)
   = note: required for `<<R as HasTable>::Table as AsQuery>::Query` to implement `FilterDsl<_>`
note: required for `<R as HasTable>::Table` to implement `HandleDelete<R, D, DB, Ctx>`
  --> wundergraph/src/query_builder/mutations/delete.rs:69:24
   |
69 | impl<L, K, DB, Ctx, T> HandleDelete<L, K, DB, Ctx> for T
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^     ^

error[E0275]: overflow evaluating the requirement `<Self as AsQuery>::Query`
   |
   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`wundergraph`)
   = note: required for `Self` to implement `FilterDsl<_>`
note: required for `Self` to implement `HandleDelete<L, K, DB, Ctx>`
  --> wundergraph/src/query_builder/mutations/delete.rs:69:24
   |
69 | impl<L, K, DB, Ctx, T> HandleDelete<L, K, DB, Ctx> for T
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^     ^

error[E0275]: overflow evaluating the requirement `<R as HasTable>::Table`
  --> wundergraph/src/query_builder/mutations/update.rs:30:15
   |
30 |     R::Table: HandleUpdate<R, U, DB, Ctx> + 'static,
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`wundergraph`)
   = note: required for `<<R as HasTable>::Table as AsQuery>::Query` to implement `FilterDsl<_>`
note: required for `<R as HasTable>::Table` to implement `HandleUpdate<R, U, DB, Ctx>`
  --> wundergraph/src/query_builder/mutations/update.rs:68:24
   |
68 | impl<L, U, DB, Ctx, T> HandleUpdate<L, U, DB, Ctx> for T
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^     ^

error[E0275]: overflow evaluating the requirement `<Self as AsQuery>::Query`
   |
   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`wundergraph`)
   = note: required for `Self` to implement `FilterDsl<_>`
note: required for `Self` to implement `HandleUpdate<L, U, DB, Ctx>`
  --> wundergraph/src/query_builder/mutations/update.rs:68:24
   |
68 | impl<L, U, DB, Ctx, T> HandleUpdate<L, U, DB, Ctx> for T
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^     ^

For more information about this error, try `rustc --explain E0275`.
error: could not compile `wundergraph` due to 4 previous errors

Version it worked on

It most recently worked on: 1.64

Version with regression

rustc --version --verbose:

rustc 1.65.0 (897e37553 2022-11-02)
binary: rustc
commit-hash: 897e37553bba8b42751c67658967889d11ecd120
commit-date: 2022-11-02
host: x86_64-unknown-linux-gnu
release: 1.65.0
LLVM version: 15.0.0

@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged

@weiznich weiznich added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Nov 12, 2022
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. and removed regression-untriaged Untriaged performance or correctness regression. labels Nov 12, 2022
@weiznich
Copy link
Contributor Author

weiznich commented Nov 12, 2022

cargo bisect-rust points to the following says that the regression was introduced in nightly-2022-08-23
It points to the following commit range: c0941df to 015a824

Github compare view

@compiler-errors
Copy link
Member

Very likely to have regressed in #100757, thus related to #103274 probably.

@weiznich
Copy link
Contributor Author

As #103274 was reported before the release of 1.65 as regression: Are there any plans to fix this or is this expected breakage due to a "bug-fix"?

@apiraino
Copy link
Contributor

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 Nov 23, 2022
bors added a commit to rust-lang-ci/rust that referenced this issue Nov 24, 2022
…rors

Reverts check done by rust-lang#100757

As my `fix` caused more issues than it resolved it's better to revert it.
( rust-lang#103274 rust-lang#104322 rust-lang#104606)

r? `@compiler-errors`

Reopens rust-lang#95134
@weiznich
Copy link
Contributor Author

@compiler-errors This code reproduces the issue. I'm not sure if that's the most minimal version you can get, but at least it's nothing that depends on external crates:

use mini_diesel::*;

pub trait HandleDelete<K> {}

pub fn handle_delete<D, R>()
where
    R: HasTable,
    R::Table: HandleDelete<D> + 'static,
{
}

impl<K, T> HandleDelete<K> for T
where
    T: Table + HasTable<Table = T> + 'static,
    K: 'static,
    &'static K: Identifiable<Table = T>,
    T::PrimaryKey: EqAll<<&'static K as Identifiable>::Id>,
    T::Query: FilterDsl<<T::PrimaryKey as EqAll<<&'static K as Identifiable>::Id>>::Output>,
    Filter<T::Query, <T::PrimaryKey as EqAll<<&'static K as Identifiable>::Id>>::Output>:
        IntoUpdateTarget<Table = T>,
{
}

mod mini_diesel {
    pub trait HasTable {
        type Table: Table;
    }

    pub trait Identifiable: HasTable {
        type Id;
    }

    pub trait EqAll<Rhs> {
        type Output;
    }

    pub trait IntoUpdateTarget: HasTable {
        type WhereClause;
    }

    pub trait Query {
        type SqlType;
    }

    pub trait AsQuery {
        type Query: Query;
    }
    impl<T: Query> AsQuery for T {
        type Query = Self;
    }

    pub trait FilterDsl<Predicate> {
        type Output;
    }

    impl<T, Predicate> FilterDsl<Predicate> for T
    where
        T: Table,
        T::Query: FilterDsl<Predicate>,
    {
        type Output = Filter<T::Query, Predicate>;
    }

    pub trait QuerySource {
        type FromClause;
    }

    pub trait Table: QuerySource + AsQuery + Sized {
        type PrimaryKey;
    }

    pub type Filter<Source, Predicate> = <Source as FilterDsl<Predicate>>::Output;
}

Can you give some pointer where that should be added as regression test?

@compiler-errors
Copy link
Member

Thanks @weiznich, please add it as a UI test: https://rustc-dev-guide.rust-lang.org/tests/ui.html

Somewhere in like src/test/ui/traits or src/test/ui/associated-types or something like that.

weiznich added a commit to weiznich/rust that referenced this issue Nov 30, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 30, 2022
…2, r=compiler-errors

Add a regression test for rust-lang#104322

r? `@compiler-errors`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 30, 2022
…2, r=compiler-errors

Add a regression test for rust-lang#104322

r? ``@compiler-errors``
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 1, 2022
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#103065 (rustdoc-json: Document and Test that args can be patterns.)
 - rust-lang#104865 (Don't overwrite local changes when updating submodules)
 - rust-lang#104895 (Avoid Invalid code suggested when encountering unsatisfied trait bounds in derive macro code)
 - rust-lang#105063 (Rustdoc Json Tests: Don't assume that core::fmt::Debug will always have one item.)
 - rust-lang#105064 (rustdoc: add comment to confusing CSS `main { min-width: 0 }`)
 - rust-lang#105074 (Add Nicholas Bishop to `.mailmap`)
 - rust-lang#105081 (Add a regression test for rust-lang#104322)
 - rust-lang#105086 (rustdoc: clean up sidebar link CSS)
 - rust-lang#105091 (add Tshepang Mbambo to .mailmap)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@pnkfelix pnkfelix added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 9, 2022
@pnkfelix
Copy link
Member

pnkfelix commented Dec 9, 2022

resolved by PR #104610 and regression test added in PR #105081 (part of rollup PR #105095)

@pnkfelix pnkfelix closed this as completed Dec 9, 2022
Aaron1011 pushed a commit to Aaron1011/rust that referenced this issue Jan 6, 2023
…rors

Reverts check done by rust-lang#100757

As my `fix` caused more issues than it resolved it's better to revert it.
( rust-lang#103274 rust-lang#104322 rust-lang#104606)

r? `@compiler-errors`

Reopens rust-lang#95134
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-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants