aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-07-07 13:28:43 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2022-07-07 13:28:43 +0200
commit465c59f26041683f07a817e1f8fdda7a8269e5a3 (patch)
tree405c2696fa6603ca9080d9d2b1c2cf5d52d3f573
parentc8a9218a5bab48fffe1f5fa02244954d55f8945c (diff)
downloadgcc-465c59f26041683f07a817e1f8fdda7a8269e5a3.zip
gcc-465c59f26041683f07a817e1f8fdda7a8269e5a3.tar.gz
gcc-465c59f26041683f07a817e1f8fdda7a8269e5a3.tar.bz2
ast: Fix use after move in GenericArg
-rw-r--r--gcc/rust/ast/rust-path.h8
1 files changed, 4 insertions, 4 deletions
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<Expr> 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> 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)