77use core:: ops:: { ControlFlow , ControlFlow :: Continue } ;
88use dep:: { MyUninhabited , MyUninhabitedNonexhaustive } ;
99
10- fn f1 ( ) -> Result < ( ) , ( ) > {
10+ fn result_unit_unit ( ) -> Result < ( ) , ( ) > {
1111 Ok ( ( ) )
1212}
1313
14- fn f2 ( ) -> Result < ( ) , core:: convert:: Infallible > {
14+ fn result_unit_infallible ( ) -> Result < ( ) , core:: convert:: Infallible > {
1515 Ok ( ( ) )
1616}
1717
18- fn f3 ( ) -> Result < ( ) , !> {
18+ fn result_unit_never ( ) -> Result < ( ) , !> {
1919 Ok ( ( ) )
2020}
2121
22- fn f4 ( ) -> Result < ( ) , MyUninhabited > {
22+ fn result_unit_myuninhabited ( ) -> Result < ( ) , MyUninhabited > {
2323 Ok ( ( ) )
2424}
2525
26- fn f5 ( ) -> Result < ( ) , MyUninhabitedNonexhaustive > {
26+ fn result_unit_myuninhabited_nonexhaustive ( ) -> Result < ( ) , MyUninhabitedNonexhaustive > {
2727 Ok ( ( ) )
2828}
2929
@@ -41,53 +41,53 @@ impl AssocType for S2 {
4141 type Error = ( ) ;
4242}
4343
44- fn f6 < AT : AssocType > ( _: AT ) -> Result < ( ) , AT :: Error > {
44+ fn result_unit_assoctype < AT : AssocType > ( _: AT ) -> Result < ( ) , AT :: Error > {
4545 Ok ( ( ) )
4646}
4747
4848trait UsesAssocType {
4949 type Error ;
50- fn method ( & self ) -> Result < ( ) , Self :: Error > ;
50+ fn method_use_assoc_type ( & self ) -> Result < ( ) , Self :: Error > ;
5151}
5252
5353impl UsesAssocType for S1 {
5454 type Error = !;
55- fn method ( & self ) -> Result < ( ) , Self :: Error > {
55+ fn method_use_assoc_type ( & self ) -> Result < ( ) , Self :: Error > {
5656 Ok ( ( ) )
5757 }
5858}
5959
6060impl UsesAssocType for S2 {
6161 type Error = ( ) ;
62- fn method ( & self ) -> Result < ( ) , Self :: Error > {
62+ fn method_use_assoc_type ( & self ) -> Result < ( ) , Self :: Error > {
6363 Err ( ( ) )
6464 }
6565}
6666
67- fn c1 ( ) -> ControlFlow < ( ) > {
67+ fn controlflow_unit ( ) -> ControlFlow < ( ) > {
6868 Continue ( ( ) )
6969}
7070
71- fn c2 ( ) -> ControlFlow < core:: convert:: Infallible , ( ) > {
71+ fn controlflow_infallible_unit ( ) -> ControlFlow < core:: convert:: Infallible , ( ) > {
7272 Continue ( ( ) )
7373}
7474
75- fn c3 ( ) -> ControlFlow < !> {
75+ fn controlflow_never ( ) -> ControlFlow < !> {
7676 Continue ( ( ) )
7777}
7878
7979fn main ( ) {
80- f1 ( ) ; //~ ERROR: unused `Result` that must be used
81- f2 ( ) ;
82- f3 ( ) ;
83- f4 ( ) ;
84- f5 ( ) ; //~ ERROR: unused `Result` that must be used
85- f6 ( S1 ) ;
86- f6 ( S2 ) ; //~ ERROR: unused `Result` that must be used
87- S1 . method ( ) ;
88- S2 . method ( ) ; //~ ERROR: unused `Result` that must be used
89-
90- c1 ( ) ; //~ ERROR: unused `ControlFlow` that must be used
91- c2 ( ) ;
92- c3 ( ) ;
80+ result_unit_unit ( ) ; //~ ERROR: unused `Result` that must be used
81+ result_unit_infallible ( ) ;
82+ result_unit_never ( ) ;
83+ result_unit_myuninhabited ( ) ;
84+ result_unit_myuninhabited_nonexhaustive ( ) ; //~ ERROR: unused `Result` that must be used
85+ result_unit_assoctype ( S1 ) ;
86+ result_unit_assoctype ( S2 ) ; //~ ERROR: unused `Result` that must be used
87+ S1 . method_use_assoc_type ( ) ;
88+ S2 . method_use_assoc_type ( ) ; //~ ERROR: unused `Result` that must be used
89+
90+ controlflow_unit ( ) ; //~ ERROR: unused `ControlFlow` that must be used
91+ controlflow_infallible_unit ( ) ;
92+ controlflow_never ( ) ;
9393}
0 commit comments