-
Notifications
You must be signed in to change notification settings - Fork 742
Allow aliases and template aliases to be considered for replacement #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, not ultra-pretty, but I guess it makes sense, since it's what we use to get the replacement association.
r=me, optionally with those nits.
@@ -320,23 +320,28 @@ impl<'ctx> BindgenContext<'ctx> { | |||
let mut replacements = vec![]; | |||
|
|||
for (id, item) in self.items.iter() { | |||
// Calls to `canonical_name` are expensive, so eagerly filter out | |||
// items that cannot be replaced. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this newline may be removed
continue; | ||
match *ty.kind() { | ||
TypeKind::Comp(ref ci) if !ci.is_template_specialization() => {} | ||
TypeKind::TemplateAlias(_, _) => {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Maybe TypeKind::TemplateAlias(_, _) | TypeKind::Alias(_, _) => {}
?
124b7ca
to
8041ebf
Compare
Fixed nits! |
@bors-servo r+ Thanks! |
📌 Commit 8041ebf has been approved by |
Allow aliases and template aliases to be considered for replacement Fixes #89. I'm not exactly *happy* with the way this is implemented (making `real_canonical_name` public so that we can use it in replacement lookups) but I'm not sure of a better way without refactoring most of how naming works right now. r? @emilio
☀️ Test successful - status-travis |
Fixes #89.
I'm not exactly happy with the way this is implemented (making
real_canonical_name
public so that we can use it in replacement lookups) but I'm not sure of a better way without refactoring most of how naming works right now.r? @emilio