File tree Expand file tree Collapse file tree 2 files changed +19
-25
lines changed
branches/snap-stage3/src/librustc/middle Expand file tree Collapse file tree 2 files changed +19
-25
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 3d072a193bfcb76206aab576049e696d6d8db25d
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: bc41cc0ec9fbe395598fde5ef22b3e95582a5236
4
+ refs/heads/snap-stage3: f5281e2bb56fa9ef4debf04e6141d2ad3650ca61
5
5
refs/heads/try: ccf8fedf1cffcb8f6f3581d53d220039e192fe77
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
Original file line number Diff line number Diff line change @@ -5643,32 +5643,26 @@ pub fn closure_upvars<'tcx>(typer: &mc::Typer<'tcx>,
5643
5643
closure_expr_id : closure_id. node
5644
5644
} ;
5645
5645
5646
- let captured_freevar_ty = match typer. upvar_capture ( upvar_id) {
5647
- Some ( UpvarCapture :: ByValue ) => {
5648
- freevar_ty
5649
- }
5650
-
5651
- Some ( UpvarCapture :: ByRef ( borrow) ) => {
5652
- mk_rptr ( tcx,
5653
- tcx. mk_region ( borrow. region ) ,
5654
- ty:: mt {
5655
- ty : freevar_ty,
5656
- mutbl : borrow. kind . to_mutbl_lossy ( ) ,
5657
- } )
5658
- }
5646
+ typer. upvar_capture ( upvar_id) . map ( |capture| {
5647
+ let freevar_ref_ty = match capture {
5648
+ UpvarCapture :: ByValue => {
5649
+ freevar_ty
5650
+ }
5651
+ UpvarCapture :: ByRef ( borrow) => {
5652
+ mk_rptr ( tcx,
5653
+ tcx. mk_region ( borrow. region ) ,
5654
+ ty:: mt {
5655
+ ty : freevar_ty,
5656
+ mutbl : borrow. kind . to_mutbl_lossy ( ) ,
5657
+ } )
5658
+ }
5659
+ } ;
5659
5660
5660
- None => {
5661
- // FIXME(#16640) we should really return None here;
5662
- // but that requires better inference integration,
5663
- // for now gin up something.
5664
- freevar_ty
5661
+ ClosureUpvar {
5662
+ def : freevar. def ,
5663
+ span : freevar. span ,
5664
+ ty : freevar_ref_ty,
5665
5665
}
5666
- } ;
5667
-
5668
- Some ( ClosureUpvar {
5669
- def : freevar. def ,
5670
- span : freevar. span ,
5671
- ty : captured_freevar_ty,
5672
5666
} )
5673
5667
} )
5674
5668
. collect ( )
You can’t perform that action at this time.
0 commit comments