Skip to content

Conversation

Aaron1011
Copy link
Contributor

In #72936 (comment),
it was determined that some unusual code could cause rustc to overflow
when evaluating a predicate of the form T: AutoTrait. Even if this is
a bug, it will still be possible to cause overflow through writing
explicit impls of auto traits, just like any other type of impl.

In rustdoc, this overflow can happen simply as a result of defining
certain types, since we will automatically generate and evaluate
auto-trait predicates when generating documentation.

For now, we just ignore overflow during selection if it occurs in
rustdoc. We should probably come up with a better way to handle this -
e.g. rendering some kind of error in the generated documentation.
However, this is a very unusual corner case, and this PR is sufficient
to unblock landing a Chalk update in PR #72936

This adds additional hacks to librustc_trait_selection. The
auto-trait-finding code should probably be completely rewritten, but I
think this is good enough for the time being.

In rust-lang#72936 (comment),
it was determined that some unusual code could cause rustc to overflow
when evaluating a predicate of the form `T: AutoTrait`. Even if this is
a bug, it will still be possible to cause overflow through writing
explicit impls of auto traits, just like any other type of impl.

In rustdoc, this overflow can happen simply as a result of defining
certain types, since we will automatically generate and evaluate
auto-trait predicates when generating documentation.

For now, we just ignore overflow during selection if it occurs in
rustdoc. We should probably come up with a better way to handle this -
e.g. rendering some kind of error in the generated documentation.
However, this is a very unusual corner case, and this PR is sufficient
to unblock landing a Chalk update in PR rust-lang#72936

This adds additional hacks to `librustc_trait_selection`. The
auto-trait-finding code should probably be completely rewritten, but I
think this is good enough for the time being.
@rust-highfive
Copy link
Contributor

r? @estebank

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 14, 2020
@estebank
Copy link
Contributor

I would like there to be a FIXME somewhere (maybe in one of the new fields?) and/or a follow up tracking ticket.

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 15, 2020

📌 Commit 561107c has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 15, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 16, 2020
…stebank

Ignore overflow when finding auto-trait impls in Rustdoc

In rust-lang#72936 (comment),
it was determined that some unusual code could cause rustc to overflow
when evaluating a predicate of the form `T: AutoTrait`. Even if this is
a bug, it will still be possible to cause overflow through writing
explicit impls of auto traits, just like any other type of impl.

In rustdoc, this overflow can happen simply as a result of defining
certain types, since we will automatically generate and evaluate
auto-trait predicates when generating documentation.

For now, we just ignore overflow during selection if it occurs in
rustdoc. We should probably come up with a better way to handle this -
e.g. rendering some kind of error in the generated documentation.
However, this is a very unusual corner case, and this PR is sufficient
to unblock landing a Chalk update in PR rust-lang#72936

This adds additional hacks to `librustc_trait_selection`. The
auto-trait-finding code should probably be completely rewritten, but I
think this is good enough for the time being.
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 16, 2020
…stebank

Ignore overflow when finding auto-trait impls in Rustdoc

In rust-lang#72936 (comment),
it was determined that some unusual code could cause rustc to overflow
when evaluating a predicate of the form `T: AutoTrait`. Even if this is
a bug, it will still be possible to cause overflow through writing
explicit impls of auto traits, just like any other type of impl.

In rustdoc, this overflow can happen simply as a result of defining
certain types, since we will automatically generate and evaluate
auto-trait predicates when generating documentation.

For now, we just ignore overflow during selection if it occurs in
rustdoc. We should probably come up with a better way to handle this -
e.g. rendering some kind of error in the generated documentation.
However, this is a very unusual corner case, and this PR is sufficient
to unblock landing a Chalk update in PR rust-lang#72936

This adds additional hacks to `librustc_trait_selection`. The
auto-trait-finding code should probably be completely rewritten, but I
think this is good enough for the time being.
@Aaron1011
Copy link
Contributor Author

@bors r-

Let's see if #73452 fixes the issue

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 17, 2020
@Aaron1011 Aaron1011 mentioned this pull request Jun 20, 2020
@Aaron1011
Copy link
Contributor Author

Aaron1011 commented Jun 21, 2020

#73452 fixed this issue. I'm going to close this - I may add a less hacky fix for overflow in Rustdoc in a separate PR (maybe a maximum number of iterations?)

@Aaron1011 Aaron1011 closed this Jun 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants