Skip to content

Commit cc03ed7

Browse files
committed
Build with newest nightly.
1 parent ebb488f commit cc03ed7

File tree

2 files changed

+9
-25
lines changed

2 files changed

+9
-25
lines changed

src/mismatch.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc::{
1010
hir::def_id::DefId,
1111
ty::{
1212
self,
13-
relate::{Relate, RelateResult, TraitObjectMode, TypeRelation},
13+
relate::{Relate, RelateResult, TypeRelation},
1414
subst::Substs,
1515
Ty, TyCtxt,
1616
Visibility::Public,
@@ -95,10 +95,6 @@ impl<'a, 'gcx, 'tcx> TypeRelation<'a, 'gcx, 'tcx> for MismatchRelation<'a, 'gcx,
9595
"Mismatch"
9696
}
9797

98-
fn trait_object_mode(&self) -> TraitObjectMode {
99-
TraitObjectMode::NoSquash
100-
}
101-
10298
fn a_is_expected(&self) -> bool {
10399
true
104100
}
@@ -189,9 +185,13 @@ impl<'a, 'gcx, 'tcx> TypeRelation<'a, 'gcx, 'tcx> for MismatchRelation<'a, 'gcx,
189185
let a = a_obj.principal();
190186
let b = b_obj.principal();
191187

192-
if self.check_substs(a.skip_binder().substs, b.skip_binder().substs) {
193-
let _ = self.relate(&a.skip_binder().substs, &b.skip_binder().substs)?;
194-
Some((a.skip_binder().def_id, b.skip_binder().def_id))
188+
if let (Some(a), Some(b)) = (a, b) {
189+
if self.check_substs(a.skip_binder().substs, b.skip_binder().substs) {
190+
let _ = self.relate(&a.skip_binder().substs, &b.skip_binder().substs)?;
191+
Some((a.skip_binder().def_id, b.skip_binder().def_id))
192+
} else {
193+
None
194+
}
195195
} else {
196196
None
197197
}

tests/cases/regions/stdout

+1-17
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,5 @@ error: breaking changes in `def`
3131
|
3232
= warning: type error: expected reference, found bool (breaking)
3333

34-
error: breaking changes in `efg`
35-
--> $REPO_PATH/tests/cases/regions/new.rs:17:1
36-
|
37-
17 | pub fn efg(_: &str) { }
38-
| ^^^^^^^^^^^^^^^^^^^^^^^
39-
|
40-
= warning: type error: expected bound lifetime parameterBrAnon(0), found concrete lifetime (breaking)
41-
42-
error: breaking changes in `fgh`
43-
--> $REPO_PATH/tests/cases/regions/new.rs:19:1
44-
|
45-
19 | pub fn fgh(_: &'static str) { }
46-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47-
|
48-
= warning: type error: expected bound lifetime parameterBrAnon(0), found concrete lifetime (breaking)
49-
50-
error: aborting due to 6 previous errors
34+
error: aborting due to 4 previous errors
5135

0 commit comments

Comments
 (0)