Skip to content

Commit 4dbb01f

Browse files
Use fully_normalize, unwrapping its result
1 parent f0b0a4f commit 4dbb01f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/librustc/middle/liveness.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ use self::VarKind::*;
112112
use dep_graph::DepNode;
113113
use middle::def::*;
114114
use middle::pat_util;
115-
use middle::ty::{self, TyCtxt};
115+
use middle::ty::{self, TyCtxt, ParameterEnvironment};
116116
use middle::traits;
117117
use middle::infer;
118118
use lint;
@@ -1494,15 +1494,16 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
14941494
ty::FnConverging(t_ret)
14951495
if self.live_on_entry(entry_ln, self.s.no_ret_var).is_some() => {
14961496

1497-
let infcx = infer::new_infer_ctxt(&self.ir.tcx, &self.ir.tcx.tables, None);
1498-
let mut selcx = traits::SelectionContext::new(&infcx);
1497+
let param_env = ParameterEnvironment::for_item(&self.ir.tcx, id);
1498+
let infcx = infer::new_infer_ctxt(&self.ir.tcx,
1499+
&self.ir.tcx.tables,
1500+
Some(param_env));
14991501
let cause = traits::ObligationCause::dummy();
1502+
let norm = traits::fully_normalize(&infcx,
1503+
cause,
1504+
&t_ret);
15001505

1501-
let norm = traits::normalize(&mut selcx,
1502-
cause,
1503-
&t_ret);
1504-
1505-
if norm.value.is_nil() {
1506+
if norm.unwrap().is_nil() {
15061507
// for nil return types, it is ok to not return a value expl.
15071508
} else {
15081509
let ends_with_stmt = match body.expr {

0 commit comments

Comments
 (0)