From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.w14.tutanota.de (mail.w14.tutanota.de [185.205.69.214]) (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 5E561224B0F; Thu, 5 Dec 2024 19:22:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.205.69.214 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733426570; cv=none; b=RYps202q+hbH+kB397+48v/jk62VI81dCQyiKUui2dpUdD5BLbNVU83dHShKU62BITx/bfSQXNEb6jZWd5erEIVgsEBsv27KwGQf1EGKRG5eUlk5JPb6GjfZOxF89gLpOKsWP4T7N0tSVV1Cpd22VBCNsOZHXUo49hQ3URh6Ah4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733426570; c=relaxed/simple; bh=Ta9ywsfJdQ6Vo9GcVw9UdsJhBf8GeU+PxCzAYoUhaiw=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type; b=B5afochU0/mXPscEMpp4ziT4IROa+oxWVIIhRWK6E1UftGGqRGPbt38kD+oGyEWcNt3XosRT56yI0cI/T0DnM6ll+RnwxR0a73xvNXe/eBwgh9y6w5Vt1rHdojA/IbUQsediOo3jc7KfMj7cHNck4qk7eSf7WW0ivgTR6W1hLEY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tuta.io; spf=pass smtp.mailfrom=tuta.io; dkim=pass (2048-bit key) header.d=tuta.io header.i=@tuta.io header.b=OHLw6czj; arc=none smtp.client-ip=185.205.69.214 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tuta.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuta.io Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuta.io header.i=@tuta.io header.b="OHLw6czj" Received: from tutadb.w10.tutanota.de (w10.api.tuta.com [IPv6:fd:ac::d:10]) by mail.w14.tutanota.de (Postfix) with ESMTP id 85753434B591; Thu, 5 Dec 2024 20:22:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1733426566; s=s1; d=tuta.io; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=Ta9ywsfJdQ6Vo9GcVw9UdsJhBf8GeU+PxCzAYoUhaiw=; b=OHLw6czj0xmx5L9NlIGK42fFoyoKF1TfdRuocBO6cv8+WfqO21MfRpqzW5gFpjgu r4VBJPAiqYV4kLvQTllsUjqZUwb92GWvYJ3yvbssABhdbTG36yC2xUn49KBfgLjfmoN orU/ix3Hy9YHsaY4FmjpipjqKvkF0aJHStk0uXQwVMfAeYPMD28ZRkP99m5sUz1Fqze /c8E6QQRpNDRSg0o96BpfSoig78A9/vlav4Azt+LNJVcg612cJpY6nkD+UQqTFpu7uv OFxZtiyC1DVnRWkShmdXkC+EVQLUwgPfh9F5EXpfUyH2gPwogy7ewgnyYWQKoVmqVkU jvSt1QuNmA== Date: Thu, 5 Dec 2024 20:22:46 +0100 (CET) From: jens.korinth@tuta.io 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 , Rust For Linux , FUJITA Tomonori , Dirk Behme , Linux Kernel Message-ID: In-Reply-To: References: <20241126-pr_once_macros-v4-0-410b8ca9643e@tuta.io> <20241126-pr_once_macros-v4-3-410b8ca9643e@tuta.io> Subject: Re: [PATCH v4 3/3] rust: error: Replace pr_warn by pr_warn_once 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: 7bit > Sorry, I am confused. This is not implementing the `From` trait, it is > an inherent implementation. Hmm, you're right. I assume there is a reason why it doesn't implement `From` or `TryFrom`? > If what you mean is that this should not be an infallible operation, > then we are back at my previous reply, i.e. are you suggesting to > remove the method? Could you please clarify, perhaps with an example? Yes, I meant to say it should not be infallible, because, well, it isn't. :) I'd probably make `try_from_errno` public and remove `from_errno`. If there's no other disadvantage I'd remove `try_from_errno` as well and replace it by `TryFrom`. Implementing `From for c_int` may also make sense for the other direction? Jens