diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index a2d088e05947..35612935d7c3 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -1495,7 +1495,7 @@ class TraitItem : virtual public AssociatedItem } NodeId get_node_id () const { return node_id; } - location_t get_locus () const { return locus; } + location_t get_locus () const override { return locus; } }; /* Abstract base class for items used within an inherent impl block (the impl diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h index 99cb908e8049..bcc33dc01a95 100644 --- a/gcc/rust/ast/rust-item.h +++ b/gcc/rust/ast/rust-item.h @@ -3291,7 +3291,7 @@ class TraitItemConst : public TraitItem std::string as_string () const override; - location_t get_locus () const { return locus; } + location_t get_locus () const override { return locus; } void accept_vis (ASTVisitor &vis) override;