about summary refs log tree commit diff
path: root/src/rustc
diff options
context:
space:
mode:
authorVincent Belliard <vincent@famillebelliard.fr>2012-08-31 19:14:39 +0200
committerVincent Belliard <vincent@famillebelliard.fr>2012-09-05 16:38:00 +0200
commitd12128f56fdf315913bd5c427b3322bed484f1b3 (patch)
treef0411305d653c670ae879f324d20f4a981e05d29 /src/rustc
parent9b88b5fe3862c45318487c37c8a48d9605590ce0 (diff)
downloadrust-d12128f56fdf315913bd5c427b3322bed484f1b3.tar.gz
rust-d12128f56fdf315913bd5c427b3322bed484f1b3.zip
fix issue #3222
Diffstat (limited to 'src/rustc')
-rw-r--r--src/rustc/middle/trans/alt.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rustc/middle/trans/alt.rs b/src/rustc/middle/trans/alt.rs
index b7379b587da..a96529fa01c 100644
--- a/src/rustc/middle/trans/alt.rs
+++ b/src/rustc/middle/trans/alt.rs
@@ -58,8 +58,7 @@ fn trans_opt(bcx: block, o: opt) -> opt_result {
             return single_result(rslt(bcx, *cell));
           }
           _ => {
-            return single_result(
-                rslt(bcx, consts::const_expr(ccx, l)));
+            return single_result(trans_temp_expr(bcx, l));
           }
         }
       }
@@ -636,13 +635,14 @@ fn compile_submatch(bcx: block, m: match_, vals: ~[ValueRef],
             }
           }
           lit(_) => {
-            test_val = Load(bcx, val);
             let pty = node_id_type(bcx, pat_id);
+            test_val = load_if_immediate(bcx, val, pty);
             kind = if ty::type_is_integral(pty) { switch }
                    else { compare };
           }
           range(_, _) => {
-            test_val = Load(bcx, val);
+            let pty = node_id_type(bcx, pat_id);
+            test_val = load_if_immediate(bcx, val, pty);
             kind = compare;
           }
         }