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 +18
-8
lines changed
compiler/rustc_mir_transform/src Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -78,14 +78,10 @@ impl SsaLocals {
7878 visitor. assignments [ local] = Set1 :: One ( LocationExtended :: Arg ) ;
7979 }
8080
81- if body. basic_blocks . len ( ) > 2 {
82- for ( bb, data) in traversal:: reverse_postorder ( body) {
83- visitor. visit_basic_block_data ( bb, data) ;
84- }
85- } else {
86- for ( bb, data) in body. basic_blocks . iter_enumerated ( ) {
87- visitor. visit_basic_block_data ( bb, data) ;
88- }
81+ // For SSA assignments, a RPO visit will see the assignment before it sees any use.
82+ // We only visit reachable nodes: computing `dominates` on an unreachable node ICEs.
83+ for ( bb, data) in traversal:: reverse_postorder ( body) {
84+ visitor. visit_basic_block_data ( bb, data) ;
8985 }
9086
9187 for var_debug_info in & body. var_debug_info {
Original file line number Diff line number Diff line change 1+ // Regression test for issue #116212.
2+
3+ #![ feature( never_type) ]
4+
5+ use std:: mem:: MaybeUninit ;
6+
7+ struct Foo {
8+ x : u8 ,
9+ y : !,
10+ }
11+
12+ fn main ( ) {
13+ let foo = unsafe { MaybeUninit :: < Foo > :: uninit ( ) . assume_init ( ) } ;
14+ }
You can’t perform that action at this time.
0 commit comments