Skip to content

Commit ab13660

Browse files
authored
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.](https://github.com/andrewbaxter/genemichaels/blob/71bc45e417c3f9dae09f890f1ec4630e758e5c70/src/comments.rs#L25-L34) Tracking issue: rust-lang/rust#54725
2 parents 4e62128 + 7ddcdd9 commit ab13660

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

proc_macro/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ impl fmt::Debug for Span {
581581

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

0 commit comments

Comments
 (0)