@@ -785,6 +785,8 @@ fn run(tcx: TyCtxt) {
785
785
}
786
786
}
787
787
788
+ let skip_borrowck_everywhere = env:: var ( "C2RUST_ANALYZE_SKIP_BORROWCK" ) . as_deref ( ) == Ok ( "1" ) ;
789
+
788
790
// Load permission info from PDG
789
791
let pdg_compare = env:: var ( "C2RUST_ANALYZE_COMPARE_PDG" ) . as_deref ( ) == Ok ( "1" ) ;
790
792
// In compare mode, we load the PDG for comparison after analysis, not before.
@@ -796,6 +798,7 @@ fn run(tcx: TyCtxt) {
796
798
& mut func_info,
797
799
& mut asn,
798
800
& mut updates_forbidden,
801
+ skip_borrowck_everywhere,
799
802
pdg_file_path,
800
803
) ;
801
804
}
@@ -877,8 +880,6 @@ fn run(tcx: TyCtxt) {
877
880
debug ! ( "=== ADT Metadata ===" ) ;
878
881
debug ! ( "{:?}" , gacx. adt_metadata) ;
879
882
880
- let skip_borrowck_everywhere = env:: var ( "C2RUST_ANALYZE_SKIP_BORROWCK" ) . as_deref ( ) == Ok ( "1" ) ;
881
-
882
883
let mut loop_count = 0 ;
883
884
loop {
884
885
// Loop until the global assignment reaches a fixpoint. The inner loop also runs until a
@@ -2242,6 +2243,7 @@ fn pdg_update_permissions<'tcx>(
2242
2243
func_info : & mut HashMap < LocalDefId , FuncInfo < ' tcx > > ,
2243
2244
asn : & mut Assignment ,
2244
2245
updates_forbidden : & mut GlobalPointerTable < PermissionSet > ,
2246
+ skip_borrowck_everywhere : bool ,
2245
2247
pdg_file_path : impl AsRef < Path > ,
2246
2248
) {
2247
2249
let allow_unsound =
@@ -2280,8 +2282,8 @@ fn pdg_update_permissions<'tcx>(
2280
2282
if node_info. flows_to . neg_offset . is_some ( ) {
2281
2283
perms. insert ( PermissionSet :: OFFSET_SUB ) ;
2282
2284
}
2283
- if !node_info. unique {
2284
- // perms.remove(PermissionSet::UNIQUE);
2285
+ if !node_info. unique && !skip_borrowck_everywhere {
2286
+ perms. remove ( PermissionSet :: UNIQUE ) ;
2285
2287
}
2286
2288
}
2287
2289
0 commit comments