Skip to content

Commit

Permalink
Rollup merge of rust-lang#106946 - dtolnay:hashlinecolumn, r=m-ou-se
Browse files Browse the repository at this point in the history
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
  • Loading branch information
matthiaskrgr authored Jan 26, 2023
2 parents 35a8d6f + 25f0147 commit d667105
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit d667105

Please sign in to comment.