]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_trans/expr.rs
Changed issue number to 36105
[rust.git] / src / librustc_trans / expr.rs
index fa2521205a8e18bf68e58430550a8987772b446a..beb589c80bfc56f27a2d9f7d1aa74b1e2872aba6 100644 (file)
@@ -69,7 +69,7 @@
 use type_of;
 use value::Value;
 use Disr;
-use rustc::ty::adjustment::{AdjustEmptyToAny, AdjustDerefRef, AdjustReifyFnPointer};
+use rustc::ty::adjustment::{AdjustNeverToAny, AdjustDerefRef, AdjustReifyFnPointer};
 use rustc::ty::adjustment::{AdjustUnsafeFnPointer, AdjustMutToConstPointer};
 use rustc::ty::adjustment::CustomCoerceUnsized;
 use rustc::ty::{self, Ty, TyCtxt};
@@ -175,7 +175,7 @@ pub fn trans_into<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                 hir::ExprPath(..) => {
                     match bcx.tcx().expect_def(expr.id) {
                         Def::Const(did) | Def::AssociatedConst(did) => {
-                            let empty_substs = bcx.tcx().mk_substs(Substs::empty());
+                            let empty_substs = Substs::empty(bcx.tcx());
                             let const_expr = consts::get_const_expr(bcx.ccx(), did, expr,
                                                                     empty_substs);
                             // Temporarily get cleanup scopes out of the way,
@@ -348,7 +348,7 @@ fn adjustment_required<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
     }
 
     match adjustment {
-        AdjustEmptyToAny(..) => true,
+        AdjustNeverToAny(..) => true,
         AdjustReifyFnPointer => true,
         AdjustUnsafeFnPointer | AdjustMutToConstPointer => {
             // purely a type-level thing
@@ -381,11 +381,11 @@ fn apply_adjustments<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
     debug!("unadjusted datum for expr {:?}: {:?} adjustment={:?}",
            expr, datum, adjustment);
     match adjustment {
-        AdjustEmptyToAny(ref target) => {
+        AdjustNeverToAny(ref target) => {
             let mono_target = bcx.monomorphize(target);
             let llty = type_of::type_of(bcx.ccx(), mono_target);
             let dummy = C_undef(llty.ptr_to());
-            datum = Datum::new(dummy, mono_target, Rvalue::new(ByRef)).to_expr_datum();
+            datum = Datum::new(dummy, mono_target, Lvalue::new("never")).to_expr_datum();
         }
         AdjustReifyFnPointer => {
             match datum.ty.sty {