This repository was archived by the owner on May 28, 2025. It is now read-only.
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() {
87
87
let f = _fn_test;
88
88
f ( ) ;
89
89
}
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.
92
93
async fn await_desugaring ( ) {
93
94
async fn foo ( ) { }
95
+ fn uses_i ( _i : i32 ) { }
96
+
94
97
foo ( ) . await ;
98
+ ( {
99
+ let _i = 5 ;
100
+ uses_i ( _i) ;
101
+ foo ( )
102
+ } )
103
+ . await
95
104
}
96
105
97
106
fn 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
30
30
LL | s._underscore_field += 1;
31
31
| ^^^^^^^^^^^^^^^^^^^
32
32
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
34
40
You can’t perform that action at this time.
0 commit comments