File tree 1 file changed +1
-5
lines changed
compiler/rustc_builtin_macros/src
1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -1316,8 +1316,6 @@ pub fn expand_preparsed_format_args(
1316
1316
. map ( |span| fmt_span. from_inner ( InnerSpan :: new ( span. start , span. end ) ) )
1317
1317
. collect ( ) ;
1318
1318
1319
- let named_pos: FxHashSet < usize > = names. values ( ) . cloned ( ) . collect ( ) ;
1320
-
1321
1319
let mut cx = Context {
1322
1320
ecx,
1323
1321
args,
@@ -1388,11 +1386,9 @@ pub fn expand_preparsed_format_args(
1388
1386
. enumerate ( )
1389
1387
. filter ( |( i, ty) | ty. is_empty ( ) && !cx. count_positions . contains_key ( & i) )
1390
1388
. map ( |( i, _) | {
1391
- let msg = if named_pos. contains ( & i) {
1392
- // named argument
1389
+ let msg = if cx. args [ i] . name . is_some ( ) {
1393
1390
"named argument never used"
1394
1391
} else {
1395
- // positional argument
1396
1392
"argument never used"
1397
1393
} ;
1398
1394
( cx. args [ i] . expr . span , msg)
You can’t perform that action at this time.
0 commit comments