@@ -1086,9 +1086,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1086
1086
1087
1087
let tcx = self . tcx ( ) ;
1088
1088
1089
- // TODO: rtn comment goes here
1090
- let associated_return_type_bound =
1091
- binding. gen_args . parenthesized && tcx. features ( ) . associated_return_type_bounds ;
1089
+ let return_type_notation =
1090
+ binding. gen_args . parenthesized && tcx. features ( ) . return_type_notation ;
1092
1091
1093
1092
let candidate = if return_type_notation {
1094
1093
if self . trait_defines_associated_item_named (
@@ -1098,8 +1097,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1098
1097
) {
1099
1098
trait_ref
1100
1099
} else {
1101
- // TODO: error
1102
- todo ! ( )
1100
+ return Err ( tcx. sess . emit_err ( crate :: errors:: ReturnTypeNotationMissingMethod {
1101
+ span : binding. span ,
1102
+ trait_name : tcx. item_name ( trait_ref. def_id ( ) ) ,
1103
+ assoc_name : binding. item_name . name ,
1104
+ } ) ) ;
1103
1105
}
1104
1106
} else if self . trait_defines_associated_item_named (
1105
1107
trait_ref. def_id ( ) ,
@@ -1218,7 +1220,14 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1218
1220
{
1219
1221
alias_ty
1220
1222
} else {
1221
- todo ! ( "found return type of {output:?}" ) ;
1223
+ return Err ( self . tcx ( ) . sess . emit_err (
1224
+ crate :: errors:: ReturnTypeNotationOnNonRpitit {
1225
+ span : binding. span ,
1226
+ ty : tcx. liberate_late_bound_regions ( assoc_item. def_id , output) ,
1227
+ fn_span : tcx. hir ( ) . span_if_local ( assoc_item. def_id ) ,
1228
+ note : ( ) ,
1229
+ } ,
1230
+ ) ) ;
1222
1231
} ;
1223
1232
1224
1233
// Finally, move the fn return type's bound vars over to account for the early bound
@@ -1292,9 +1301,10 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
1292
1301
}
1293
1302
1294
1303
match binding. kind {
1295
- ConvertedBindingKind :: Equality ( ..) if associated_return_type_bound => {
1296
- // TODO: error
1297
- todo ! ( )
1304
+ ConvertedBindingKind :: Equality ( ..) if return_type_notation => {
1305
+ return Err ( self . tcx ( ) . sess . emit_err (
1306
+ crate :: errors:: ReturnTypeNotationEqualityBound { span : binding. span } ,
1307
+ ) ) ;
1298
1308
}
1299
1309
ConvertedBindingKind :: Equality ( mut term) => {
1300
1310
// "Desugar" a constraint like `T: Iterator<Item = u32>` this to
0 commit comments