Skip to content

Commit f221479

Browse files
johnmave126emilio
authored andcommitted
Use path_for_whitelisting instead of canonical_path when matching for enum type specification and template opaque type specification
1 parent 57db723 commit f221479

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/ir/enum_ty.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use super::item::Item;
66
use super::ty::{Type, TypeKind};
77
use crate::clang;
88
use crate::ir::annotations::Annotations;
9-
use crate::ir::item::ItemCanonicalPath;
109
use crate::parse::{ClangItemParser, ParseError};
1110
use crate::regex_set::RegexSet;
1211

@@ -153,7 +152,7 @@ impl Enum {
153152
enums: &RegexSet,
154153
item: &Item,
155154
) -> bool {
156-
let path = item.canonical_path(ctx);
155+
let path = item.path_for_whitelisting(ctx);
157156
let enum_ty = item.expect_type();
158157

159158
if enums.matches(&path[1..].join("::")) {

src/ir/template.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
//! ```
2929
3030
use super::context::{BindgenContext, ItemId, TypeId};
31-
use super::item::{IsOpaque, Item, ItemAncestors, ItemCanonicalPath};
31+
use super::item::{IsOpaque, Item, ItemAncestors};
3232
use super::traversal::{EdgeKind, Trace, Tracer};
3333
use crate::clang;
3434
use crate::parse::ClangItemParser;
@@ -306,12 +306,13 @@ impl IsOpaque for TemplateInstantiation {
306306
// correct fix is to make `canonical_{name,path}` include template
307307
// arguments properly.
308308

309-
let mut path = item.canonical_path(ctx);
309+
let mut path = item.path_for_whitelisting(ctx).clone();
310310
let args: Vec<_> = self
311311
.template_arguments()
312312
.iter()
313313
.map(|arg| {
314-
let arg_path = arg.canonical_path(ctx);
314+
let arg_path =
315+
ctx.resolve_item(*arg).path_for_whitelisting(ctx);
315316
arg_path[1..].join("::")
316317
})
317318
.collect();

0 commit comments

Comments
 (0)