From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f74.google.com (mail-ed1-f74.google.com [209.85.208.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BA313CC9F6 for ; Thu, 4 Jun 2026 11:58:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780574293; cv=none; b=oBVz39ZNVc3FSOTBypfK+x8AAAtd3b0GdSm3SFFhjNnk942qvpZDM3KMc7HAE7sHjML+GUyj08f6ZlVvNMJjS8xXz83cwJ78XArFjJrgYUoPVDlsQjK1EpwdGNn90Qyes8jmOOCoBn1Vk7/3NH9CCRJtWr1aZtaxQ6T8F97yMDo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780574293; c=relaxed/simple; bh=UVIqVMclZDr4qxCyNWMZ/qWloEXWIhQNsmxjFg/How8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=WKoZGKTvX83ZLnr1pcGtaT3W+eNJ0Fhb3mBynAEavbNKUhuqb4GOI2SGnt6G9/qhL8BaxGoE+Und7MgCc71DodTywlujtRy/bCbnUy2k5JJaNY4nH5E8LsDdtOvngevf3BjfSswlg9E2/01H2L0X1TuM1mZr3Z5ZnMdrC6VZ3TE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=KpP0bCD2; arc=none smtp.client-ip=209.85.208.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="KpP0bCD2" Received: by mail-ed1-f74.google.com with SMTP id 4fb4d7f45d1cf-68ae236d5fcso746178a12.2 for ; Thu, 04 Jun 2026 04:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780574291; x=1781179091; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=tsDBf51o8QHp6SAQ5/8ziLKktk7y3LjUQBohqdmyxqM=; b=KpP0bCD2b/xDSQtHVikC8bBAVEkCDL8VxDlAKFX+lHSFzR0z81IFlJ+4uzRY/2Hgdh 2inHTu+MDyzjmAaaTOzIWGTkU1fXI5fI3HBEuaXTBUMwvIRRJ+4ekBhknPlqKD37mxGx Le3XPZ5kcn1uVcxkXfDzMhg8LvjCM3c+7p6Bly6Pt3MpzHjj0wmaJYDbLkEkS2vWU2bV 7i+QERjYZPVCQkqgiRkLy7ucx6Ln5Ss9F2TY5VL2t4eTx4j2/W9qzKt64/tmrN69UK/w 6YD296c1YccmGZ3pvIeyU9oeaLG2h1YIlDzmbZfWfati3tijexUr+megDrQB24YwjofU y0Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780574291; x=1781179091; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tsDBf51o8QHp6SAQ5/8ziLKktk7y3LjUQBohqdmyxqM=; b=F3LAh9ZJ+c/ZdFynZmcLOUxMKtUvGo/m5Fiw/jH4Bx/FarEqcFpJGBGl489y+TsKno aWm+0OHo3pER/oBCt52KK63qgXc+jLewa/vnhd/S8IU17BEv+/EPWFiAqzvPkHsHlqqB ZPw9dNSSMiBOZWVpMb+CCTNQ6zrU3w7OWjXShD/Bg2we+0pOdhclnl94hmfdh1W6pgGL KaKN4RtqrFJU+Ftkv1m7HrXBCT6dey2QVW1HVZxAq+2bWBZNwxy8zDkAcJMqTbbMCKc6 ZsRPCt2o2uo8yHBNvTz89JvswQWscvjdwElSucqBLs5i+c9bkGbHOc9e6oEEkKXhQmN8 Llxw== X-Forwarded-Encrypted: i=1; AFNElJ8Kj3YZpgzRCaoGbGiCZgQKKMNG0lHM250f0YmHJ49U3PvOVEnmFKVhIQROztiu5CYtI25E6c4FKeL6D9A=@vger.kernel.org X-Gm-Message-State: AOJu0Yw/1Wd2FBoXIRQG9S22LChVWgtGaLzaUaGH09orCZmnYZKLRA3/ vhXFPsmf0nfGCbkrSNA64RoHi1pv+iM033rMcOH3B0lclmbpTIwvrDXVo/jnJ2j98iZ8CQ2Q7tO 5J2ntd7POdmgmZQQUpQ== X-Received: from edrm6.prod.google.com ([2002:aa7:d346:0:b0:68b:163d:99f3]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:27cf:b0:688:1d5:44c5 with SMTP id 4fb4d7f45d1cf-68e6f79352amr4016032a12.2.1780574290900; Thu, 04 Jun 2026 04:58:10 -0700 (PDT) Date: Thu, 4 Jun 2026 11:58:09 +0000 In-Reply-To: <20260603195210.693856-6-lyude@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260603195210.693856-1-lyude@redhat.com> <20260603195210.693856-6-lyude@redhat.com> Message-ID: Subject: Re: [PATCH v17 5/6] rust: sync: Add SetOnce::reset() From: Alice Ryhl To: Lyude Paul Cc: dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org, nouveau@lists.freedesktop.org, Alexandre Courbot , Gary Guo , "Christian =?utf-8?B?S8O2bmln?=" , driver-core@lists.linux.dev, Miguel Ojeda , Maarten Lankhorst , Simona Vetter , linux-kernel@vger.kernel.org, Sumit Semwal , linux-media@vger.kernel.org, "Rafael J . Wysocki" , Maxime Ripard , Benno Lossin , linaro-mm-sig@lists.linaro.org, Danilo Krummrich , Mukesh Kumar Chaurasiya , Asahi Lina , Daniel Almeida , Greg Kroah-Hartman Content-Type: text/plain; charset="utf-8" On Wed, Jun 03, 2026 at 03:42:34PM -0400, Lyude Paul wrote: > This function simply drops the contents of the SetOnce, given a mutable > reference - since that proves we have exclusive access to the SetOnce. > Additionally, update the invariants for SetOnce to make it clear as to why > this is safe. > > Signed-off-by: Lyude Paul This isn't needed, you can just do: unsafe { (*this).sgt_res = SetOnce::new() };