From 0a2f8fc8f28066f05517a57bfa43551e238f01ac Mon Sep 17 00:00:00 2001 From: Jakub Dupak Date: Thu, 2 Nov 2023 13:42:48 +0100 Subject: [PATCH] HIR: remove obsole double borrow member gcc/rust/ChangeLog: * hir/rust-hir-dump.cc (Dump::visit): Remove obsolete member. * hir/tree/rust-hir-expr.h (class BorrowExpr): Remove obsolete member. * hir/tree/rust-hir.cc (BorrowExpr::as_string): Remove obsolete member. Signed-off-by: Jakub Dupak --- gcc/rust/hir/rust-hir-dump.cc | 1 - gcc/rust/hir/tree/rust-hir-expr.h | 3 --- gcc/rust/hir/tree/rust-hir.cc | 5 ----- 3 files changed, 9 deletions(-) diff --git a/gcc/rust/hir/rust-hir-dump.cc b/gcc/rust/hir/rust-hir-dump.cc index 8e31f2774382..28d73edb6c5c 100644 --- a/gcc/rust/hir/rust-hir-dump.cc +++ b/gcc/rust/hir/rust-hir-dump.cc @@ -808,7 +808,6 @@ Dump::visit (BorrowExpr &e) begin ("BorrowExpr"); do_operatorexpr (e); - put_field ("double_borrow", std::to_string (e.is_double_borrow ())); put_field ("mut", enum_to_str (e.get_mut ())); end ("BorrowExpr"); diff --git a/gcc/rust/hir/tree/rust-hir-expr.h b/gcc/rust/hir/tree/rust-hir-expr.h index c5abeaa23a05..a13a34e0a25d 100644 --- a/gcc/rust/hir/tree/rust-hir-expr.h +++ b/gcc/rust/hir/tree/rust-hir-expr.h @@ -213,7 +213,6 @@ class OperatorExpr : public ExprWithoutBlock class BorrowExpr : public OperatorExpr { Mutability mut; - bool double_borrow; public: std::string as_string () const override; @@ -232,8 +231,6 @@ class BorrowExpr : public OperatorExpr Mutability get_mut () const { return mut; } bool is_mut () const { return mut == Mutability::Mut; } - bool is_double_borrow () const { return double_borrow; } - protected: /* Use covariance to implement clone function as returning this object rather * than base */ diff --git a/gcc/rust/hir/tree/rust-hir.cc b/gcc/rust/hir/tree/rust-hir.cc index f27cad55bc02..5e5c4f6aba94 100644 --- a/gcc/rust/hir/tree/rust-hir.cc +++ b/gcc/rust/hir/tree/rust-hir.cc @@ -1182,11 +1182,6 @@ BorrowExpr::as_string () const { std::string str ("&"); - if (double_borrow) - { - str += "&"; - } - if (is_mut ()) { str += "mut ";