Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2799619lqz; Wed, 3 Apr 2024 08:57:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUtBeGwUxMWGfJ0nLpeiBvUtx5oTNNosNh+Z8ZKXPZ3f2DoBcdn1IW0OlkAFGNryQ+hPDwne0hak+9hHnL4ax3HzPaOrRkiyvyMFMoOXA== X-Google-Smtp-Source: AGHT+IFLQmXF9HFGeufDSYOIHy6QlbICO1sdDpAkrAxH5o5C8OQLYmkBf9hqpAGufjI+iO2944nV X-Received: by 2002:a17:906:3a91:b0:a4d:f555:fd6 with SMTP id y17-20020a1709063a9100b00a4df5550fd6mr9745883ejd.29.1712159867959; Wed, 03 Apr 2024 08:57:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712159867; cv=pass; d=google.com; s=arc-20160816; b=lGRC21p3jj0pB8NYn46pdjWQDE0jiebRcqp8a4l09V2NPclyaIhG4m7LZLJgU+RjJi lIJ9pOwhTuyWm29hDAAe6lfUq1hRXH2nU9d378SbR89FghdnIM/8L2tWW8TzT1cFK0g0 GHhaKCW/q0so7MBSe3nJZfMSfTDEazpzAjHtDr549e8aEfA9jV2iQS0EImPWzy7tlrYz 1PwMrdxiGNYDtq3zIgSX3+zPIB/2okIR6cxQRiXxwta8UzpyY6/QSsOFFILjRn0MsPkx 1R8NkEmMup1zrLmZH8tks2QJ7vYiiuq3xkbTNk42z7dmvDEOK6SlN/3EP+b0ga78qjU8 t/UA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=vPFCHk3OWJBFBi86Y4ogf6lJWvOX/xxZkf9NxLiL/hI=; fh=1eN+strsLnX8cuvE+uTff7wY1KiEAf1jFO97IDCVf3U=; b=Nk+nLnds9LtrgAskdtbdCAC9iWWYMUPRo/3tuhyplnlQYSVRcetvErrrPWnSBc/DxK ALeSvt8CL+viRZIRKPknKVDWSBu+gZc/uQP7DwfLQKRmWoPzhJlPKQRzOok2Bc1R3PZh AYFV5pkMcAO8nngG3b0U3EQeufQb9WPIVzEsXPXDQsh76m+ipf1F54zc5T/CCT2qqF0Y 9qqjPGBAaF5QoPtFC7VuLcqtc5FerzmVcyj/A+bQojUfA+kaKBbF+FKTYdd18MH2uQ2p WJ1lqCkQugk68Kmc2ZAKJbEQEuciQpUgedlv3Wzd+kVEz1cRs7KFrvIG/Ag0n+Aw1NxS Jd9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=FQ71sGOk; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-130147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130147-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d7-20020a170906304700b00a472245ce9csi6703333ejd.202.2024.04.03.08.57.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 08:57:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=FQ71sGOk; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-130147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130147-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id EED821F237B9 for ; Wed, 3 Apr 2024 15:57:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7805014A622; Wed, 3 Apr 2024 15:57:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="FQ71sGOk" Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74F98139CF5; Wed, 3 Apr 2024 15:57:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.22 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712159846; cv=none; b=XFxpOFd1imztDD69eB7deNJUvBt0AnfVLJCxEPJYI1n8Me63Pv+aDNmlVtKUWTHqeOuF/CumBU0HKlY02PHX2XSwVkk31dtYyCtcabf9/rqdNpNZGMAxcZan1sHsIOO154tqCigQkTVBo0F+aKzOzG+qmfz9cjnwwDzMyZZwMHU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712159846; c=relaxed/simple; bh=IPdeQ17Y6NrMkmAhspaKtFhfNADwjiL3UhLpYVl/ysY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=C30l7prz5e91zMVNyhbFD76Z4aGW/LErLBgW25QGTTLZWPKu7Fu/fxlV7w2I6pCXwp+lnNosAEDkKyguIRFAwb2r9eNCzGvedIYl4KKWiqpgxO6gQNiE6HmG5KX5YlGHFiqLgUGFIKtY4tJmLIAamK4XEFS5Zp5INodGBIgjb1Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b=FQ71sGOk; arc=none smtp.client-ip=185.70.43.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1712159843; x=1712419043; bh=vPFCHk3OWJBFBi86Y4ogf6lJWvOX/xxZkf9NxLiL/hI=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=FQ71sGOkbkmoM1BUbkZwPvMqnpYW0GWfO/Xp67RunUGgMnD0FDrp6sYDFaSVyK57k dqAA9GMNjFNYjIkmkv7wzPh2Q6UcaFv0Qhu/ERGWbok4cIqFBTFmqv9JiDquKeWv4I QKYczTD73MxhKcx0/6N8D5EubuLPKS9y0Ha5T2UyVmvpCio4Go1ceb0al5Z+LKBbLh ZYKN4QQmgryZHtOhx7sU7H7+Auv2ErrQ0eRl1hx93a0S1Azbif72ogXPaIOnWPTYmA 3mxSBca+/qwQQvBApxsjMBjJYLLxtGJqaLCpN948V+CiB2HgCugLFWXnwLRdrGfgqd bwU3R/U2gEWdQ== Date: Wed, 03 Apr 2024 15:57:16 +0000 To: Alice Ryhl , Miguel Ojeda , Andrew Morton From: Benno Lossin Cc: Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg , Marco Elver , Kees Cook , Coly Li , Paolo Abeni , Pierre Gondois , Ingo Molnar , Jakub Kicinski , Wei Yang , Matthew Wilcox , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org Subject: Re: [PATCH 3/9] rust: list: add struct with prev/next pointers Message-ID: <2500d66a-e54e-46d8-97cb-37fd9fc00c45@proton.me> In-Reply-To: <20240402-linked-list-v1-3-b1c59ba7ae3b@google.com> References: <20240402-linked-list-v1-0-b1c59ba7ae3b@google.com> <20240402-linked-list-v1-3-b1c59ba7ae3b@google.com> Feedback-ID: 71780778:user:proton Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02.04.24 14:17, Alice Ryhl wrote: > +/// Implemented by types where a [`ListArc`] can be inserted into = a `List`. > +/// > +/// # Safety > +/// > +/// Implementers must ensure that they provide the guarantees documented= on the three methods > +/// below. > +/// > +/// [`ListArc`]: ListArc > +pub unsafe trait ListItem: ListArcSafe { > + /// Views the [`ListLinks`] for this value. > + /// > + /// # Guarantees > + /// > + /// * If there is a currently active call to `prepare_to_insert`, th= en this returns the same > + /// pointer as the one returned by the currently active call to `p= repare_to_insert`. I was a bit confused by the term "active call to `prepare_to_insert`", since I thought that the function would need to be executed at this moment. I inferred from below that you mean by this that there has been a `prepare_to_insert` call, but not yet a corresponding `post_remove` call. I did not yet find a better way to phrase this. I like putting the guarantees on the functions very much. --=20 Cheers, Benno