about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-04-25 00:08:33 +0200
committerMatthias Krüger <matthias.krueger@famsik.de>2023-04-25 00:08:33 +0200
commit33253fa6a42565eeae40e63401a41ac2dcc9e92f (patch)
treef0d3a82149da5df750f76000a5acdf0e0c3f665f
parent653cfdb436256cbc8415630b2537707ae1663806 (diff)
downloadrust-33253fa6a42565eeae40e63401a41ac2dcc9e92f.tar.gz
rust-33253fa6a42565eeae40e63401a41ac2dcc9e92f.zip
Revert "Rename -Zoom=panic to -Zoom=unwind"
This reverts commit 4b981c26487ebe56de6b3000fcd98713804beefc.
-rw-r--r--compiler/rustc_interface/src/tests.rs2
-rw-r--r--compiler/rustc_session/src/config.rs6
-rw-r--r--compiler/rustc_session/src/options.rs2
-rw-r--r--library/alloc/src/alloc.rs4
-rw-r--r--tests/ui/oom_unwind.rs2
5 files changed, 8 insertions, 8 deletions
diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs
index ce0f90bc1cc..7b0b5102c2d 100644
--- a/compiler/rustc_interface/src/tests.rs
+++ b/compiler/rustc_interface/src/tests.rs
@@ -777,7 +777,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::Unwind);
+    tracked!(oom, OomStrategy::Panic);
     tracked!(osx_rpath_install_name, true);
     tracked!(packed_bundled_libs, true);
     tracked!(panic_abort_tests, true);
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
index 419b6afe7c6..79eb31bb105 100644
--- a/compiler/rustc_session/src/config.rs
+++ b/compiler/rustc_session/src/config.rs
@@ -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`.
-    Unwind,
+    Panic,
 
-    /// Calls the panic hook as normal but aborts instead of unwinding.
+    /// Abort the process immediately.
     Abort,
 }
 
@@ -3059,7 +3059,7 @@ impl OomStrategy {
 
     pub fn should_panic(self) -> u8 {
         match self {
-            OomStrategy::Unwind => 1,
+            OomStrategy::Panic => 1,
             OomStrategy::Abort => 0,
         }
     }
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs
index 98bcacbe7ff..d9f03fe1407 100644
--- a/compiler/rustc_session/src/options.rs
+++ b/compiler/rustc_session/src/options.rs
@@ -662,7 +662,7 @@ mod parse {
 
     pub(crate) fn parse_oom_strategy(slot: &mut OomStrategy, v: Option<&str>) -> bool {
         match v {
-            Some("unwind") => *slot = OomStrategy::Unwind,
+            Some("panic") => *slot = OomStrategy::Panic,
             Some("abort") => *slot = OomStrategy::Abort,
             _ => return false,
         }
diff --git a/library/alloc/src/alloc.rs b/library/alloc/src/alloc.rs
index 0db23e55a86..97bedc604da 100644
--- a/library/alloc/src/alloc.rs
+++ b/library/alloc/src/alloc.rs
@@ -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={unwind,abort} compiler option.
+        // Its value depends on the -Zoom={panic,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={unwind,abort} compiler option.
+            // Its value depends on the -Zoom={panic,abort} compiler option.
             static __rust_alloc_error_handler_should_panic: u8;
         }
 
diff --git a/tests/ui/oom_unwind.rs b/tests/ui/oom_unwind.rs
index 704d6f8b810..21a8fb2b22b 100644
--- a/tests/ui/oom_unwind.rs
+++ b/tests/ui/oom_unwind.rs
@@ -1,4 +1,4 @@
-// compile-flags: -Z oom=unwind
+// compile-flags: -Z oom=panic
 // run-pass
 // no-prefer-dynamic
 // needs-unwind