-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Conversation
r? @zackmdavis (rust_highfive has picked a reviewer for you, use r? to override) |
r? @eddyb since they reviewed the PR that introduced this. |
@@ -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); |
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.
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
).
@bors r+ |
📌 Commit 4843f22 has been approved by |
Handle recursive instantiation of drop shims The compiler used to hang because the recursion limit was never hit.
☀️ Test successful - checks-azure |
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).
The compiler used to hang because the recursion limit was never hit.