diff options
author | Christian Poveda <christian.poveda@ferrous-systems.com> | 2022-08-16 11:36:40 -0500 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2022-08-18 18:08:37 +0200 |
commit | 89269026daae91c29aa555ffd3fe978741f88032 (patch) | |
tree | cc51326e8dfacaeba788767954f3703aecc4d7fe /src | |
parent | bc19e553da2e5c89470f413b1e07e4c9a5647b58 (diff) |
emit warnings later
Diffstat (limited to 'src')
-rw-r--r-- | src/ir/context.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/ir/context.rs b/src/ir/context.rs index 61fa8439..a91d5224 100644 --- a/src/ir/context.rs +++ b/src/ir/context.rs @@ -2440,24 +2440,21 @@ If you encounter an error missing from this list, please file an issue or a PR!" let mut warnings = Vec::new(); for item in self.options().allowlisted_functions.unmatched_items() { - let warn = format!("unused option: --allowlist-function {}", item); - warn!("{}", warn); - warnings.push(warn); + warnings.push(format!("unused option: --allowlist-function {}", item)); } for item in self.options().allowlisted_vars.unmatched_items() { - let warn = format!("unused option: --allowlist-var {}", item); - warn!("{}", warn); - warnings.push(warn); + warnings.push(format!("unused option: --allowlist-var {}", item)); } for item in self.options().allowlisted_types.unmatched_items() { - let warn = format!("unused option: --allowlist-type {}", item); - warn!("{}", warn); - warnings.push(warn); + warnings.push(format!("unused option: --allowlist-type {}", item)); } - self.warnings.extend(warnings); + for msg in warnings { + warn!("{}", msg); + self.warnings.push(msg); + } } /// Convenient method for getting the prefix to use for most traits in |