Skip to content

Commit

Permalink
Rename -Zoom=panic to -Zoom=unwind
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Apr 16, 2023
1 parent abc0660 commit 4b981c2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ fn test_unstable_options_tracking_hash() {
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);
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3048,9 +3048,9 @@ pub(crate) mod dep_tracking {
#[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,
}

Expand All @@ -3059,7 +3059,7 @@ impl OomStrategy {

pub fn should_panic(self) -> u8 {
match self {
OomStrategy::Panic => 1,
OomStrategy::Unwind => 1,
OomStrategy::Abort => 0,
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ mod parse {

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,
}
Expand Down
4 changes: 2 additions & 2 deletions library/alloc/src/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/oom_unwind.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Z oom=panic
// compile-flags: -Z oom=unwind
// run-pass
// no-prefer-dynamic
// needs-unwind
Expand Down

0 comments on commit 4b981c2

Please sign in to comment.