Skip to content

Commit de81565

Browse files
committed
review comments
1 parent a5cfc40 commit de81565

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/librustc_typeck/outlives/utils.rs

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use rustc::ty::outlives::Component;
22
use rustc::ty::subst::{GenericArg, GenericArgKind};
33
use rustc::ty::{self, Region, RegionKind, Ty, TyCtxt};
4-
use syntax_pos::DUMMY_SP;
54
use smallvec::smallvec;
65
use std::collections::BTreeSet;
76

@@ -162,18 +161,11 @@ fn is_free_region(tcx: TyCtxt<'_>, region: Region<'_>) -> bool {
162161
// ignore it. We can't put it on the struct header anyway.
163162
RegionKind::ReLateBound(..) => false,
164163

165-
// This can appear with malformed code (#64855):
164+
// This can appear in `where Self: ` bounds (#64855):
166165
//
167166
// struct Bar<T>(<Self as Foo>::Type) where Self: ;
168-
//
169-
// We accept it only to avoid an ICE.
170-
RegionKind::ReEmpty => {
171-
tcx.sess.delay_span_bug(
172-
DUMMY_SP,
173-
&format!("unexpected region in outlives inference: {:?}", region),
174-
);
175-
false
176-
}
167+
// struct Baz<'a>(&'a Self) where Self: ;
168+
RegionKind::ReEmpty => false,
177169

178170
// These regions don't appear in types from type declarations:
179171
RegionKind::ReErased
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// check-pass
2+
3+
pub struct Bar<'a>(&'a Self) where Self: ;
4+
5+
fn main() {}

0 commit comments

Comments
 (0)