From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E127C1F150D; Tue, 4 Mar 2025 11:35:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741088119; cv=none; b=FdxHaKJ6eT+dbGs+XkiDRsxgw5esp+4f4oyTDViExjNm2qN9DUFxIvX8DrSb7fKXUM8ymEjO1a5uy/ytDrxguKCX9dc4glhnBW3ISUcpsJf9IQMkkLsw7UPSaViI68oHfePusevicz6J9fBxiPfGT6w9Phq5OWgMPY8QKTbw7w0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741088119; c=relaxed/simple; bh=vGfyis5EROFVhdnxNgDSSiE3wb7Om/RbM1OEYQfxME4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=mp2qb+8KQ7A7q3wO1wsonHp+ul6Pm/kiA4iWqK4ByrjUVrxm8zrKEMOnFrx9Y4dKPuNjnJ4lnZyvb4uPpp11RdsexuZXT1pKdfHBrr7JKYohvC6kK25nxnZGBsYFk/3zioRN7613OBg8HwQkLoOB/UMhPJegCaifB7z0AEF6ak8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lFitHzB+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lFitHzB+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C8B6C4CEE5; Tue, 4 Mar 2025 11:35:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741088117; bh=vGfyis5EROFVhdnxNgDSSiE3wb7Om/RbM1OEYQfxME4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=lFitHzB+5G6YoiPah3cPXXZqz2nSvj+Y6VRiUXd9QJBdeXYCw719x3ExH1CjiIh/E 1aho2dVoxyXHjl7z9JcpeMIJLQYcM28rLmxHVTObvyPQs8qiOZgA9otDJNnC7o2FcX 705keiZSDYjiEOnP6Qk5ZcmEmwN30gmhDEadI2JdTKwKEL3CdB9ua1xkJ9wqNgjHw2 +iRtQIo86ZZvenJVyvFIPH6dxxJHZ5yhtcVwnzqtWcNjs6GQEm5HVb3s+7hj+7jXRp TmIf0Mvgw4oxmQQ7No9BFR+nzIH+NkFeodXEHQlu/cT6C1RaVO6l46diuNw8fVnMqr rRJK7FYBohjaA== From: Andreas Hindborg To: "Tamir Duberstein" Cc: "Danilo Krummrich" , "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?Q?Bj?= =?utf-8?Q?=C3=B6rn?= Roy Baron , "Benno Lossin" , "Alice Ryhl" , "Trevor Gross" , "Matthew Wilcox" , "Bjorn Helgaas" , "Greg Kroah-Hartman" , "Rafael J. Wysocki" , "FUJITA Tomonori" , "Rob Herring (Arm)" , =?utf-8?Q?Ma=C3=ADra?= Canal , "Asahi Lina" , , , , Subject: Re: [PATCH v18 1/3] rust: types: add `ForeignOwnable::PointedTo` In-Reply-To: <20250221-rust-xarray-bindings-v18-1-cbabe5ddfc32@gmail.com> (Tamir Duberstein's message of "Fri, 21 Feb 2025 15:27:40 -0500") References: <20250221-rust-xarray-bindings-v18-0-cbabe5ddfc32@gmail.com> <20250221-rust-xarray-bindings-v18-1-cbabe5ddfc32@gmail.com> User-Agent: mu4e 1.12.7; emacs 29.4 Date: Tue, 04 Mar 2025 12:35:01 +0100 Message-ID: <87bjuhhvve.fsf@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain "Tamir Duberstein" writes: > Allow implementors to specify the foreign pointer type; this exposes > information about the pointed-to type such as its alignment. > > This requires the trait to be `unsafe` since it is now possible for > implementors to break soundness by returning a misaligned pointer. > > Encoding the pointer type in the trait (and avoiding pointer casts) > allows the compiler to check that implementors return the correct > pointer type. This is preferable to directly encoding the alignment in > the trait using a constant as the compiler would be unable to check it. > > Acked-by: Danilo Krummrich > Signed-off-by: Tamir Duberstein Reviewed-by: Andreas Hindborg Best regards, Andreas Hindborg