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

[E0391] Detected type dependency cycle #2561

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

MahadMuhammad
Copy link
Contributor

trait cycle detected - E0391

This errorcode & message emits when cycle
detected when computing the super predicates
of x which requires computing the super
predicates of y, which again requires
computing the super predicates of x,
completing the cycle.

Code Tested:

~/gccrs/gcc/testsuite/rust/compile/trait-cycle.rs:1:5: error: cycle detected when computing the super predicates of ‘FirstTrait[E0391]
    1 | pub trait FirstTrait: SecondTrait {}
      |     ^~~~~
~/gccrs/gcc/testsuite/rust/compile/trait-cycle.rs:3:5: error: cycle detected when computing the super predicates of ‘SecondTrait[E0391]
    3 | pub trait SecondTrait: FirstTrait {}
      |     ^~~~~


gcc/rust/ChangeLog:

* typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): Updated errorcode & more userfriendly message.

gcc/testsuite/ChangeLog:

* rust/compile/issue-1589.rs: Updated comment for dejagnu.
* rust/compile/trait-cycle.rs: New relevant test.

This errorcode & message emits when cycle
detected when computing the super predicates
of `x` which requires computing the super
predicates of `y`, which again requires
computing the super predicates of `x`,
completing the cycle.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait):
	Updated errorcode & more userfriendly message.

gcc/testsuite/ChangeLog:

	* rust/compile/issue-1589.rs: Updated comment for dejagnu.
	* rust/compile/trait-cycle.rs: New relevant test.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@philberty philberty added this pull request to the merge queue Aug 17, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 17, 2023
@CohenArthur CohenArthur added this pull request to the merge queue Aug 17, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 17, 2023
@CohenArthur CohenArthur added this pull request to the merge queue Aug 17, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 17, 2023
@CohenArthur CohenArthur added this pull request to the merge queue Aug 18, 2023
Merged via the queue into Rust-GCC:master with commit 879a62f Aug 18, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants