@@ -990,17 +990,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
990990 }
991991}
992992
993- /// A temporary that must be set like `let temp = Deref::deref(&place)` after the candidate
994- /// `pre_binding_block`. This is because fake edges prevent us from keeping the temporaries we set
995- /// up while testing which branch to take.
996- #[ derive( Debug , Copy , Clone ) ]
997- struct DerefTemporary < ' tcx > {
998- place : Place < ' tcx > ,
999- temp : Place < ' tcx > ,
1000- ty : Ty < ' tcx > ,
1001- span : Span ,
1002- }
1003-
1004993/// Data extracted from a pattern that doesn't affect which branch is taken. Collected during
1005994/// pattern simplification and not mutated later.
1006995#[ derive( Debug , Clone , Default ) ]
@@ -1013,15 +1002,12 @@ struct PatternExtraData<'tcx> {
10131002
10141003 /// Types that must be asserted.
10151004 ascriptions : Vec < Ascription < ' tcx > > ,
1016-
1017- /// Temporaries that must be set up in order.
1018- deref_temps : Vec < DerefTemporary < ' tcx > > ,
10191005}
10201006
10211007impl < ' tcx > PatternExtraData < ' tcx > {
10221008 fn is_empty ( & self ) -> bool {
10231009 // FIXME(deref_patterns): can we merge trivial subcandidates that use deref patterns?
1024- self . bindings . is_empty ( ) && self . ascriptions . is_empty ( ) && self . deref_temps . is_empty ( )
1010+ self . bindings . is_empty ( ) && self . ascriptions . is_empty ( )
10251011 }
10261012}
10271013
@@ -1048,7 +1034,6 @@ impl<'tcx, 'pat> FlatPat<'pat, 'tcx> {
10481034 span : pattern. span ,
10491035 bindings : Vec :: new ( ) ,
10501036 ascriptions : Vec :: new ( ) ,
1051- deref_temps : Vec :: new ( ) ,
10521037 } ,
10531038 } ;
10541039 cx. simplify_match_pairs ( & mut flat_pat. match_pairs , & mut flat_pat. extra_data ) ;
@@ -2095,23 +2080,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
20952080 block = fresh_block;
20962081 }
20972082
2098- for d in collected_data. iter ( ) {
2099- for deref_call in d. deref_temps . iter ( ) {
2100- // Re-establish `Deref::deref` temporaries because false edges trick borrowck into
2101- // believing they may not be initialized.
2102- let next_block = self . cfg . start_new_block ( ) ;
2103- self . call_deref (
2104- block,
2105- next_block,
2106- deref_call. place ,
2107- deref_call. ty ,
2108- deref_call. temp ,
2109- deref_call. span ,
2110- ) ;
2111- block = next_block;
2112- }
2113- }
2114-
21152083 self . ascribe_types ( block, collected_data. iter ( ) . flat_map ( |d| & d. ascriptions ) . cloned ( ) ) ;
21162084
21172085 // rust-lang/rust#27282: The `autoref` business deserves some
0 commit comments