Skip to content

Commit

Permalink
HIR: remove obsole double borrow member
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jdupak authored and philberty committed Nov 2, 2023
1 parent 16182dc commit 0a2f8fc
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion gcc/rust/hir/rust-hir-dump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 0 additions & 3 deletions gcc/rust/hir/tree/rust-hir-expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ class OperatorExpr : public ExprWithoutBlock
class BorrowExpr : public OperatorExpr
{
Mutability mut;
bool double_borrow;

public:
std::string as_string () const override;
Expand All @@ -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 */
Expand Down
5 changes: 0 additions & 5 deletions gcc/rust/hir/tree/rust-hir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1182,11 +1182,6 @@ BorrowExpr::as_string () const
{
std::string str ("&");

if (double_borrow)
{
str += "&";
}

if (is_mut ())
{
str += "mut ";
Expand Down

0 comments on commit 0a2f8fc

Please sign in to comment.