From 465c59f26041683f07a817e1f8fdda7a8269e5a3 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Thu, 7 Jul 2022 13:28:43 +0200 Subject: ast: Fix use after move in GenericArg --- gcc/rust/ast/rust-path.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gcc/rust/ast') diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h index 722ed93..cc79e27 100644 --- a/gcc/rust/ast/rust-path.h +++ b/gcc/rust/ast/rust-path.h @@ -164,14 +164,14 @@ public: static GenericArg create_const (std::unique_ptr expression) { - return GenericArg (std::move (expression), nullptr, "", Kind::Const, - expression->get_locus ()); + auto locus = expression->get_locus (); + return GenericArg (std::move (expression), nullptr, "", Kind::Const, locus); } static GenericArg create_type (std::unique_ptr type) { - return GenericArg (nullptr, std::move (type), "", Kind::Type, - type->get_locus ()); + auto locus = type->get_locus (); + return GenericArg (nullptr, std::move (type), "", Kind::Type, locus); } static GenericArg create_ambiguous (Identifier path, Location locus) -- cgit v1.1