Skip to content

Commit 8926902

Browse files
pvdrzemilio
authored andcommitted
emit warnings later
1 parent bc19e55 commit 8926902

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/ir/context.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,24 +2440,21 @@ If you encounter an error missing from this list, please file an issue or a PR!"
24402440
let mut warnings = Vec::new();
24412441

24422442
for item in self.options().allowlisted_functions.unmatched_items() {
2443-
let warn = format!("unused option: --allowlist-function {}", item);
2444-
warn!("{}", warn);
2445-
warnings.push(warn);
2443+
warnings.push(format!("unused option: --allowlist-function {}", item));
24462444
}
24472445

24482446
for item in self.options().allowlisted_vars.unmatched_items() {
2449-
let warn = format!("unused option: --allowlist-var {}", item);
2450-
warn!("{}", warn);
2451-
warnings.push(warn);
2447+
warnings.push(format!("unused option: --allowlist-var {}", item));
24522448
}
24532449

24542450
for item in self.options().allowlisted_types.unmatched_items() {
2455-
let warn = format!("unused option: --allowlist-type {}", item);
2456-
warn!("{}", warn);
2457-
warnings.push(warn);
2451+
warnings.push(format!("unused option: --allowlist-type {}", item));
24582452
}
24592453

2460-
self.warnings.extend(warnings);
2454+
for msg in warnings {
2455+
warn!("{}", msg);
2456+
self.warnings.push(msg);
2457+
}
24612458
}
24622459

24632460
/// Convenient method for getting the prefix to use for most traits in

0 commit comments

Comments
 (0)