From patchwork Tue Jul 18 05:27:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miguel Ojeda X-Patchwork-Id: 13316732 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C5C8EB64DA for ; Tue, 18 Jul 2023 05:28:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230351AbjGRF2k (ORCPT ); Tue, 18 Jul 2023 01:28:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230306AbjGRF2f (ORCPT ); Tue, 18 Jul 2023 01:28:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B76810EB; Mon, 17 Jul 2023 22:28:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B317D612E6; Tue, 18 Jul 2023 05:28:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37C5AC433C7; Tue, 18 Jul 2023 05:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689658111; bh=+k0YeMe4IQGy7ZoqQp5D1RAO3qnqR7osUcj8pqI8Br4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tV+phARwLbThccff0pXskdDqdJjjBy0Bk0U6M49OpFLWrcbBJ/qJRxaDwyHomJLi0 k10sqhmbFO7nj9PN8a50+zgAEa07sD3yeRt5xn2/XCQXqQ7KQ0iO/AadWvmVkDyREF c9B5aHaajJSUiVNp0K3VVGuNdCzB7tw1YEa8JkReBvf4XRLwkkM1InFKlTC+R5WNZN FO5e02eE4CAQcPt+24ruW8ij39NR3ZKQFjz0LoiO81GwapqGpbpshWpS/brXUlUuls BQsfwEbqbsifsJgxNYt7gkwqbcyi3C3YyhQfou10lzRQj1rXF1g1nbfLg/A3tGohDA rTxkssQz1tOVQ== From: Miguel Ojeda To: David Gow , Brendan Higgins , Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor Cc: Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Alice Ryhl , Andreas Hindborg , kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Martin Rodriguez Reboredo , Vincenzo Palazzo Subject: [PATCH v2 3/7] rust: str: make doctests compilable/testable Date: Tue, 18 Jul 2023 07:27:48 +0200 Message-ID: <20230718052752.1045248-4-ojeda@kernel.org> In-Reply-To: <20230718052752.1045248-1-ojeda@kernel.org> References: <20230718052752.1045248-1-ojeda@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Rust documentation tests are going to be build/run-tested with the KUnit integration added in a future patch, thus update them to make them compilable/testable so that we may start enforcing it. Reviewed-by: Björn Roy Baron Reviewed-by: Alice Ryhl Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Vincenzo Palazzo Reviewed-by: David Gow Signed-off-by: Miguel Ojeda --- rust/kernel/str.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs index c9dd3bf59e34..c41607b2e4fe 100644 --- a/rust/kernel/str.rs +++ b/rust/kernel/str.rs @@ -213,6 +213,7 @@ impl fmt::Display for CStr { /// /// ``` /// # use kernel::c_str; + /// # use kernel::fmt; /// # use kernel::str::CStr; /// # use kernel::str::CString; /// let penguin = c_str!("