Skip to content

Handle recursive instantiation of drop shims #67731

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

Merged
merged 1 commit into from
Jan 17, 2020

Conversation

matthewjasper
Copy link
Contributor

The compiler used to hang because the recursion limit was never hit.

@rust-highfive
Copy link
Contributor

r? @zackmdavis

(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 Dec 30, 2019
@matthewjasper
Copy link
Contributor Author

r? @eddyb since they reviewed the PR that introduced this.

@rust-highfive rust-highfive assigned eddyb and unassigned zackmdavis Dec 30, 2019
@@ -434,7 +434,7 @@ fn check_recursion_limit<'tcx>(
// Code that needs to instantiate the same function recursively
// more than the recursion limit is assumed to be causing an
// infinite expansion.
if recursion_depth > *tcx.sess.recursion_limit.get() {
if adjusted_recursion_depth > *tcx.sess.recursion_limit.get() {
let error = format!("reached the recursion limit while instantiating `{}`", instance);
if let Some(hir_id) = tcx.hir().as_local_hir_id(def_id) {
tcx.sess.span_fatal(tcx.hir().span(hir_id), &error);
Copy link
Member

Choose a reason for hiding this comment

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

I feel like we should just search for hir().span and replace as many of them as possible...
(this should be tcx.def_span(def_id) and not check for def_id being local, but always use span_fatal).

@eddyb
Copy link
Member

eddyb commented Jan 16, 2020

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 16, 2020

📌 Commit 4843f22 has been approved by eddyb

@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 Jan 16, 2020
@bors
Copy link
Collaborator

bors commented Jan 17, 2020

⌛ Testing commit 4843f22 with merge 91ff7c6...

bors added a commit that referenced this pull request Jan 17, 2020
Handle recursive instantiation of drop shims

The compiler used to hang because the recursion limit was never hit.
@bors
Copy link
Collaborator

bors commented Jan 17, 2020

☀️ Test successful - checks-azure
Approved by: eddyb
Pushing 91ff7c6 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 17, 2020
@bors bors merged commit 4843f22 into rust-lang:master Jan 17, 2020
@rust-highfive
Copy link
Contributor

📣 Toolstate changed by #67731!

Tested on commit 91ff7c6.
Direct link to PR: #67731

💔 rls on linux: test-pass → test-fail (cc @Xanewok, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Jan 17, 2020
Tested on commit rust-lang/rust@91ff7c6.
Direct link to PR: <rust-lang/rust#67731>

💔 rls on linux: test-pass → test-fail (cc @Xanewok, @rust-lang/infra).
@matthewjasper matthewjasper deleted the drop-in-place-reclimit branch January 17, 2020 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants