Make coherence more tolerant of error types.

Fixes #29857.
Fixes #30589.
This commit is contained in:
Niko Matsakis 2016-01-02 04:57:55 -05:00
parent 64a8ffeffa
commit b4f5ddba67
8 changed files with 174 additions and 1 deletions

View file

@ -330,8 +330,11 @@ fn ty_is_local_constructor<'tcx>(tcx: &ty::ctxt<'tcx>,
tt.principal_def_id().is_local()
}
ty::TyClosure(..) |
ty::TyError => {
true
}
ty::TyClosure(..) => {
tcx.sess.bug(
&format!("ty_is_local invoked on unexpected type: {:?}",
ty))