Skip to content

Commit

Permalink
Resolve conflicts and extend the test
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-schievink committed Mar 16, 2016
1 parent 4dbb01f commit 96d9408
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/librustc/middle/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ use dep_graph::DepNode;
use middle::def::*;
use middle::pat_util;
use middle::ty::{self, TyCtxt, ParameterEnvironment};
use middle::traits;
use middle::traits::{self, ProjectionMode};
use middle::infer;
use lint;
use util::nodemap::NodeMap;
Expand Down Expand Up @@ -1497,7 +1497,8 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
let param_env = ParameterEnvironment::for_item(&self.ir.tcx, id);
let infcx = infer::new_infer_ctxt(&self.ir.tcx,
&self.ir.tcx.tables,
Some(param_env));
Some(param_env),
ProjectionMode::Any);
let cause = traits::ObligationCause::dummy();
let norm = traits::fully_normalize(&infcx,
cause,
Expand Down
14 changes: 14 additions & 0 deletions src/test/run-pass/issue-31597.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,18 @@ impl Make for () {
fn make() -> Self::Out {}
}

// Also make sure we don't hit an ICE when the projection can't be known
fn f<T: Make>() -> <T as Make>::Out { loop {} }

// ...and that it works with a blanket impl
trait Tr {
type Assoc;
}

impl<T: Make> Tr for T {
type Assoc = ();
}

fn g<T: Make>() -> <T as Tr>::Assoc { }

fn main() {}

0 comments on commit 96d9408

Please sign in to comment.