This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
compiler/rustc_mir_build/src/build Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 2020use rustc_ast:: Attribute ;
2121use rustc_data_structures:: fx:: FxHashMap ;
2222use rustc_hir:: def_id:: DefId ;
23+ use rustc_hir:: HirId ;
2324use rustc_index:: vec:: IndexVec ;
2425use rustc_middle:: {
2526 mir:: * ,
@@ -33,6 +34,7 @@ mod parse;
3334pub ( super ) fn build_custom_mir < ' tcx > (
3435 tcx : TyCtxt < ' tcx > ,
3536 did : DefId ,
37+ hir_id : HirId ,
3638 thir : & Thir < ' tcx > ,
3739 expr : ExprId ,
3840 params : & IndexVec < ParamId , Param < ' tcx > > ,
@@ -67,7 +69,10 @@ pub(super) fn build_custom_mir<'tcx>(
6769 parent_scope : None ,
6870 inlined : None ,
6971 inlined_parent_scope : None ,
70- local_data : ClearCrossCrate :: Clear ,
72+ local_data : ClearCrossCrate :: Set ( SourceScopeLocalData {
73+ lint_root : hir_id,
74+ safety : Safety :: Safe ,
75+ } ) ,
7176 } ) ;
7277 body. injection_phase = Some ( parse_attribute ( attr) ) ;
7378
Original file line number Diff line number Diff line change @@ -487,6 +487,7 @@ fn construct_fn<'tcx>(
487487 return custom:: build_custom_mir (
488488 tcx,
489489 fn_def. did . to_def_id ( ) ,
490+ fn_id,
490491 thir,
491492 expr,
492493 arguments,
You can’t perform that action at this time.
0 commit comments