about summary refs log tree commit diff
path: root/src/librustc_const_eval
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2016-11-10 13:09:34 +0100
committerAnthony Ramine <n.oxyde@gmail.com>2016-11-10 14:43:46 +0100
commit84239dfc4ad1810d5d8ff86b4e0ad008d04632d6 (patch)
tree0827fe503aa845f8c31445f09d8373211b1addfb /src/librustc_const_eval
parentc11e2bda394c786fff27df94bfbe292ba33294df (diff)
Work around a borrow surviving too long (fixes #37686)
Diffstat (limited to 'src/librustc_const_eval')
-rw-r--r--src/librustc_const_eval/pattern.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc_const_eval/pattern.rs b/src/librustc_const_eval/pattern.rs
index 10b2a7625ca..241920f2949 100644
--- a/src/librustc_const_eval/pattern.rs
+++ b/src/librustc_const_eval/pattern.rs
@@ -223,7 +223,8 @@ impl<'a, 'gcx, 'tcx> PatternContext<'a, 'gcx, 'tcx> {
             }
 
             PatKind::Tuple(ref subpatterns, ddpos) => {
-                match self.tcx.tables().node_id_to_type(pat.id).sty {
+                let ty = self.tcx.tables().node_id_to_type(pat.id);
+                match ty.sty {
                     ty::TyTuple(ref tys) => {
                         let subpatterns =
                             subpatterns.iter()