summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoumu <johnmave126@gmail.com>2020-09-14 01:22:24 -0400
committerEmilio Cobos Álvarez <emilio@crisal.io>2020-09-15 00:18:18 +0200
commitf2214790c8e6a5ce2e599564b8f5340d7abca92f (patch)
tree98499a6c7f2b867840e647c89c30e99ee8a481d6
parent57db7232b784f0bd69b9a019923b0a5b30a3eeae (diff)
Use path_for_whitelisting instead of canonical_path when matching for enum type specification and template opaque type specification
-rw-r--r--src/ir/enum_ty.rs3
-rw-r--r--src/ir/template.rs7
2 files changed, 5 insertions, 5 deletions
diff --git a/src/ir/enum_ty.rs b/src/ir/enum_ty.rs
index 17996af6..dde4bb18 100644
--- a/src/ir/enum_ty.rs
+++ b/src/ir/enum_ty.rs
@@ -6,7 +6,6 @@ use super::item::Item;
use super::ty::{Type, TypeKind};
use crate::clang;
use crate::ir::annotations::Annotations;
-use crate::ir::item::ItemCanonicalPath;
use crate::parse::{ClangItemParser, ParseError};
use crate::regex_set::RegexSet;
@@ -153,7 +152,7 @@ impl Enum {
enums: &RegexSet,
item: &Item,
) -> bool {
- let path = item.canonical_path(ctx);
+ let path = item.path_for_whitelisting(ctx);
let enum_ty = item.expect_type();
if enums.matches(&path[1..].join("::")) {
diff --git a/src/ir/template.rs b/src/ir/template.rs
index e2900e95..8c625d1d 100644
--- a/src/ir/template.rs
+++ b/src/ir/template.rs
@@ -28,7 +28,7 @@
//! ```
use super::context::{BindgenContext, ItemId, TypeId};
-use super::item::{IsOpaque, Item, ItemAncestors, ItemCanonicalPath};
+use super::item::{IsOpaque, Item, ItemAncestors};
use super::traversal::{EdgeKind, Trace, Tracer};
use crate::clang;
use crate::parse::ClangItemParser;
@@ -306,12 +306,13 @@ impl IsOpaque for TemplateInstantiation {
// correct fix is to make `canonical_{name,path}` include template
// arguments properly.
- let mut path = item.canonical_path(ctx);
+ let mut path = item.path_for_whitelisting(ctx).clone();
let args: Vec<_> = self
.template_arguments()
.iter()
.map(|arg| {
- let arg_path = arg.canonical_path(ctx);
+ let arg_path =
+ ctx.resolve_item(*arg).path_for_whitelisting(ctx);
arg_path[1..].join("::")
})
.collect();