Rollup merge of #106946 - dtolnay:hashlinecolumn, r=m-ou-se

implement Hash for proc_macro::LineColumn

For use in `HashMap<LineColumn, TokenTree>` or `HashMap<LineColumn, Comment>`, for example.

[Here is an example of one case complicated by the absence of this impl.](71bc45e417/src/comments.rs (L25-L34))

Tracking issue: https://github.com/rust-lang/rust/issues/54725
This commit is contained in:
Matthias Krüger 2023-01-26 07:53:24 +01:00 committed by GitHub
commit d667105681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -581,7 +581,7 @@ impl fmt::Debug for Span {
/// A line-column pair representing the start or end of a `Span`.
#[unstable(feature = "proc_macro_span", issue = "54725")]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub struct LineColumn {
/// The 1-indexed line in the source file on which the span starts or ends (inclusive).
#[unstable(feature = "proc_macro_span", issue = "54725")]