@@ -1111,12 +1111,11 @@ where
11111111///
11121112/// This takes two primary parameters:
11131113///
1114- /// * `codegen_fn_attr_flags` - these are flags calculated as part of the
1115- /// codegen attrs for a defined function. For function pointers this set of
1116- /// flags is the empty set. This is only applicable for Rust-defined
1117- /// functions, and generally isn't needed except for small optimizations where
1118- /// we try to say a function which otherwise might look like it could unwind
1119- /// doesn't actually unwind (such as for intrinsics and such).
1114+ /// * `fn_def_id` - the `DefId` of the function. If this is provided then we can
1115+ /// determine more precisely if the function can unwind. If this is not provided
1116+ /// then we will only infer whether the function can unwind or not based on the
1117+ /// ABI of the function. For example, a function marked with `#[rustc_nounwind]`
1118+ /// is known to not unwind even if it's using Rust ABI.
11201119///
11211120/// * `abi` - this is the ABI that the function is defined with. This is the
11221121/// primary factor for determining whether a function can unwind or not.
@@ -1148,11 +1147,6 @@ where
11481147/// aborts the process.
11491148/// * This affects whether functions have the LLVM `nounwind` attribute, which
11501149/// affects various optimizations and codegen.
1151- ///
1152- /// FIXME: this is actually buggy with respect to Rust functions. Rust functions
1153- /// compiled with `-Cpanic=unwind` and referenced from another crate compiled
1154- /// with `-Cpanic=abort` will look like they can't unwind when in fact they
1155- /// might (from a foreign exception or similar).
11561150#[ inline]
11571151#[ tracing:: instrument( level = "debug" , skip( tcx) ) ]
11581152pub fn fn_can_unwind ( tcx : TyCtxt < ' _ > , fn_def_id : Option < DefId > , abi : SpecAbi ) -> bool {
0 commit comments