-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Make rust_stack_exhausted a lang item #11922
Copy link
Copy link
Closed
Labels
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
Description
Activity
Metadata
Metadata
Assignees
Labels
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
cc #9839. Right now if you don't link to the standard library you get a link error because
__morestackexpects a symbol calledrust_stack_exhaustedto exist.Add a "stack_exhausted" lang item. For every compilation unit, if the lang item doesn't exist, emit the code
If it does exist, emit the same function, but call the lang item.
This would work in our current scheme where std defines what happens when the stack runs out, but not if we refactored std like #11828, so that the lowest levels of the crate hierarchy don't know the failure policy.