summaryrefslogtreecommitdiff
path: root/src/ir/context.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/context.rs')
-rw-r--r--src/ir/context.rs20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/ir/context.rs b/src/ir/context.rs
index b2e6f985..9afd16d6 100644
--- a/src/ir/context.rs
+++ b/src/ir/context.rs
@@ -2296,7 +2296,8 @@ If you encounter an error missing from this list, please file an issue or a PR!"
// game.
if self.options().allowlisted_types.is_empty() &&
self.options().allowlisted_functions.is_empty() &&
- self.options().allowlisted_vars.is_empty()
+ self.options().allowlisted_vars.is_empty() &&
+ self.options().allowlisted_files.is_empty()
{
return true;
}
@@ -2307,6 +2308,23 @@ If you encounter an error missing from this list, please file an issue or a PR!"
return true;
}
+ // Items with a source location in an explicitly allowlisted file
+ // are always included.
+ if !self.options().allowlisted_files.is_empty() {
+ if let Some(location) = item.location() {
+ let (file, _, _, _) = location.location();
+ if let Some(filename) = file.name() {
+ if self
+ .options()
+ .allowlisted_files
+ .matches(&filename)
+ {
+ return true;
+ }
+ }
+ }
+ }
+
let name = item.path_for_allowlisting(self)[1..].join("::");
debug!("allowlisted_items: testing {:?}", name);
match *item.kind() {