@@ -1233,17 +1233,18 @@ pub fn finish_resolving_def_to_ty<'tcx>(this: &AstConv<'tcx>,
1233
1233
if segments. is_empty ( ) {
1234
1234
opt_self_ty. expect ( "missing T in <T>::a::b::c" )
1235
1235
} else {
1236
- tcx. sess . span_bug ( span,
1237
- & format ! ( "found module name used as a type: {}" ,
1238
- tcx . map . node_to_string ( id . node ) ) ) ;
1236
+ span_err ! ( tcx. sess, span, E0247 , "found module name used as a type: {}" ,
1237
+ tcx . map . node_to_string ( id . node ) ) ;
1238
+ return this . tcx ( ) . types . err ;
1239
1239
}
1240
1240
}
1241
1241
def:: DefPrimTy ( prim_ty) => {
1242
1242
prim_ty_to_ty ( tcx, segments, prim_ty)
1243
1243
}
1244
1244
_ => {
1245
- span_fatal ! ( tcx. sess, span, E0248 ,
1246
- "found value name used as a type: {:?}" , * def) ;
1245
+ span_err ! ( tcx. sess, span, E0248 ,
1246
+ "found value name used as a type: {:?}" , * def) ;
1247
+ return this. tcx ( ) . types . err ;
1247
1248
}
1248
1249
} ;
1249
1250
@@ -1278,10 +1279,11 @@ pub fn ast_ty_to_ty<'tcx>(this: &AstConv<'tcx>,
1278
1279
match ast_ty_to_ty_cache. get ( & ast_ty. id ) {
1279
1280
Some ( & ty:: atttce_resolved( ty) ) => return ty,
1280
1281
Some ( & ty:: atttce_unresolved) => {
1281
- span_fatal ! ( tcx. sess, ast_ty. span, E0246 ,
1282
+ span_err ! ( tcx. sess, ast_ty. span, E0246 ,
1282
1283
"illegal recursive type; insert an enum \
1283
1284
or struct in the cycle, if this is \
1284
1285
desired") ;
1286
+ return this. tcx ( ) . types . err ;
1285
1287
}
1286
1288
None => { /* go on */ }
1287
1289
}
0 commit comments