mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 19:58:32 +00:00
Rename -Zoom=panic to -Zoom=unwind
This commit is contained in:
parent
abc0660118
commit
4b981c2648
@ -776,7 +776,7 @@ fn test_unstable_options_tracking_hash() {
|
|||||||
tracked!(no_link, true);
|
tracked!(no_link, true);
|
||||||
tracked!(no_profiler_runtime, true);
|
tracked!(no_profiler_runtime, true);
|
||||||
tracked!(no_unique_section_names, true);
|
tracked!(no_unique_section_names, true);
|
||||||
tracked!(oom, OomStrategy::Panic);
|
tracked!(oom, OomStrategy::Unwind);
|
||||||
tracked!(osx_rpath_install_name, true);
|
tracked!(osx_rpath_install_name, true);
|
||||||
tracked!(packed_bundled_libs, true);
|
tracked!(packed_bundled_libs, true);
|
||||||
tracked!(panic_abort_tests, true);
|
tracked!(panic_abort_tests, true);
|
||||||
|
@ -3048,9 +3048,9 @@ pub(crate) mod dep_tracking {
|
|||||||
#[derive(Clone, Copy, PartialEq, Hash, Debug, Encodable, Decodable, HashStable_Generic)]
|
#[derive(Clone, Copy, PartialEq, Hash, Debug, Encodable, Decodable, HashStable_Generic)]
|
||||||
pub enum OomStrategy {
|
pub enum OomStrategy {
|
||||||
/// Generate a panic that can be caught by `catch_unwind`.
|
/// 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,
|
Abort,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3059,7 +3059,7 @@ impl OomStrategy {
|
|||||||
|
|
||||||
pub fn should_panic(self) -> u8 {
|
pub fn should_panic(self) -> u8 {
|
||||||
match self {
|
match self {
|
||||||
OomStrategy::Panic => 1,
|
OomStrategy::Unwind => 1,
|
||||||
OomStrategy::Abort => 0,
|
OomStrategy::Abort => 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -662,7 +662,7 @@ mod parse {
|
|||||||
|
|
||||||
pub(crate) fn parse_oom_strategy(slot: &mut OomStrategy, v: Option<&str>) -> bool {
|
pub(crate) fn parse_oom_strategy(slot: &mut OomStrategy, v: Option<&str>) -> bool {
|
||||||
match v {
|
match v {
|
||||||
Some("panic") => *slot = OomStrategy::Panic,
|
Some("unwind") => *slot = OomStrategy::Unwind,
|
||||||
Some("abort") => *slot = OomStrategy::Abort,
|
Some("abort") => *slot = OomStrategy::Abort,
|
||||||
_ => return false,
|
_ => return false,
|
||||||
}
|
}
|
||||||
|
@ -398,7 +398,7 @@ fn rust_oom(layout: Layout) -> ! {
|
|||||||
fn panic_impl(pi: &core::panic::PanicInfo<'_>) -> !;
|
fn panic_impl(pi: &core::panic::PanicInfo<'_>) -> !;
|
||||||
|
|
||||||
// This symbol is emitted by rustc .
|
// 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;
|
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) -> ! {
|
pub unsafe fn __rdl_oom(size: usize, _align: usize) -> ! {
|
||||||
extern "Rust" {
|
extern "Rust" {
|
||||||
// This symbol is emitted by rustc next to __rust_alloc_error_handler.
|
// 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;
|
static __rust_alloc_error_handler_should_panic: u8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// compile-flags: -Z oom=panic
|
// compile-flags: -Z oom=unwind
|
||||||
// run-pass
|
// run-pass
|
||||||
// no-prefer-dynamic
|
// no-prefer-dynamic
|
||||||
// needs-unwind
|
// needs-unwind
|
||||||
|
Loading…
Reference in New Issue
Block a user