Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp553887rdb; Thu, 19 Oct 2023 11:50:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJRLfP1o5mdJkJ5GVZUM6FBAPnxY5Kmzj8rJOa47EPBJmvbrJQqny1RDD96Y9dAf0+wGBW X-Received: by 2002:a17:90a:ce12:b0:273:cb91:c74f with SMTP id f18-20020a17090ace1200b00273cb91c74fmr3100491pju.8.1697741440421; Thu, 19 Oct 2023 11:50:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697741440; cv=pass; d=google.com; s=arc-20160816; b=sqIB4pv7ED9CszVicIIyYUxIwedBc51U0Gc0cGQus7587K/B3g8I7850N4CrK7F/XG +l2GEKla0Pb3DNn7pGBJq51NMQWct6mR2I7F4l1XhBj4m7AcYjvqSDzCTY6tR4yMpCvx jD9Kvj2A6jmilwUxmDiH5ZDob5Wli4pOk+QF4vAhBPSf6purM+R3NonDlzTy8COHb+tW zOgwkJJLCcqKiCPF9c+pUeEsz70o2QBtm5SwILSeBDWV4FZRtj86/j5MSKsgaqMoA2QG zlgP23UZDWXstHUuyUJmT5VCG8xtQnkCXroJgC9/RnRz+ND0/IgdVVgWQBm0ae6oBk2y R4/Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature:ironport-hdrordr:ironport-data:ironport-phdr :dkim-signature; bh=Z0RBuQO7tUtphn4pCKsUQ8do2EDtloDyT3gNv5aAJyg=; fh=tRuWXxaqdL+975HJCPoQveit0ECr/4FcsCydyH6uYvw=; b=EPBW/7y4ak2GcM/2ALBY7N4aK8zQu+HM1JIssUuTZ+sY86qn0g/13/1Xd09iFk2cZ+ hoxQhzN1HOfnsVGU8M6WOki3M74+Olyudvk5MftSTWoTwKawNUIXB5aAPB8WzuEX9bkG hcA3j4uZupoiVYUzFFqrWm2zSHo7CY0j3pHlr4boPU+8pp8iNDxcYwuIsoze5W/kAToI 7pkHc1efERzGYVYyROspDFLgo34CwcC1Tft7C9Ij1yPUlBnVOF8bcYUalNGgSlIZR4af ZbUdToAJdoEhOAD0j4TI4c/awlkz74WVSqHZOdVjREAZ0M0W+hbYXShZ7VP8tWVvckwd T7YQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=m2wJ+3MK; dkim=pass header.i=@cisco.com header.s=selector1 header.b=csM6umGn; arc=pass (i=1 spf=pass spfdomain=cisco.com dkim=pass dkdomain=cisco.com dmarc=pass fromdomain=cisco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=cisco.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id f10-20020a17090ace0a00b0027d12ed9e08si2689920pju.106.2023.10.19.11.50.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 11:50:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=m2wJ+3MK; dkim=pass header.i=@cisco.com header.s=selector1 header.b=csM6umGn; arc=pass (i=1 spf=pass spfdomain=cisco.com dkim=pass dkdomain=cisco.com dmarc=pass fromdomain=cisco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=cisco.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A41F0834825D; Thu, 19 Oct 2023 11:50:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345261AbjJSSu0 (ORCPT + 99 others); Thu, 19 Oct 2023 14:50:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233271AbjJSSuY (ORCPT ); Thu, 19 Oct 2023 14:50:24 -0400 X-Greylist: delayed 62 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 19 Oct 2023 11:50:22 PDT Received: from rcdn-iport-3.cisco.com (rcdn-iport-3.cisco.com [173.37.86.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49D3012D; Thu, 19 Oct 2023 11:50:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4521; q=dns/txt; s=iport; t=1697741422; x=1698951022; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=D/+/E60lqZfmaMHsilGLJXhgkmxQybBsA0YLBdnKWWA=; b=m2wJ+3MKPpr0hr9Q9F5PZPgUlhnXN2lso9f9Txmi1qKLJleuMXDE+Bve nhEQrsGRdS0JJlpA9RlbOyf7UdgZXUXfC2oDPi7ef/C8h7eKyJHQhJ5e8 aUs0ZEU4YEKZTtaSb9n5QIXEgJIUFsAgaC82BbN2oq1/e2CV6d9XQLEY1 I=; X-CSE-ConnectionGUID: CeXPj8MqQbabxxBg1Io/mw== X-CSE-MsgGUID: nEGa3RdgT2aS0E/BfGGIcw== X-IPAS-Result: =?us-ascii?q?A0DNAgDKeTFlmIgNJK1agQklgSqBZ1J4AlkqEkiIHgOFL?= =?us-ascii?q?YZAgiMDkleLJBSBEQNWDwEBAQ0BATETBAEBhQYChxUCJ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-Filtered: true Received: from alln-core-3.cisco.com ([173.36.13.136]) by rcdn-iport-3.cisco.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2023 18:49:18 +0000 Received: from alln-opgw-1.cisco.com (alln-opgw-1.cisco.com [173.37.147.229]) by alln-core-3.cisco.com (8.15.2/8.15.2) with ESMTPS id 39JInIAY025524 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Oct 2023 18:49:18 GMT X-CSE-ConnectionGUID: x+ljMh41Rpa49QSU+GIOSw== X-CSE-MsgGUID: A1l6kFD+SfO43jjnrCuyhQ== Authentication-Results: alln-opgw-1.cisco.com; dkim=pass (signature verified) header.i=@cisco.com; spf=Pass smtp.mailfrom=amiculas@cisco.com; dmarc=pass (p=quarantine dis=none) d=cisco.com X-IronPort-AV: E=Sophos;i="6.03,238,1694736000"; d="scan'208";a="5382320" Received: from mail-bn8nam12lp2169.outbound.protection.outlook.com (HELO NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.169]) by alln-opgw-1.cisco.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2023 18:49:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EjppLPqKvxboQGIjsTOQRF+wjYAjm4BZouDL+AvmGVzgRAQVyvyFjNCDawPAXwY2FToloYp/CPhkBpOYLoKeHOYQEWIXdfWAbsKDK/kNwUCAYBhuY23dJuyes2y05c3gUh3O4J+EjgDBTX1VRBf1b6CHBmREH0fihg5NVESxp3xint3p+LvpweDgRuKII8LLgAjRGpZ9viFk+CAJpHnCSxsor8eAVMy/06qLDTtIGw4/q5fgX9X/KhUf8W2wqbtEXUE6yzc75pS2p/eV/WlH833W/8SeEVIBOZDHfddxnEp1ziXKL/9xsfGS3Fyj7Ig89e7hJ6HoLiSerHseFYokuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Z0RBuQO7tUtphn4pCKsUQ8do2EDtloDyT3gNv5aAJyg=; b=EAw3Gusn5YFPhY3k93P0lyBo2r9tR3xrccOlXVD3ke1Sl07jtss6tJn1Bx7B2dmtNrCDbCjwgyAQ1at39rhYZClrzhWUSmJ65qwfAISHUbqMXc+nHZmleo5kPbQ5tjfyU4yWOg8YkLxhnp0neBRFF5eBDXVF4VLA4XrTh3U9y++ays4ykanuOK0gvTSwaW159AXx5/XcyAwbKdnI2BlXD9tDOJwCnMT7YCOX3njLL4P/SOD2xY3aJLVGCQCh/MqioRyQNS7hAdeI2qjZ37+wbQiGav1xNw8Ulbj5nC9cPldoVukCb/K0YJoH/Jj61oPy/TYzdalU2Ao1zgH1HLhAxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cisco.com; dmarc=pass action=none header.from=cisco.com; dkim=pass header.d=cisco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z0RBuQO7tUtphn4pCKsUQ8do2EDtloDyT3gNv5aAJyg=; b=csM6umGnX+BaPj+YQZZWzXhNeVVEvB+A32jTcBR2kTE6hhsPofpfSOSK18OxM6lxkcP8E2hsREzLJN8r8Tnp3H9v0nSjSd0mtl/2ibK2DouO6Z7I5k+EKPPGKNr3GBfFzDVjVC13+Zy9F1PqmqvbCuRRstCL+ADzCDmJWzJtqdk= Received: from CH0PR11MB5299.namprd11.prod.outlook.com (2603:10b6:610:be::21) by SJ0PR11MB4912.namprd11.prod.outlook.com (2603:10b6:a03:2ae::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.25; Thu, 19 Oct 2023 18:49:14 +0000 Received: from CH0PR11MB5299.namprd11.prod.outlook.com ([fe80::6c6c:63b0:2c91:a8d9]) by CH0PR11MB5299.namprd11.prod.outlook.com ([fe80::6c6c:63b0:2c91:a8d9%7]) with mapi id 15.20.6907.021; Thu, 19 Oct 2023 18:49:14 +0000 From: "Ariel Miculas (amiculas)" To: Benno Lossin CC: Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn_Roy_Baron?= , Alice Ryhl , Andreas Hindborg , "rust-for-linux@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] rust: macros: improve `#[vtable]` documentation Thread-Topic: [PATCH v2] rust: macros: improve `#[vtable]` documentation Thread-Index: AQHaArz0jXJRfEzbbUaGYI2Vxgswdw== Date: Thu, 19 Oct 2023 18:49:14 +0000 Message-ID: <2tucqxnvhh3db4mc73fyahc7w2xxawaupzgxzvmhxavkbeffzn@sj4dhsipcs5a> References: <20231019171540.259173-1-benno.lossin@proton.me> In-Reply-To: <20231019171540.259173-1-benno.lossin@proton.me> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH0PR11MB5299:EE_|SJ0PR11MB4912:EE_ x-ms-office365-filtering-correlation-id: de70ca6c-5ba3-47be-1b9e-08dbd0d4175f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XYn5+fusbyddk1IBQ+Fj2XvPEWQnVI1ttPcEjbCFBHP6Y8ll31BkUOERhkP0lip9CggUS+Uy8Fsw9q9VBHzUQ5DJYy9IfiATMakJyxTBIppcpqnfC6CTVAyRkJjjGlSh24YAQ6xRL51U6BTGfSHVIB5WBBbS7ys4yJV1rYqMuGeQdCZrYWmZyqGLvvfZq//UsWA3xYtcOQoFThem6Gnx6gyZBgetiRB1VL/GI+eRr2Z4H28kPP48ISRTdvN9DXrHqwavOB8dWzIlC392mb/QxsHamLkANsI2NZDj4fIQFDut/2JViHAfO725KsDW5xe9lSxfz210KKV4EHsKsdLpu+6qle/NqN9uNhYJRUEOULw2Mj3alm9ndQmDvPHD04KNJz3La1sfqB7abZz3ZRBN34QN/Tx4F9Oz+XGkGCvrS9RiYWSqSGnM7Z4s8DpoAZHuJZAzMUR4zxkR8O7gtuh0Pe7byMAWU2CvFqQmzY2s9phY0rYsy0O8C8JF73Frxv0+NUFP0GmFvfrprVwEl9c8K4A/qOisbIOykdn4whotfLifYgo6+ZcjAMAgZLLGM6fbHMZZiRzynhGs5RbltwUetICP4N0QLY9VunFMKj/gZC/WCi+QiMHElcgVjSVjTBRX x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR11MB5299.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7916004)(136003)(346002)(366004)(396003)(376002)(39860400002)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(38070700009)(2906002)(76116006)(66946007)(91956017)(66476007)(6916009)(54906003)(66556008)(66446008)(64756008)(316002)(5660300002)(71200400001)(8936002)(478600001)(6486002)(86362001)(41300700001)(8676002)(4326008)(7416002)(6506007)(38100700002)(9686003)(6512007)(83380400001)(26005)(122000001)(33716001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?DF90zfXi2UGhEG61nToo+JcmoTTK+UK5ajJ0SChE7xQQQaSrJETJaNKVwa?= =?iso-8859-1?Q?9L/zAZOAojbamnfFJYTvhC7ZMtMmZ+YoOOpoJueCln5lXEWBlxkmwjdOzj?= =?iso-8859-1?Q?bv2BEN18WcnrKhuf/ZZkH24yD25YiwsM1WWyGg+fJXWBOO2P1KxR6qgFwT?= =?iso-8859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Ga77c?= =?iso-8859-1?Q?wWEEqpVyvB9P73Fo3dJcOB0tyQJnQNWvBtslemFMJgqKsDTyIB833rSXSs?= =?iso-8859-1?Q?VIgC/rv3Cs9/811O92BQ/9O+zdFsHO0I22/nFPVD8I8LIxNf4YAnxQ8zO0?= =?iso-8859-1?Q?ngUchDpgtYYBqm+rXgEVt0l+Ci+pxF00BX6s3gQtuVTY2XP4FdaJ6vNI2k?= =?iso-8859-1?Q?jwO1U+YWfLfUfDrW4SlN50kEWvcSnw7cjPA25Xb1aCx/2e//vbjMR7iQus?= =?iso-8859-1?Q?r8/av6VzNNPG0UCBLf/Dyq65Y9ffF9gaJ+AkwOgDbBiRD+s33wg0zGwa0d?= =?iso-8859-1?Q?sXGZlZFGbN/udQhDVdxa5p2yhzn8joPbXs5hoMxxTwEMcQ56JIip8qrdKH?= =?iso-8859-1?Q?Rept0EDmmL5G/WOrZlvEpx5ZL6q9538LoUA+gxmPMGDUAydym6suOvi/BL?= =?iso-8859-1?Q?QcLcromuJKajv0/6mqdaaPfd44AURfvZdIbqB3pMjEIrXoF9UHsw80YQW3?= =?iso-8859-1?Q?MsaTSrMenoIktj5NDPSeQ4uODpRXITGv9n1ypVbHjtP0gzxeOjsYg7xUJx?= =?iso-8859-1?Q?i6sLkmI/mDIpO3QF9BInuTi7yHAjV/6PAX?= Content-Type: text/plain; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: cisco.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH0PR11MB5299.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: de70ca6c-5ba3-47be-1b9e-08dbd0d4175f X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Oct 2023 18:49:14.6280 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5ae1af62-9505-4097-a69a-c1553ef7840e X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: EMeZuv0vA5gA6W0agBaTWKSIQUvgPQ3RQqg0qzBdobtQLoE6mdz5DkX3OaVFJlC+KHTBjyiG2LxlAh7avpEP/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4912 X-Outbound-SMTP-Client: 173.37.147.229, alln-opgw-1.cisco.com X-Outbound-Node: alln-core-3.cisco.com X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 19 Oct 2023 11:50:37 -0700 (PDT) On 23/10/19 05:15PM, Benno Lossin wrote: > Traits marked with `#[vtable]` need to provide default implementations > for optional functions. The C side represents these with `NULL` in the > vtable, so the default functions are never actually called. We do not > want to replicate the default behavior from C in Rust, because that is > not maintainable. Therefore we should use `build_error` in those default > implementations. The error message for that is provided at > `kernel::error::VTABLE_DEFAULT_ERROR`. >=20 > Signed-off-by: Benno Lossin > --- > v1 -> v2: > - removed imperative mode in the paragraph describing optional > functions. >=20 > rust/kernel/error.rs | 4 ++++ > rust/macros/lib.rs | 32 ++++++++++++++++++++++++-------- > 2 files changed, 28 insertions(+), 8 deletions(-) >=20 > diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs > index 05fcab6abfe6..1373cde025ef 100644 > --- a/rust/kernel/error.rs > +++ b/rust/kernel/error.rs > @@ -335,3 +335,7 @@ pub(crate) fn from_result(f: F) -> T > Err(e) =3D> T::from(e.to_errno() as i16), > } > } > + > +/// Error message for calling a default function of a [`#[vtable]`](macr= os::vtable) trait. > +pub const VTABLE_DEFAULT_ERROR: &str =3D > + "This function must not be called, see the #[vtable] documentation."= ; > diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs > index c42105c2ff96..daf1ef8baa62 100644 > --- a/rust/macros/lib.rs > +++ b/rust/macros/lib.rs > @@ -87,27 +87,41 @@ pub fn module(ts: TokenStream) -> TokenStream { > /// implementation could just return `Error::EINVAL`); Linux typically u= se C > /// `NULL` pointers to represent these functions. > /// > -/// This attribute is intended to close the gap. Traits can be declared = and > -/// implemented with the `#[vtable]` attribute, and a `HAS_*` associated= constant > -/// will be generated for each method in the trait, indicating if the im= plementor > -/// has overridden a method. > +/// This attribute closes that gap. A trait can be annotated with the `#= [vtable]` attribute. > +/// Implementers of the trait will then also have to annotate the trait = with `#[vtable]`. This > +/// attribute generates a `HAS_*` associated constant bool for each meth= od in the trait that is set > +/// to true if the implementer has overridden the associated method. > +/// > +/// For a function to be optional, it must have a default implementation= . But this default > +/// implementation will never be executed, since these functions are exc= lusively called from > +/// callbacks from the C side. This is because the vtable will have a `N= ULL` entry and the C side > +/// will execute the default behavior. Since it is not maintainable to r= eplicate the default > +/// behavior in Rust, the default implementation should be: > +/// > +/// ```compile_fail > +/// # use kernel::error::VTABLE_DEFAULT_ERROR; > +/// kernel::build_error(VTABLE_DEFAULT_ERROR) > +/// ``` > +/// > +/// note that you might need to import [`kernel::error::VTABLE_DEFAULT_E= RROR`]. > /// > -/// This attribute is not needed if all methods are required. > +/// This macro should not be used when all function are required. Typo: should be `all functions` > /// > /// # Examples > /// > /// ```ignore > +/// # use kernel::error::VTABLE_DEFAULT_ERROR; > /// use kernel::prelude::*; > /// > /// // Declares a `#[vtable]` trait > /// #[vtable] > -/// pub trait Operations: Send + Sync + Sized { > +/// pub trait Operations { > /// fn foo(&self) -> Result<()> { > -/// Err(EINVAL) > +/// kernel::build_error(VTABLE_DEFAULT_ERROR) > /// } > /// > /// fn bar(&self) -> Result<()> { > -/// Err(EINVAL) > +/// kernel::build_error(VTABLE_DEFAULT_ERROR) > /// } > /// } > /// > @@ -125,6 +139,8 @@ pub fn module(ts: TokenStream) -> TokenStream { > /// assert_eq!(::HAS_FOO, true); > /// assert_eq!(::HAS_BAR, false); > /// ``` > +/// > +/// [`kernel::error::VTABLE_DEFAULT_ERROR`]: ../kernel/error/constant.VT= ABLE_DEFAULT_ERROR.html > #[proc_macro_attribute] > pub fn vtable(attr: TokenStream, ts: TokenStream) -> TokenStream { > vtable::vtable(attr, ts) >=20 > base-commit: a7135d10754760f0c038497b44c2c2f2b0fb5651 > --=20 > 2.41.0 >=20 >=20 With the above typo fixed, Reviewed-by: Ariel Miculas =