Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Oct 2, 2019
1 parent a5cfc40 commit de81565
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/librustc_typeck/outlives/utils.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use rustc::ty::outlives::Component;
use rustc::ty::subst::{GenericArg, GenericArgKind};
use rustc::ty::{self, Region, RegionKind, Ty, TyCtxt};
use syntax_pos::DUMMY_SP;
use smallvec::smallvec;
use std::collections::BTreeSet;

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

// This can appear with malformed code (#64855):
// This can appear in `where Self: ` bounds (#64855):
//
// struct Bar<T>(<Self as Foo>::Type) where Self: ;
//
// We accept it only to avoid an ICE.
RegionKind::ReEmpty => {
tcx.sess.delay_span_bug(
DUMMY_SP,
&format!("unexpected region in outlives inference: {:?}", region),
);
false
}
// struct Baz<'a>(&'a Self) where Self: ;
RegionKind::ReEmpty => false,

// These regions don't appear in types from type declarations:
RegionKind::ReErased
Expand Down
5 changes: 5 additions & 0 deletions src/test/ui/associated-types/issue-64855-2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// check-pass

pub struct Bar<'a>(&'a Self) where Self: ;

fn main() {}

0 comments on commit de81565

Please sign in to comment.