-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Endless recursion while evaluating trait requirements #85063
Labels
A-trait-system
Area: Trait system
C-bug
Category: This is a bug.
P-medium
Medium priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
tmandry
added
A-trait-system
Area: Trait system
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
May 8, 2021
Assigning priority as discussed in the Zulip thread of the Prioritization Working Group. @rustbot label -I-prioritize +P-medium |
rustbot
added
P-medium
Medium priority
and removed
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
labels
May 13, 2021
Here's an URLO post that may contain another repro for this bug. |
This also fails on stable 1.55: trait Foo { fn foo(self); }
struct S;
impl Foo for &S { fn foo(self) {} } // just to prove there is a way to bottom out
impl<'a, T> Foo for &'a Vec<T> where &'a T: Foo {
fn foo(self) {}
}
fn array<'a, T>(a: &'a [T]) where &'a T: Foo {}
pub fn f() {
let g = [1, 2, 3];
array(&g);
} |
Related: #39959 |
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.
P-medium
Medium priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following should compile successfully, but instead rustc chases requirements on
&Vec<_>
,&Vec<Vec<_>>
, etc. until the recursion limit is exhausted. Increasing the limit does not help.It gives:
RUST_BACKTRACE=1 rustc bug.rs --crate-type=lib -Ztreat-err-as-bug=1
:Backtrace
Meta
This is what I used for the backtrace. I've reproduced the error in many versions though, so I don't think it's environment specific or a recent regression.
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: