Skip to content

Commit 96d9408

Browse files
Resolve conflicts and extend the test
1 parent 4dbb01f commit 96d9408

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/librustc/middle/liveness.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ use dep_graph::DepNode;
113113
use middle::def::*;
114114
use middle::pat_util;
115115
use middle::ty::{self, TyCtxt, ParameterEnvironment};
116-
use middle::traits;
116+
use middle::traits::{self, ProjectionMode};
117117
use middle::infer;
118118
use lint;
119119
use util::nodemap::NodeMap;
@@ -1497,7 +1497,8 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
14971497
let param_env = ParameterEnvironment::for_item(&self.ir.tcx, id);
14981498
let infcx = infer::new_infer_ctxt(&self.ir.tcx,
14991499
&self.ir.tcx.tables,
1500-
Some(param_env));
1500+
Some(param_env),
1501+
ProjectionMode::Any);
15011502
let cause = traits::ObligationCause::dummy();
15021503
let norm = traits::fully_normalize(&infcx,
15031504
cause,

src/test/run-pass/issue-31597.rs

+14
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,18 @@ impl Make for () {
2020
fn make() -> Self::Out {}
2121
}
2222

23+
// Also make sure we don't hit an ICE when the projection can't be known
24+
fn f<T: Make>() -> <T as Make>::Out { loop {} }
25+
26+
// ...and that it works with a blanket impl
27+
trait Tr {
28+
type Assoc;
29+
}
30+
31+
impl<T: Make> Tr for T {
32+
type Assoc = ();
33+
}
34+
35+
fn g<T: Make>() -> <T as Tr>::Assoc { }
36+
2337
fn main() {}

0 commit comments

Comments
 (0)