@@ -1086,9 +1086,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
10861086
10871087 let tcx = self . tcx ( ) ;
10881088
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 ;
10921091
10931092 let candidate = if return_type_notation {
10941093 if self . trait_defines_associated_item_named (
@@ -1098,8 +1097,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
10981097 ) {
10991098 trait_ref
11001099 } 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+ } ) ) ;
11031105 }
11041106 } else if self . trait_defines_associated_item_named (
11051107 trait_ref. def_id ( ) ,
@@ -1218,7 +1220,14 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
12181220 {
12191221 alias_ty
12201222 } 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+ ) ) ;
12221231 } ;
12231232
12241233 // 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 {
12921301 }
12931302
12941303 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+ ) ) ;
12981308 }
12991309 ConvertedBindingKind :: Equality ( mut term) => {
13001310 // "Desugar" a constraint like `T: Iterator<Item = u32>` this to
0 commit comments