diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-07-07 14:30:24 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-07 14:30:24 +0000 |
commit | a5c82a1d2b430585b915801a2ae1b73f1ea65f60 (patch) | |
tree | 91e0fc893bef1dbe69405045da179a2fd790e835 /gcc | |
parent | d4dda7805fc333af269d5c8cf829aa2e66acfc57 (diff) | |
parent | 465c59f26041683f07a817e1f8fdda7a8269e5a3 (diff) | |
download | gcc-a5c82a1d2b430585b915801a2ae1b73f1ea65f60.zip gcc-a5c82a1d2b430585b915801a2ae1b73f1ea65f60.tar.gz gcc-a5c82a1d2b430585b915801a2ae1b73f1ea65f60.tar.bz2 |
Merge #1370
1370: ast: Fix use after move in GenericArg r=philberty a=CohenArthur
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/ast/rust-path.h | 8 |
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) |