Resolve conflicts and extend the test

This commit is contained in:
Jonas Schievink 2016-03-16 13:22:35 +01:00
parent 4dbb01ff65
commit 96d9408dd9
2 changed files with 17 additions and 2 deletions

View File

@ -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;
@ -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,

View File

@ -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() {}