Skip to content

Commit bb0aff9

Browse files
committed
Auto merge of #141518 - GuillaumeGomez:rollup-ivjep2j, r=GuillaumeGomez
Rollup of 6 pull requests Successful merges: - rust-lang/rust#140066 (Stabilize `<[T; N]>::as_mut_slice` as `const`) - rust-lang/rust#141105 (additional edge cases tests for `path.rs` 🧪 ) - rust-lang/rust#141487 (Update askama to `0.14.0`) - rust-lang/rust#141498 (Use C-string literals to reduce boilerplate) - rust-lang/rust#141505 (rename internal panicking::try to catch_unwind) - rust-lang/rust#141511 (Cleanup CodegenFnAttrFlags) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 98299b2 + 9d4ebbd commit bb0aff9

File tree

8 files changed

+25
-25
lines changed

8 files changed

+25
-25
lines changed

src/bin/miri.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls {
281281
}
282282
let codegen_fn_attrs = tcx.codegen_fn_attrs(local_def_id);
283283
if codegen_fn_attrs.contains_extern_indicator()
284-
|| codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::USED)
284+
|| codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::USED_COMPILER)
285285
|| codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER)
286286
{
287287
Some((

src/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub fn iter_exported_symbols<'tcx>(
135135
let codegen_attrs = tcx.codegen_fn_attrs(def_id);
136136
codegen_attrs.contains_extern_indicator()
137137
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL)
138-
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED)
138+
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED_COMPILER)
139139
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER)
140140
};
141141
if exported {

src/shims/panic.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
5656
interp_ok(())
5757
}
5858

59-
/// Handles the `try` intrinsic, the underlying implementation of `std::panicking::try`.
59+
/// Handles the `catch_unwind` intrinsic.
6060
fn handle_catch_unwind(
6161
&mut self,
6262
args: &[OpTy<'tcx>],
@@ -66,7 +66,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
6666
let this = self.eval_context_mut();
6767

6868
// Signature:
69-
// fn r#try(try_fn: fn(*mut u8), data: *mut u8, catch_fn: fn(*mut u8, *mut u8)) -> i32
69+
// fn catch_unwind(try_fn: fn(*mut u8), data: *mut u8, catch_fn: fn(*mut u8, *mut u8)) -> i32
7070
// Calls `try_fn` with `data` as argument. If that executes normally, returns 0.
7171
// If that unwinds, calls `catch_fn` with the first argument being `data` and
7272
// then second argument being a target-dependent `payload` (i.e. it is up to us to define
@@ -120,14 +120,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
120120
// We only care about `catch_panic` if we're unwinding - if we're doing a normal
121121
// return, then we don't need to do anything special.
122122
if let (true, Some(catch_unwind)) = (unwinding, extra.catch_unwind.take()) {
123-
// We've just popped a frame that was pushed by `try`,
123+
// We've just popped a frame that was pushed by `catch_unwind`,
124124
// and we are unwinding, so we should catch that.
125125
trace!(
126126
"unwinding: found catch_panic frame during unwinding: {:?}",
127127
this.frame().instance()
128128
);
129129

130-
// We set the return value of `try` to 1, since there was a panic.
130+
// We set the return value of `catch_unwind` to 1, since there was a panic.
131131
this.write_scalar(Scalar::from_i32(1), &catch_unwind.dest)?;
132132

133133
// The Thread's `panic_payload` holds what was passed to `miri_start_unwind`.
@@ -142,7 +142,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
142142
ExternAbi::Rust,
143143
&[catch_unwind.data, payload],
144144
None,
145-
// Directly return to caller of `try`.
145+
// Directly return to caller of `catch_unwind`.
146146
StackPopCleanup::Goto {
147147
ret: catch_unwind.ret,
148148
// `catch_fn` must not unwind.

tests/fail/panic/bad_unwind.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ LL | std::panic::catch_unwind(|| unwind()).unwrap_err();
1313
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
1414
= note: BACKTRACE:
1515
= note: inside closure at tests/fail/panic/bad_unwind.rs:LL:CC
16-
= note: inside `std::panicking::r#try::do_call::<{closure@tests/fail/panic/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panicking.rs:LL:CC
17-
= note: inside `std::panicking::r#try::<(), {closure@tests/fail/panic/bad_unwind.rs:LL:CC}>` at RUSTLIB/std/src/panicking.rs:LL:CC
16+
= note: inside `std::panicking::catch_unwind::do_call::<{closure@tests/fail/panic/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panicking.rs:LL:CC
17+
= note: inside `std::panicking::catch_unwind::<(), {closure@tests/fail/panic/bad_unwind.rs:LL:CC}>` at RUSTLIB/std/src/panicking.rs:LL:CC
1818
= note: inside `std::panic::catch_unwind::<{closure@tests/fail/panic/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panic.rs:LL:CC
1919
note: inside `main`
2020
--> tests/fail/panic/bad_unwind.rs:LL:CC

tests/fail/tail_calls/cc-mismatch.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ LL | extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
1111
= note: inside `std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
1212
= note: inside closure at RUSTLIB/std/src/rt.rs:LL:CC
1313
= note: inside `std::ops::function::impls::<impl std::ops::FnOnce<()> for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once` at RUSTLIB/core/src/ops/function.rs:LL:CC
14-
= note: inside `std::panicking::r#try::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at RUSTLIB/std/src/panicking.rs:LL:CC
15-
= note: inside `std::panicking::r#try::<i32, &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>` at RUSTLIB/std/src/panicking.rs:LL:CC
14+
= note: inside `std::panicking::catch_unwind::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at RUSTLIB/std/src/panicking.rs:LL:CC
15+
= note: inside `std::panicking::catch_unwind::<i32, &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>` at RUSTLIB/std/src/panicking.rs:LL:CC
1616
= note: inside `std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at RUSTLIB/std/src/panic.rs:LL:CC
1717
= note: inside closure at RUSTLIB/std/src/rt.rs:LL:CC
18-
= note: inside `std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>` at RUSTLIB/std/src/panicking.rs:LL:CC
19-
= note: inside `std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>` at RUSTLIB/std/src/panicking.rs:LL:CC
18+
= note: inside `std::panicking::catch_unwind::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>` at RUSTLIB/std/src/panicking.rs:LL:CC
19+
= note: inside `std::panicking::catch_unwind::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>` at RUSTLIB/std/src/panicking.rs:LL:CC
2020
= note: inside `std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>` at RUSTLIB/std/src/panic.rs:LL:CC
2121
= note: inside `std::rt::lang_start_internal` at RUSTLIB/std/src/rt.rs:LL:CC
2222
= note: inside `std::rt::lang_start::<()>` at RUSTLIB/std/src/rt.rs:LL:CC

tests/pass/backtrace/backtrace-api-v1.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ RUSTLIB/core/src/ops/function.rs:LL:CC (<fn() as std::ops::FnOnce<()>>::call_onc
77
RUSTLIB/std/src/sys/backtrace.rs:LL:CC (std::sys::backtrace::__rust_begin_short_backtrace)
88
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start::{closure#0})
99
RUSTLIB/core/src/ops/function.rs:LL:CC (std::ops::function::impls::call_once)
10-
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try::do_call)
11-
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try)
10+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::catch_unwind::do_call)
11+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::catch_unwind)
1212
RUSTLIB/std/src/panic.rs:LL:CC (std::panic::catch_unwind)
1313
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start_internal::{closure#0})
14-
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try::do_call)
15-
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try)
14+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::catch_unwind::do_call)
15+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::catch_unwind)
1616
RUSTLIB/std/src/panic.rs:LL:CC (std::panic::catch_unwind)
1717
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start_internal)
1818
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start)

tests/pass/backtrace/backtrace-global-alloc.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
at RUSTLIB/std/src/rt.rs:LL:CC
99
4: std::ops::function::impls::call_once
1010
at RUSTLIB/core/src/ops/function.rs:LL:CC
11-
5: std::panicking::r#try::do_call
11+
5: std::panicking::catch_unwind::do_call
1212
at RUSTLIB/std/src/panicking.rs:LL:CC
13-
6: std::panicking::r#try
13+
6: std::panicking::catch_unwind
1414
at RUSTLIB/std/src/panicking.rs:LL:CC
1515
7: std::panic::catch_unwind
1616
at RUSTLIB/std/src/panic.rs:LL:CC
1717
8: std::rt::lang_start_internal::{closure#0}
1818
at RUSTLIB/std/src/rt.rs:LL:CC
19-
9: std::panicking::r#try::do_call
19+
9: std::panicking::catch_unwind::do_call
2020
at RUSTLIB/std/src/panicking.rs:LL:CC
21-
10: std::panicking::r#try
21+
10: std::panicking::catch_unwind
2222
at RUSTLIB/std/src/panicking.rs:LL:CC
2323
11: std::panic::catch_unwind
2424
at RUSTLIB/std/src/panic.rs:LL:CC

tests/pass/backtrace/backtrace-std.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
at RUSTLIB/std/src/rt.rs:LL:CC
1717
8: std::ops::function::impls::call_once
1818
at RUSTLIB/core/src/ops/function.rs:LL:CC
19-
9: std::panicking::r#try::do_call
19+
9: std::panicking::catch_unwind::do_call
2020
at RUSTLIB/std/src/panicking.rs:LL:CC
21-
10: std::panicking::r#try
21+
10: std::panicking::catch_unwind
2222
at RUSTLIB/std/src/panicking.rs:LL:CC
2323
11: std::panic::catch_unwind
2424
at RUSTLIB/std/src/panic.rs:LL:CC
2525
12: std::rt::lang_start_internal::{closure#0}
2626
at RUSTLIB/std/src/rt.rs:LL:CC
27-
13: std::panicking::r#try::do_call
27+
13: std::panicking::catch_unwind::do_call
2828
at RUSTLIB/std/src/panicking.rs:LL:CC
29-
14: std::panicking::r#try
29+
14: std::panicking::catch_unwind
3030
at RUSTLIB/std/src/panicking.rs:LL:CC
3131
15: std::panic::catch_unwind
3232
at RUSTLIB/std/src/panic.rs:LL:CC

0 commit comments

Comments
 (0)