@@ -1101,12 +1101,11 @@ where
1101
1101
///
1102
1102
/// This takes two primary parameters:
1103
1103
///
1104
- /// * `codegen_fn_attr_flags` - these are flags calculated as part of the
1105
- /// codegen attrs for a defined function. For function pointers this set of
1106
- /// flags is the empty set. This is only applicable for Rust-defined
1107
- /// functions, and generally isn't needed except for small optimizations where
1108
- /// we try to say a function which otherwise might look like it could unwind
1109
- /// doesn't actually unwind (such as for intrinsics and such).
1104
+ /// * `fn_def_id` - the `DefId` of the function. If this is provided then we can
1105
+ /// determine more precisely if the function can unwind. If this is not provided
1106
+ /// then we will only infer whether the function can unwind or not based on the
1107
+ /// ABI of the function. For example, a function marked with `#[rustc_nounwind]`
1108
+ /// is known to not unwind even if it's using Rust ABI.
1110
1109
///
1111
1110
/// * `abi` - this is the ABI that the function is defined with. This is the
1112
1111
/// primary factor for determining whether a function can unwind or not.
@@ -1138,11 +1137,6 @@ where
1138
1137
/// aborts the process.
1139
1138
/// * This affects whether functions have the LLVM `nounwind` attribute, which
1140
1139
/// affects various optimizations and codegen.
1141
- ///
1142
- /// FIXME: this is actually buggy with respect to Rust functions. Rust functions
1143
- /// compiled with `-Cpanic=unwind` and referenced from another crate compiled
1144
- /// with `-Cpanic=abort` will look like they can't unwind when in fact they
1145
- /// might (from a foreign exception or similar).
1146
1140
#[ inline]
1147
1141
#[ tracing:: instrument( level = "debug" , skip( tcx) ) ]
1148
1142
pub fn fn_can_unwind ( tcx : TyCtxt < ' _ > , fn_def_id : Option < DefId > , abi : SpecAbi ) -> bool {
0 commit comments