Skip to content

Commit e8d91e9

Browse files
bors[bot]philberty
andauthored
Merge #840
840: Add missing abstract method HIR::Pattern::get_locus() const r=philberty a=philberty We have a missing locus here, there many places within the HIR where we are missing location info such as HIR::MatchCase or HIR::MatchArm come to mind. We also need to raise an issue to track CanonicalPath's and location info within the TyTy module as part of a new Identifier structure which will need to be raised in a separate PR+Issue. Co-authored-by: Philip Herron <[email protected]>
2 parents de1ed2e + cd1814f commit e8d91e9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

gcc/rust/hir/tree/rust-hir-pattern.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ class ReferencePattern : public Pattern
404404
return mappings;
405405
}
406406

407+
Location get_locus () const override final { return locus; }
408+
407409
protected:
408410
/* Use covariance to implement clone function as returning this object rather
409411
* than base */

gcc/rust/hir/tree/rust-hir.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ class Pattern
330330

331331
virtual Analysis::NodeMapping get_pattern_mappings () const = 0;
332332

333+
virtual Location get_locus () const = 0;
334+
333335
protected:
334336
// Clone pattern implementation as pure virtual method
335337
virtual Pattern *clone_pattern_impl () const = 0;

0 commit comments

Comments
 (0)