@@ -1111,12 +1111,11 @@ where
1111
1111
///
1112
1112
/// This takes two primary parameters:
1113
1113
///
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.
1120
1119
///
1121
1120
/// * `abi` - this is the ABI that the function is defined with. This is the
1122
1121
/// primary factor for determining whether a function can unwind or not.
@@ -1148,11 +1147,6 @@ where
1148
1147
/// aborts the process.
1149
1148
/// * This affects whether functions have the LLVM `nounwind` attribute, which
1150
1149
/// 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).
1156
1150
#[ inline]
1157
1151
#[ tracing:: instrument( level = "debug" , skip( tcx) ) ]
1158
1152
pub fn fn_can_unwind ( tcx : TyCtxt < ' _ > , fn_def_id : Option < DefId > , abi : SpecAbi ) -> bool {
0 commit comments