Skip to content

Commit a639fdb

Browse files
committed
Get rid of named_pos in format_args impl.
1 parent 2808e07 commit a639fdb

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

compiler/rustc_builtin_macros/src/format.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1316,8 +1316,6 @@ pub fn expand_preparsed_format_args(
13161316
.map(|span| fmt_span.from_inner(InnerSpan::new(span.start, span.end)))
13171317
.collect();
13181318

1319-
let named_pos: FxHashSet<usize> = names.values().cloned().collect();
1320-
13211319
let mut cx = Context {
13221320
ecx,
13231321
args,
@@ -1388,11 +1386,9 @@ pub fn expand_preparsed_format_args(
13881386
.enumerate()
13891387
.filter(|(i, ty)| ty.is_empty() && !cx.count_positions.contains_key(&i))
13901388
.map(|(i, _)| {
1391-
let msg = if named_pos.contains(&i) {
1392-
// named argument
1389+
let msg = if cx.args[i].name.is_some() {
13931390
"named argument never used"
13941391
} else {
1395-
// positional argument
13961392
"argument never used"
13971393
};
13981394
(cx.args[i].expr.span, msg)

0 commit comments

Comments
 (0)