From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f171.google.com (mail-il1-f171.google.com [209.85.166.171]) (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 E1526173 for ; Tue, 20 Jul 2021 01:46:24 +0000 (UTC) Received: by mail-il1-f171.google.com with SMTP id a11so17827543ilf.2 for ; Mon, 19 Jul 2021 18:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aShbJsP41HxAyEddhHJguTwWDxZVrQjiAg7FxnWOq6c=; b=nNCx8a4KoLD560k39NojPxGeOsqQkaCwu+0CDyf75DC5zrRtuYhRfD40E0VLDXLL7D OiH1GrHtgUsGTg/LdJ4gDtCg6o3kHF35wsNwCHD0a0Hrc59SaHYCRRKHrBJsZqXQ1Mrn z9MyP0JBkwSWk+sU3UQIkZn0aHOZ7lO39MXDDZDhneGq7lz+9ICE5vBmg439HdUbWljk jmNhnuQfUbPy6ZOz5fR4F/n+fiYY5p1kAmlXzzcrmuiqgf7SiilEWOczjlCfkNx6dcvf gII/YsOFv8GhhPIGzNQ9IMcDAkTvlK8tSHUNCKA6FlemwLsGOxr2dcO6vRdedQnMX8Tm pG8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aShbJsP41HxAyEddhHJguTwWDxZVrQjiAg7FxnWOq6c=; b=tEqY9uX2PXAEtUGXTKX79mpR/mzRArS8WvJ6OTe1xYfZ67cEJW4LhzKEdCPjPchOOZ IlZpWvB0dNGp4PF1UdEAH8ZF5589szp49kB7RTgujeF+HbZzFkcCKlNrML9AxhP0A0x9 RcTjIpoETHAB+HRCoI9GTVi2PFLa+ou7yyIswwxANxixgbJcniU2R00oAwwnEuLdF10g EkfjlXHEvMP6Ps92AFCSXDh7jndK/Yqn9TcMPD7WOMQhpq8Ikgswh8XC2Vy4+GEa0nLS EOTmLNwXqgzqAhZUCGZFDvjI7nsdgbDr7oyjLvJ9zvsGMCSeALLLjEwKKxrvz7uMQtz1 vi0A== X-Gm-Message-State: AOAM533xjB3qahbMAWrKGkR2bNqvhifEFIVedkK1hw8cKmxdEp81NFuj V7B6EX5qCOwGW4WJQ/sYa7ZWy0zHkdSPP7+iUtA= X-Google-Smtp-Source: ABdhPJxWwdcXuRomqjj48aoo2o5qbZCNaTSf8pEgHLuI8v81aXL4TVczZENgHwv1dkmSxXxsE9DMW3KL4CTbKsMZT8g= X-Received: by 2002:a05:6e02:dc4:: with SMTP id l4mr19823208ilj.94.1626745584118; Mon, 19 Jul 2021 18:46:24 -0700 (PDT) Precedence: bulk X-Mailing-List: ksummit@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20210707203827.GI18396@quack2.suse.cz> In-Reply-To: From: Miguel Ojeda Date: Tue, 20 Jul 2021 03:46:12 +0200 Message-ID: Subject: Re: [TECH TOPIC] Rust for Linux To: Arnd Bergmann Cc: Linus Walleij , Wedson Almeida Filho , Greg KH , Bartosz Golaszewski , Kees Cook , Jan Kara , James Bottomley , Julia Lawall , Laurent Pinchart , Roland Dreier , ksummit@lists.linux.dev, Viresh Kumar Content-Type: text/plain; charset="UTF-8" On Mon, Jul 19, 2021 at 11:33 PM Arnd Bergmann wrote: > > I'm worried that this makes things harder to grep for, and to document, > when the same structure is used in both Rust and C. For the former, by grepping you should find the Rust abstractions that use the C structures, because binding generation does not change the names or their case. Of course, the Rust abstractions on top of that is a different matter, but those do not exist in C anyway. So, at least for the use case of searching Rust abstractions that use a given C structure or API, it should be fine. For the latter, we started linking the C code and/or docs from the Rust ones. We do it manually now, but ideally we should be able to reference C docs (and/or code) just by writing the C name, something like: /// Similar to a C [`spinlock_t`]. This is a feature that already works for Rust definitions and we use it all the time, but not for C ones (obviously). My current plan is to have `rustdoc` support a "external references map" that is added to the internal map of Rust "intra-doc" links that it already has. With that, we could have Sphinx generate the map of references pointing to its own docs. Cheers, Miguel