Skip to content

Conversation

@mystor
Copy link
Contributor

@mystor mystor commented Mar 11, 2018

This would fix #68

There's also the option to put this behind the procmacro2_semver_exempt flag if we don't feel confident enough in the stability of this trait impl.

The biggest advantage here of an API like this is it would allow you to write something like:

// Say you have two `syn::Ident`s, a and b, and you want to see if they 
// would refer to the same object (considering hygiene):
fn same_ident(a: Ident, b: Ident) -> bool {
    a.as_ref() == b.as_ref() && a.span.resolved_at(b.span) == a.span
}

@alexcrichton alexcrichton merged commit 77451ca into dtolnay:master Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Eq for Span

2 participants