From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F417C52D7C for ; Thu, 15 Aug 2024 13:33:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ABC0C6B00EC; Thu, 15 Aug 2024 09:33:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A6B2B6B00F2; Thu, 15 Aug 2024 09:33:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 932C46B00F3; Thu, 15 Aug 2024 09:33:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 767AE6B00EC for ; Thu, 15 Aug 2024 09:33:35 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id BB4ACC086F for ; Thu, 15 Aug 2024 13:33:34 +0000 (UTC) X-FDA: 82454571948.19.A4CEB1C Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf05.hostedemail.com (Postfix) with ESMTP id 14729100014 for ; Thu, 15 Aug 2024 13:33:32 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ngYAa+J4; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf05.hostedemail.com: domain of dakr@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=dakr@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723728731; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=a38F+Zv6HCebRWX0rZJfLGe7qy8vLG5fmi2nLsTQU9Q=; b=77Xxdrs8aSJhsF76eOYSlD5TRMucwGJ48fMNySOIcZhQdvXM6ss4W23fUP4oJzouf8N8AP dXK4RTXO14AK3zmQrGuhYaCnLgX4nODq7QmhK1gIEbKnrKas6IdQpqvioG5PLCqodvssdv ox8eDKjVy5HTi74tm4aZT0Zqp/rxNzA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723728731; a=rsa-sha256; cv=none; b=47nsWVjb4DowYKfsZzjiRHDjdGFfHY2zbKlVt5A3/xi+RXQhithRpM2HVBsn8fVMk/zI++ +awylK0/bUFy4F0HsfTqXSNGJ2Lex8NIfGQ9qOJQzsLp4GZH7Xsyhb0vUISm6EmKVoOs8s 25rwNmsC7HHBbgdVMfzcr8rvAv9bOBw= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ngYAa+J4; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf05.hostedemail.com: domain of dakr@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=dakr@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id DEB8361E9F; Thu, 15 Aug 2024 13:33:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E65E4C32786; Thu, 15 Aug 2024 13:33:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723728811; bh=PyWZsXcN1KLaK/0ybPQA0H3GW8k5zX8A1tAoYrLpzpE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ngYAa+J4Ou6sP2e00T0jBO21XSV4TJCGBdv5oJJqDxbg0+WiW9Waf8Pd9QTu0SvLX 73iVIVi59bIdBbu0KRHJXpq6h/qZBZMIFQTslKrx1evOMnd7LtWu6zyBEpWRchHBL3 853MrCVLMtUDryXkpE7QtPDczyLmiLYb98sbou9oHVkATDhSofH7rjb541/PpgfZsl soRlMuPnq0KbZ7hqusJV3CU0i7/fNKrd6KHVllQkO/AS01Q8zQyA/hK1RQPkvbsWb/ SWAkU42i70iGbdxkVso5lVTJBGzG8do4sIBRTw0ErenTFaleOh7D0q1ukBFu+HIBpz o+837E+kpnjqw== Date: Thu, 15 Aug 2024 15:33:24 +0200 From: Danilo Krummrich To: Alice Ryhl Cc: Boqun Feng , ojeda@kernel.org, alex.gaynor@gmail.com, wedsonaf@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, benno.lossin@proton.me, a.hindborg@samsung.com, akpm@linux-foundation.org, daniel.almeida@collabora.com, faith.ekstrand@collabora.com, boris.brezillon@collabora.com, lina@asahilina.net, mcanal@igalia.com, zhiw@nvidia.com, cjia@nvidia.com, jhubbard@nvidia.com, airlied@redhat.com, ajanulgu@redhat.com, lyude@redhat.com, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v5 00/26] Generic `Allocator` support for Rust Message-ID: References: <20240812182355.11641-1-dakr@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 14729100014 X-Stat-Signature: 3maqbjnoh1neqtwquwbzia8r1zzym9dp X-Rspam-User: X-HE-Tag: 1723728812-164182 X-HE-Meta: U2FsdGVkX18gBgJM7TD/nB3vVMFd7N2R+5pDtQBvmkPiFRGxZMGnrKF2YAmMrdul8Oi6Trv6XyhoGzUhjXI4ap8hyOCYQrH49ud2HjM2bGNUNTLZSnyhcW++RA6lfrNOk+YlTMVQAjFRf178LLYo68W8rUQiSq5iK7j8c8IVd25T03fXlR4pJB3sKveUUR9bZf7LS3yE1t3RiFhXO8pIfvmTxm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j+V01Twh/mXpvLDPaxDupNbn3I5/34bFQiL60a46xHTtRuiLaZlPdLUtRgxd9W6GQRB1NDdnuPGb3g X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Aug 15, 2024 at 02:34:50PM +0200, Alice Ryhl wrote: > On Thu, Aug 15, 2024 at 2:33 PM Danilo Krummrich wrote: > > > > On Thu, Aug 15, 2024 at 11:20:32AM +0200, Alice Ryhl wrote: > > > On Thu, Aug 15, 2024 at 4:52 AM Danilo Krummrich wrote: > > > > > > > > On Wed, Aug 14, 2024 at 12:32:15PM -0700, Boqun Feng wrote: > > > > > Hi Danilo, > > > > > > > > > > I'm trying to put your series on rust-dev, but I hit a few conflicts due > > > > > to the conflict with `Box::drop_contents`, which has been in rust-dev > > > > > for a while. And the conflict is not that trivial for me to resolve. > > > > > So just a head-up, that's a requirement for me to put it on rust-dev for > > > > > more tests from my end ;-) > > > > > > > > I rebased everything and you can fetch them from [1]. > > > > > > > > I resolved the following conflicts: > > > > > > > > - for `Box`, implement > > > > - `drop_contents` > > > > - `manually_drop_contents` [2] > > > > > > Not sure I like this name. It sounds like something that runs the > > > destructor, but it does the exact opposite. > > > > I thought it kinda makes sense, since it's analogous to `ManuallyDrop::new`. > > > > What about `Box::forget_contents` instead? > > One option is `into_manually_drop`. This uses the convention of using > the `into_*` prefix for conversions that take ownership of the > original value. The signature of the current `Box::manually_drop_contents` is the same as for `Box::drop_contents`, namely `fn manually_drop_contents(this: Self) -> Box, A>`. `into_manually_drop` seems misleading for for returning a `Box, A>`. I still think `forget_contents` hits it quite well. Just as `drop_contents` drops the value, `forget_contents` makes the `Box` forget the value. > > Alice >