-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Wrap const_eval_stack_frame_limit in a LockCell #56085
Conversation
This allows Miri to set const_eval_stack_frame_limit as needed, while still keeping Session thread-safe
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
r? @Zoxc |
This doesn't look correct since Miri could be used on multiple threads. |
Miri currently doesn't support multiple threads. I don't believe anyone is currently working on adding multithreading support, so I think this change should be fine for the forseeable future. |
Miri can't emulate multiple threads, but you can have Miri executions on multiple threads in rustc currently. |
Miri can be run from multiple rustc threads
@Zoxc: I've switched const_eval_stack_frame_limit to use a |
I'd like to know how you plan on changing |
That doesn't seem correct either, assuming that the Miri driver will use rustc's const_eval for consistency. I think the correct move would be to add a |
cc @RalfJung We should probably remove this field entirely and make the engine depend on the recursion limit that is also used for macros and such. This way users can control the recursion depth directly from the source |
@oli-obk Actually I think miri-the-tool wants no limit at all here, TBH. For CTFE, the "normal" recursion limit seems fine. What is its default value? |
rust/src/librustc/middle/recursion_limit.rs Lines 24 to 25 in b7c6e8f
That seems like an easy change to make by making the check a |
Actually, wouldn't the |
Yes that seems like the correct place to check that |
Ping from triage @Aaron1011: It looks like some changes have been requested to your PR. |
Ping from triage. @Aaron1011 Unfortunately we haven't heard from you on this in a while, so I'm closing the PR to keep things tidy. Don't worry though, if you'll have time again in the future please reopen this PR, we'll be happy to review it again! |
This allows Miri to set const_eval_stack_frame_limit as needed,
while still keeping Session thread-safe