From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 2699F1F4192; Sat, 7 Jun 2025 20:19:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749327580; cv=none; b=jF65looRofnuHMA3ns7evAC82OtnRuy5t9xsh5RBL2SZ/ELkDpChHZKtdWra1ypa9WqHbLAnbndvGVssMHCel2fQ+0STE/43Rf3NZISrIWiaCg6pVRW4UhxflT+HpWz+YVLhu949SVDDmzj04FTV25a67LF4n1ICbFEgzO5K0SY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749327580; c=relaxed/simple; bh=fF6oAYruo67B8ANaWdEygvjygHRwVNWqO77vnfX3Ou4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KULbfLg0yCwNgqYfXenV1qUcEAZCqCjl94iPDqMJbwPtxBmnhPzW5ZURCUvkJp6jKG9+lRuTz1fSOR+cid3+cqaWqDklS7LsCmfwWrHBPQ53sEQLDtDZgdSKXRG7sG9C7eIbkgKz3/PgOXC2/VSmHTeqC3Llv99z3FaDYKAY/2M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fV9kZ4kI; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fV9kZ4kI" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-3a50fc819f2so2468564f8f.2; Sat, 07 Jun 2025 13:19:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749327575; x=1749932375; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=c2LwqptFTMBLVEe+Jaa58kLLDLdto2SH/hE0L4GQVKo=; b=fV9kZ4kIUfBxTyGjZhZU+DEsO2cL+C8zgUB1sCqJgR0KneVm3PiQ+pxwySqY5zW11g Vxelcf6jOI3VIsHDvd7eBvoLLAClxLVG+epAxEEUnH1KdJV2G3k3AY1JxQeXCC6CNTie BQQE+wg2aqwMHbfbOZ2VLzvAH+EstKi0C6fTclTE4tD+h/bBizYd4pjxQU21u44fCuYU aVP17GCvYfMsNiz25StvdXHrrR8n0oOAJTQ8VPC68c9C9zDzdeIUzTsQvUsaDY1lFmyq 7LLInL2ZHOJ7MhGvAAv29OtiiA+FmjLqOzukWofKXyci3/C2JnIEeunaS5Ech6vSpMnr uGaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749327575; x=1749932375; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=c2LwqptFTMBLVEe+Jaa58kLLDLdto2SH/hE0L4GQVKo=; b=gQRjZOk8xPqPK0Ddd/wAHH4rU3VT+IMd8EmWt5ufsbfd0laX90+YAUEMb8FLQWEpjM Hsh34t9VDpbf8uvHU6tK/guVLJvnd90ddc4vKQlAseOSKDuZTVau07Ux99rtAlnHpo8S bMiTBF/zcgLaEhh8QY9zGK0bddCY/9R7OILDGqIRquBhd9N8eZdm42n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f8f.40.1749327575256; Sat, 07 Jun 2025 13:19:35 -0700 (PDT) Received: from ?IPV6:2001:871:22a:3372::1ad1? ([2001:871:22a:3372::1ad1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a532435771sm5568784f8f.63.2025.06.07.13.19.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Jun 2025 13:19:34 -0700 (PDT) Message-ID: <489c795a-ad6e-47b9-9443-aa315d59a74c@gmail.com> Date: Sat, 7 Jun 2025 22:19:34 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] rust: add `assert_sync` function To: Miguel Ojeda Cc: Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org References: <20250607-assert_sync-v1-1-b18261da83e2@gmail.com> Content-Language: en-US, de-DE From: Christian Schrefl In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 07.06.25 7:29 PM, Miguel Ojeda wrote: > On Sat, Jun 7, 2025 at 3:02 PM Christian Schrefl > wrote: >> >> +/// Asserts that the given type is [`Sync`]. This check is done at compile time and does nothing >> +/// at runtime. > > I would split the second sentence into its own paragraph, so that the > "short description" isn't long. Alright. > >> +/// Note that this is only intended to avoid regressions and for sanity checks. > > Hmm... I am not sure about this sentence. A macro may want to call > this to ensure something that is required for safety, for instance. Is > that the "sanity check" part? In any case, it sounds like the sentence > could be read as "this is not reliable for "other" things apart from > just sanity checks", which may be confusing. > > Could we perhaps clarify? I added this because for some reason I was convinced that it would be possible to cause post-monomorphization errors with this, but I not realize that's not a thing. I guess I'll just drop this sentence. >> +/// # Examples >> +/// ``` > > Please add a newline between these.> >> +/// >> +/// > > These newlines should be removed, otherwise they will be rendered. > >> +/// // Do the assertion in a const block to make sure it won't be executed at runtime. >> +/// const _:() = { >> +/// assert_sync::(); // Succeeds because `i32` is Sync > > `Sync` and please use a period at the end. Also, I would suggest > following our usual style and putting it at the top, i.e. > > // Succeeds because `i32` is `Sync`. > assert_sync::(); > >> +/// >> +/// ``` > > This one can be removed too. Fixed these Cheers Christian