Rename -Zoom=panic to -Zoom=unwind
This commit is contained in:
parent
abc0660118
commit
4b981c2648
@ -776,7 +776,7 @@ macro_rules! tracked {
|
||||
tracked!(no_link, true);
|
||||
tracked!(no_profiler_runtime, true);
|
||||
tracked!(no_unique_section_names, true);
|
||||
tracked!(oom, OomStrategy::Panic);
|
||||
tracked!(oom, OomStrategy::Unwind);
|
||||
tracked!(osx_rpath_install_name, true);
|
||||
tracked!(packed_bundled_libs, true);
|
||||
tracked!(panic_abort_tests, true);
|
||||
|
@ -3048,9 +3048,9 @@ pub(crate) fn stable_hash(
|
||||
#[derive(Clone, Copy, PartialEq, Hash, Debug, Encodable, Decodable, HashStable_Generic)]
|
||||
pub enum OomStrategy {
|
||||
/// Generate a panic that can be caught by `catch_unwind`.
|
||||
Panic,
|
||||
Unwind,
|
||||
|
||||
/// Abort the process immediately.
|
||||
/// Calls the panic hook as normal but aborts instead of unwinding.
|
||||
Abort,
|
||||
}
|
||||
|
||||
@ -3059,7 +3059,7 @@ impl OomStrategy {
|
||||
|
||||
pub fn should_panic(self) -> u8 {
|
||||
match self {
|
||||
OomStrategy::Panic => 1,
|
||||
OomStrategy::Unwind => 1,
|
||||
OomStrategy::Abort => 0,
|
||||
}
|
||||
}
|
||||
|
@ -662,7 +662,7 @@ pub(crate) fn parse_panic_strategy(slot: &mut PanicStrategy, v: Option<&str>) ->
|
||||
|
||||
pub(crate) fn parse_oom_strategy(slot: &mut OomStrategy, v: Option<&str>) -> bool {
|
||||
match v {
|
||||
Some("panic") => *slot = OomStrategy::Panic,
|
||||
Some("unwind") => *slot = OomStrategy::Unwind,
|
||||
Some("abort") => *slot = OomStrategy::Abort,
|
||||
_ => return false,
|
||||
}
|
||||
|
@ -398,7 +398,7 @@ fn rust_oom(layout: Layout) -> ! {
|
||||
fn panic_impl(pi: &core::panic::PanicInfo<'_>) -> !;
|
||||
|
||||
// This symbol is emitted by rustc .
|
||||
// Its value depends on the -Zoom={panic,abort} compiler option.
|
||||
// Its value depends on the -Zoom={unwind,abort} compiler option.
|
||||
static __rust_alloc_error_handler_should_panic: u8;
|
||||
}
|
||||
|
||||
@ -458,7 +458,7 @@ pub mod __alloc_error_handler {
|
||||
pub unsafe fn __rdl_oom(size: usize, _align: usize) -> ! {
|
||||
extern "Rust" {
|
||||
// This symbol is emitted by rustc next to __rust_alloc_error_handler.
|
||||
// Its value depends on the -Zoom={panic,abort} compiler option.
|
||||
// Its value depends on the -Zoom={unwind,abort} compiler option.
|
||||
static __rust_alloc_error_handler_should_panic: u8;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Z oom=panic
|
||||
// compile-flags: -Z oom=unwind
|
||||
// run-pass
|
||||
// no-prefer-dynamic
|
||||
// needs-unwind
|
||||
|
Loading…
Reference in New Issue
Block a user