Skip to content

Commit d667105

Browse files
authored
Rollup merge of rust-lang#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#54725
2 parents 35a8d6f + 25f0147 commit d667105

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/proc_macro/src/lib.rs

+1-1
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)