@@ -225,8 +225,8 @@ use rustc_middle::ty::adjustment::{CustomCoerceUnsized, PointerCoercion};
225
225
use rustc_middle:: ty:: layout:: ValidityRequirement ;
226
226
use rustc_middle:: ty:: print:: { shrunk_instance_name, with_no_trimmed_paths} ;
227
227
use rustc_middle:: ty:: {
228
- self , GenericArgs , GenericParamDefKind , Instance , InstanceKind , Ty , TyCtxt , TypeFoldable ,
229
- TypeVisitableExt , VtblEntry ,
228
+ self , GenericArgs , GenericParamDefKind , Instance , InstanceKind , Interner , Ty , TyCtxt ,
229
+ TypeFoldable , TypeVisitableExt , VtblEntry ,
230
230
} ;
231
231
use rustc_middle:: util:: Providers ;
232
232
use rustc_middle:: { bug, span_bug} ;
@@ -965,7 +965,7 @@ fn should_codegen_locally<'tcx>(tcx: TyCtxtAt<'tcx>, instance: Instance<'tcx>) -
965
965
{
966
966
// `#[rustc_force_inline]` items should never be codegened. This should be caught by
967
967
// the MIR validator.
968
- return false ;
968
+ tcx . delay_bug ( "attempt to codegen `#[rustc_force_inline]` item" ) ;
969
969
}
970
970
971
971
if def_id. is_local ( ) {
@@ -1462,7 +1462,9 @@ impl<'v> RootCollector<'_, 'v> {
1462
1462
fn is_root ( & self , def_id : LocalDefId ) -> bool {
1463
1463
!self . tcx . generics_of ( def_id) . requires_monomorphization ( self . tcx )
1464
1464
&& match self . strategy {
1465
- MonoItemCollectionStrategy :: Eager => true ,
1465
+ MonoItemCollectionStrategy :: Eager => {
1466
+ !matches ! ( self . tcx. codegen_fn_attrs( def_id) . inline, InlineAttr :: Force { .. } )
1467
+ }
1466
1468
MonoItemCollectionStrategy :: Lazy => {
1467
1469
self . entry_fn . and_then ( |( id, _) | id. as_local ( ) ) == Some ( def_id)
1468
1470
|| self . tcx . is_reachable_non_generic ( def_id)
0 commit comments