diff options
-rw-r--r-- | gcc/rust/hir/rust-ast-lower-item.cc | 3 | ||||
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-item.h | 4 | ||||
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-path.h | 9 |
3 files changed, 9 insertions, 7 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-item.cc b/gcc/rust/hir/rust-ast-lower-item.cc index 45072d3..0d59d7f 100644 --- a/gcc/rust/hir/rust-ast-lower-item.cc +++ b/gcc/rust/hir/rust-ast-lower-item.cc @@ -61,7 +61,8 @@ ASTLoweringSimplePath::lower (const AST::SimplePath &path) mappings->get_next_hir_id (crate_num), UNKNOWN_LOCAL_DEFID); - auto lowered = HIR::SimplePath (std::move (segments), mapping); + auto lowered + = HIR::SimplePath (std::move (segments), mapping, path.get_locus ()); mappings->insert_node_to_hir (crate_num, node_id, mapping.get_hirid ()); mappings->insert_simple_path (crate_num, node_id, &path); diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hir-item.h index c1dcf76..5f664af 100644 --- a/gcc/rust/hir/tree/rust-hir-item.h +++ b/gcc/rust/hir/tree/rust-hir-item.h @@ -581,9 +581,7 @@ public: // Creates an error visibility. static Visibility create_error () { - return Visibility (ERROR, - HIR::SimplePath ({}, - Analysis::NodeMapping::get_error ())); + return Visibility (ERROR, HIR::SimplePath::create_error ()); } VisType get_vis_type () const { return vis_type; } diff --git a/gcc/rust/hir/tree/rust-hir-path.h b/gcc/rust/hir/tree/rust-hir-path.h index e3ad838..d153eae 100644 --- a/gcc/rust/hir/tree/rust-hir-path.h +++ b/gcc/rust/hir/tree/rust-hir-path.h @@ -961,19 +961,22 @@ class SimplePath { std::vector<SimplePathSegment> segments; Analysis::NodeMapping mappings; + Location locus; public: SimplePath (std::vector<SimplePathSegment> segments, - Analysis::NodeMapping mappings) - : segments (std::move (segments)), mappings (mappings) + Analysis::NodeMapping mappings, Location locus) + : segments (std::move (segments)), mappings (mappings), locus (locus) {} static HIR::SimplePath create_error () { - return HIR::SimplePath ({}, Analysis::NodeMapping::get_error ()); + return HIR::SimplePath ({}, Analysis::NodeMapping::get_error (), + Location ()); } const Analysis::NodeMapping &get_mappings () const { return mappings; } + const Location &get_locus () const { return locus; } }; } // namespace HIR |