Skip to content

Commit 9a0b9c6

Browse files
committed
remove old branch of unwind logic
1 parent 152527f commit 9a0b9c6

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

src/librustc_codegen_llvm/attributes.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -275,18 +275,7 @@ pub fn from_fn_attrs(
275275
} else if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_ALLOCATOR_NOUNWIND) {
276276
// Special attribute for allocator functions, which can't unwind
277277
false
278-
} else if let Some(_) = id {
279-
// rust-lang/rust#64655, rust-lang/rust#63909: to minimize
280-
// risk associated with changing cases where nounwind
281-
// attribute is attached, this code is deliberately mimicking
282-
// old control flow based on whether `id` is `Some` or `None`.
283-
//
284-
// However, in the long term we should either:
285-
// - fold this into final else (i.e. stop inspecting `id`)
286-
// - or, adopt Rust PR #63909.
287-
//
288-
// see also Rust RFC 2753.
289-
278+
} else {
290279
let sig = cx.tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &sig);
291280
if sig.abi == Abi::Rust || sig.abi == Abi::RustCall {
292281
// Any Rust method (or `extern "Rust" fn` or `extern
@@ -312,15 +301,6 @@ pub fn from_fn_attrs(
312301
// In either case, we mark item as explicitly nounwind.
313302
false
314303
}
315-
} else {
316-
// assume this can possibly unwind, avoiding the application of a
317-
// `nounwind` attribute below.
318-
//
319-
// (But: See comments in previous branch. Specifically, it is
320-
// unclear whether there is real value in the assumption this
321-
// can unwind. The conservatism here may just be papering over
322-
// a real problem by making some UB a bit harder to hit.)
323-
true
324304
});
325305

326306
// Always annotate functions with the target-cpu they are compiled for.

0 commit comments

Comments
 (0)