From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) by sourceware.org (Postfix) with ESMTPS id C9C703896C20; Wed, 7 Dec 2022 08:53:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C9C703896C20 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=aarsen.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=aarsen.me Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4NRrf02yf9z9sQw; Wed, 7 Dec 2022 09:52:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; t=1670403176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6bCLj8SAa3/yBcY8702HgGSq4h3Pm7m4EuH+sXmlUsk=; b=ggo78Ft07l+Hi7vUV7+LquWsIpwVb3F2RzyMWv+PlVKRuoTgMAb54B6sTqi4uTR0beDAtJ ee9+cvFhzwvio2KyQ9N3fuHRotWolMkDN1Uwsywk3Wt9+CmfAO1dxDzMC61MTb9HNkJLm5 Jk9EEH5/KKUBsKeg6hq631AGmSgi9ElX+yaTeghG+Q/iqb9gmTBOQ28YzYj0jhbZZxkU95 68tmEltEfBrx8XEifh9qSgieW0pXuzn1u9NrRZ28tnjNycFfKr9+DyccV/aj/c5yN6VbJ3 2+wIiJuIWVBIB5zGulWmcWt622yRBFt3dUgUe8cQyoO4ntG2ZAqL1Dx3nNKYbA== References: <20221206101417.778807-1-arthur.cohen@embecosm.com> <20221206101417.778807-21-arthur.cohen@embecosm.com> From: Arsen =?utf-8?Q?Arsenovi=C4=87?= To: arthur.cohen@embecosm.com Cc: gcc-rust@gcc.gnu.org, Philip Herron , gcc-patches@gcc.gnu.org Subject: Re: [PATCH Rust front-end v4 20/46] gccrs: Add wrapper for make_unique Date: Wed, 07 Dec 2022 09:50:40 +0100 In-reply-to: <20221206101417.778807-21-arthur.cohen@embecosm.com> Message-ID: <87r0xbioim.fsf@aarsen.me> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Rspamd-Queue-Id: 4NRrf02yf9z9sQw X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_INFOUSMEBIZ,KAM_SHORT,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable arthur.cohen@embecosm.com writes: > This is a wrapper for make_unique. We can likely get rid of this, as there > are other implementations available, or simply keep using the unique_ptr > constructor. > --- > gcc/rust/util/rust-make-unique.h | 35 ++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) > create mode 100644 gcc/rust/util/rust-make-unique.h > > diff --git a/gcc/rust/util/rust-make-unique.h b/gcc/rust/util/rust-make-u= nique.h > new file mode 100644 > index 00000000000..7b79e625ff1 > --- /dev/null > +++ b/gcc/rust/util/rust-make-unique.h > @@ -0,0 +1,35 @@ > +// Copyright (C) 2020-2022 Free Software Foundation, Inc. > + > +// This file is part of GCC. > + > +// GCC is free software; you can redistribute it and/or modify it under > +// the terms of the GNU General Public License as published by the Free > +// Software Foundation; either version 3, or (at your option) any later > +// version. > + > +// GCC is distributed in the hope that it will be useful, but WITHOUT ANY > +// WARRANTY; without even the implied warranty of MERCHANTABILITY or > +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License > +// for more details. > + > +// You should have received a copy of the GNU General Public License > +// along with GCC; see the file COPYING3. If not see > +// . > + > +#ifndef RUST_MAKE_UNIQUE_H > +#define RUST_MAKE_UNIQUE_H > + > +#include "rust-system.h" > + > +namespace Rust { > + > +template > +std::unique_ptr > +make_unique (Ts &&...params) > +{ > + return std::unique_ptr (new T (std::forward (params)...)); > +} > + > +} // namespace Rust > + > +#endif // RUST_MAKE_UNIQUE_H I think this was added recently, see commit 00d7c8ff16e6838273cea808ffbe22e98104f9d5 and gcc/make-unique.h. =2D-=20 Arsen Arsenovi=C4=87 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIYEARYKAC4WIQT+4rPRE/wAoxYtYGFSwpQwHqLEkwUCY5BUYRAcYXJzZW5AYWFy c2VuLm1lAAoJEFLClDAeosST4zMBAKg/X7RmlcRKcLQSCTm2D+n9Dm9kc50ltYK/ 0xRPikuYAQCTWWIvaUHgXEjmm2GmITBC4dnxL+b9zyEnBhb9Af0jDA== =3vdl -----END PGP SIGNATURE----- --=-=-=--