-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add recursion limit to inhabitedness check #39680
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
Add recursion limit to inhabitedness check #39680
Conversation
Fixes rust-lang#39489. Add test aswell.
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
src/librustc/ty/inhabitedness/mod.rs
Outdated
tcx: TyCtxt<'a, 'gcx, 'tcx>) -> DefIdForest | ||
{ | ||
recursion_depth += 1; | ||
if recursion_depth >= ARBITRARY_RECURSION_LIMIT { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We normally use the tcx.sess.recursion_limit
and emit a fatal error when it is exceeded (grep for that for usage examples).
I've refactored the inhabitedness checking code a bit because there seemed to be a fairly narrow band of appropriate values for the recursion limit if it was implemented naively. |
r? @arielb1 |
@bors r+ |
📌 Commit 347bc77 has been approved by |
⌛ Testing commit 347bc77 with merge 0584f00... |
💔 Test failed - status-travis |
@bors: retry
* network error
…On Sat, Feb 11, 2017 at 6:42 AM, bors ***@***.***> wrote:
💔 Test failed - status-travis
<https://travis-ci.org/rust-lang/rust/builds/200629829>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#39680 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD95CnuzC9tlmv8JtpoRXDc7oBJsGi7ks5rbayjgaJpZM4L75dW>
.
|
⌛ Testing commit 347bc77 with merge 94ea562... |
💔 Test failed - status-appveyor |
@bors: retry
…On Sat, Feb 11, 2017 at 11:01 AM, bors ***@***.***> wrote:
💔 Test failed - status-appveyor
<https://ci.appveyor.com/project/rust-lang/rust/build/1.0.1909>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#39680 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD95B1AhGOt-V6kUJbQITV4MhBHAZyvks5rbel7gaJpZM4L75dW>
.
|
…elb1 Add recursion limit to inhabitedness check Fixes #39489. Add test aswell.
☀️ Test successful - status-appveyor, status-travis |
Fixes #39489.
Add test aswell.