File tree Expand file tree Collapse file tree 2 files changed +2
-20
lines changed
compiler/rustc_typeck/src/check/generator_interior/drop_ranges Expand file tree Collapse file tree 2 files changed +2
-20
lines changed Original file line number Diff line number Diff line change @@ -171,13 +171,7 @@ impl<'tcx> expr_use_visitor::Delegate<'tcx> for ExprUseDelegate<'tcx> {
171
171
. insert ( TrackedValue :: from_place_with_projections_allowed ( place_with_id) ) ;
172
172
173
173
// For copied we treat this mostly like a borrow except that we don't add the place
174
- // to borrowed_temporaries if it is not a local because the copy is consumed.
175
- match place_with_id. place . base {
176
- PlaceBase :: Rvalue | PlaceBase :: StaticItem | PlaceBase :: Upvar ( _) => ( ) ,
177
- PlaceBase :: Local ( _) => {
178
- self . places . borrowed_temporaries . insert ( place_with_id. hir_id ) ;
179
- }
180
- }
174
+ // to borrowed_temporaries because the copy is consumed.
181
175
}
182
176
183
177
fn mutate (
Original file line number Diff line number Diff line change 14
14
#![ feature( generators) ]
15
15
16
16
fn main ( ) {
17
- let _a = static |x : u8 | match x {
17
+ let _ = static |x : u8 | match x {
18
18
y if { yield } == y + 1 => ( ) ,
19
19
_ => ( ) ,
20
20
} ;
21
-
22
- static STATIC : u8 = 42 ;
23
- let _b = static |x : u8 | match x {
24
- y if { yield } == STATIC + 1 => ( ) ,
25
- _ => ( ) ,
26
- } ;
27
-
28
- let upvar = 42u8 ;
29
- let _c = static |x : u8 | match x {
30
- y if { yield } == upvar + 1 => ( ) ,
31
- _ => ( ) ,
32
- } ;
33
21
}
You can’t perform that action at this time.
0 commit comments