File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -87,11 +87,20 @@ fn non_variables() {
8787 let f = _fn_test;
8888 f ( ) ;
8989}
90- // Tests that we do not lint if the binding comes from await desugaring.
91- // See issue 5360.
90+
91+ // Tests that we do not lint if the binding comes from await desugaring,
92+ // but we do lint the awaited expression. See issue 5360.
9293async fn await_desugaring ( ) {
9394 async fn foo ( ) { }
95+ fn uses_i ( _i : i32 ) { }
96+
9497 foo ( ) . await ;
98+ ( {
99+ let _i = 5 ;
100+ uses_i ( _i) ;
101+ foo ( )
102+ } )
103+ . await
95104}
96105
97106fn main ( ) {
Original file line number Diff line number Diff line change @@ -30,5 +30,11 @@ error: used binding `_underscore_field` which is prefixed with an underscore. A
3030LL | s._underscore_field += 1;
3131 | ^^^^^^^^^^^^^^^^^^^
3232
33- error: aborting due to 5 previous errors
33+ error: used binding `_i` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
34+ --> $DIR/used_underscore_binding.rs:100:16
35+ |
36+ LL | uses_i(_i);
37+ | ^^
38+
39+ error: aborting due to 6 previous errors
3440
You can’t perform that action at this time.
0 commit comments