about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-02-27 00:40:00 +0100
committerGitHub <noreply@github.com>2024-02-27 00:40:00 +0100
commitacb6f1afdd0a1bb24441b3f711c380b1490354fd (patch)
tree39815a08cce70b59b692360159a4c7cd8b536663
parentfcb86c871f5062b12925afc77935166dccf30ce4 (diff)
parent65f778976177ca797912218db16be178cd9d0a74 (diff)
downloadrust-acb6f1afdd0a1bb24441b3f711c380b1490354fd.tar.gz
rust-acb6f1afdd0a1bb24441b3f711c380b1490354fd.zip
Rollup merge of #121598 - RalfJung:catch_unwind, r=oli-obk
rename 'try' intrinsic to 'catch_unwind'

The intrinsic has nothing to do with `try` blocks, and corresponds to the stable `catch_unwind` function, so this makes a lot more sense IMO.

Also rename Miri's special function while we are at it, to reflect the level of abstraction it works on: it's an unwinding mechanism, on which Rust implements panics.
-rw-r--r--src/intrinsics/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs
index 199d5df29e7..84269ec2942 100644
--- a/src/intrinsics/mod.rs
+++ b/src/intrinsics/mod.rs
@@ -23,7 +23,7 @@ use rustc_middle::ty::layout::{HasParamEnv, ValidityRequirement};
 use rustc_middle::ty::print::{with_no_trimmed_paths, with_no_visible_paths};
 use rustc_middle::ty::GenericArgsRef;
 use rustc_span::source_map::Spanned;
-use rustc_span::symbol::{kw, sym, Symbol};
+use rustc_span::symbol::{sym, Symbol};
 
 pub(crate) use self::llvm::codegen_llvm_intrinsic_call;
 use crate::prelude::*;
@@ -1132,7 +1132,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
             ret.write_cvalue(fx, val);
         }
 
-        kw::Try => {
+        sym::catch_unwind => {
             intrinsic_args!(fx, args => (f, data, catch_fn); intrinsic);
             let f = f.load_scalar(fx);
             let data = data.load_scalar(fx);