85
85
//! the function, whether it be by explicit return, panic, or other means.
86
86
//!
87
87
//! - `fallthrough_ln`: a live node that represents a fallthrough
88
- //!
89
- //! - `clean_exit_var`: a synthetic variable that is only 'read' from the
90
- //! fallthrough node. It is only live if the function could converge
91
- //! via means other than an explicit `return` expression. That is, it is
92
- //! only dead if the end of the function's block can never be reached.
93
- //! It is the responsibility of typeck to ensure that there are no
94
- //! `return` expressions in a function declared as diverging.
95
88
96
89
use self :: LiveNodeKind :: * ;
97
90
use self :: VarKind :: * ;
@@ -253,7 +246,6 @@ struct LocalInfo {
253
246
enum VarKind {
254
247
Param ( HirId , Symbol ) ,
255
248
Local ( LocalInfo ) ,
256
- CleanExit ,
257
249
}
258
250
259
251
struct IrMaps < ' tcx > {
@@ -309,7 +301,6 @@ impl IrMaps<'tcx> {
309
301
Local ( LocalInfo { id : node_id, .. } ) | Param ( node_id, _) => {
310
302
self . variable_map . insert ( node_id, v) ;
311
303
}
312
- CleanExit => { }
313
304
}
314
305
315
306
debug ! ( "{:?} is {:?}" , v, vk) ;
@@ -329,14 +320,13 @@ impl IrMaps<'tcx> {
329
320
fn variable_name ( & self , var : Variable ) -> String {
330
321
match self . var_kinds [ var. get ( ) ] {
331
322
Local ( LocalInfo { name, .. } ) | Param ( _, name) => name. to_string ( ) ,
332
- CleanExit => "<clean-exit>" . to_owned ( ) ,
333
323
}
334
324
}
335
325
336
326
fn variable_is_shorthand ( & self , var : Variable ) -> bool {
337
327
match self . var_kinds [ var. get ( ) ] {
338
328
Local ( LocalInfo { is_shorthand, .. } ) => is_shorthand,
339
- Param ( ..) | CleanExit => false ,
329
+ Param ( ..) => false ,
340
330
}
341
331
}
342
332
@@ -649,7 +639,6 @@ impl RWUTable {
649
639
struct Specials {
650
640
exit_ln : LiveNode ,
651
641
fallthrough_ln : LiveNode ,
652
- clean_exit_var : Variable ,
653
642
}
654
643
655
644
const ACC_READ : u32 = 1 ;
@@ -680,7 +669,6 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
680
669
let specials = Specials {
681
670
exit_ln : ir. add_live_node ( ExitNode ) ,
682
671
fallthrough_ln : ir. add_live_node ( ExitNode ) ,
683
- clean_exit_var : ir. add_variable ( CleanExit ) ,
684
672
} ;
685
673
686
674
let tables = ir. tcx . typeck_tables_of ( def_id) ;
@@ -913,7 +901,6 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
913
901
// explicitly return:
914
902
let s = self . s ;
915
903
self . init_from_succ ( s. fallthrough_ln , s. exit_ln ) ;
916
- self . acc ( s. fallthrough_ln , s. clean_exit_var , ACC_READ ) ;
917
904
918
905
let entry_ln = self . propagate_through_expr ( body, s. fallthrough_ln ) ;
919
906
0 commit comments