From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7F42C07E9A for ; Wed, 14 Jul 2021 18:38:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BCBA060720 for ; Wed, 14 Jul 2021 18:38:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232464AbhGNSlA (ORCPT ); Wed, 14 Jul 2021 14:41:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230080AbhGNSlA (ORCPT ); Wed, 14 Jul 2021 14:41:00 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F407C061762 for ; Wed, 14 Jul 2021 11:38:08 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id q4so4811179ljp.13 for ; Wed, 14 Jul 2021 11:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UdE1i3Kh9CyaztlMs6Tom/6/6Qs2gen6RQY/2APYkeY=; b=AXUtjv8MBQH8lKyt8M63dEIAEyBBfZrNFhon2JDYHbP1g+yLEi5UGwHgeTtHD7JMzD 5/meP3Fz2bjUIG/4XaEtp2OAIWuDOfPQSLD3N1sGNVUh2JuTITrBZZdz75qhCHORTJva TtLgvs1nXcRVcFsizTQ9LbO1cPauI/fXnLalwCGRrDV7BNs427ICRgamdxMMNO/Cq15e g7qq3ze+lwC8sSIHZvHWvcvcmZnpGdlw0t5u0Qj721Gl1aiJpZDjnZYTm38s9bF7kpx0 gbcacwGpEZDQ0tfvCS4UG5t6MWlmfOP8V87XlK64YFbJkovf0LCvSyn9LdUtUgGQOpfj G39g== 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=UdE1i3Kh9CyaztlMs6Tom/6/6Qs2gen6RQY/2APYkeY=; b=fEzFRJFiP6H3EoatfOPknNIJP0sUn52GcuuJKgX+QXEzc1BmKobmSF5yjr+gxTloPO KIbRdDTXZW3G30GO5dma4c4jE902Hh31ZSz6dslTjzpqrwvHmnjwU3mPEh8hrMejkfbD ALE6kP2+eEiFRV9Cxhhne/hRibN+BWxsy9DK9gX0/JiM5fMK2ivALv5sZu4rKX8ASmqV Tz7iFOzmG3eG5J4s3MBmUQCEAp7B+b4hsZlEAaedkYduzv6LhAKMC7+VlC1pguVdK8AH cMGXIsNkVo0gO1ccOKHDTjbyGFRZHV5UKKYZyDFYKNhmKqx2zWIdc4+osHsP94+izU5i gNEw== X-Gm-Message-State: AOAM531VWS8kYMt0yvHhS068UORfTsKAoQHEtLnUQlRhVq44N34mqaQd quY1blRnaCe2NusziADVhdRs6THhUy27n+ghPNC+2Q== X-Google-Smtp-Source: ABdhPJzc+8HrSkvVMTS1cH/YGyicPG4iEYUp9Do12RUNJ4Kv+xTpm0YsDfVyh/mgmhohYw2Rn99Fy6m4zbhW4b0l6yE= X-Received: by 2002:a2e:8247:: with SMTP id j7mr10122299ljh.495.1626287886436; Wed, 14 Jul 2021 11:38:06 -0700 (PDT) MIME-Version: 1.0 References: <20210704202756.29107-1-ojeda@kernel.org> <20210704202756.29107-14-ojeda@kernel.org> In-Reply-To: <20210704202756.29107-14-ojeda@kernel.org> From: Nick Desaulniers Date: Wed, 14 Jul 2021 11:37:54 -0700 Message-ID: Subject: Re: [PATCH 13/17] docs: add Rust documentation To: ojeda@kernel.org Cc: Linus Torvalds , Greg Kroah-Hartman , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Alex Gaynor , Geoffrey Thomas , Finn Behrens , Adam Bratschi-Kaye , Wedson Almeida Filho , Boqun Feng , Sumera Priyadarsini , Michael Ellerman , Sven Van Asbroeck , Gary Guo , Boris-Chengbiao Zhou , Fox Chen , Ayaan Zaidi , Douglas Su , Yuki Okushi Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: rust-for-linux@vger.kernel.org On Sun, Jul 4, 2021 at 1:29 PM wrote: > > From: Miguel Ojeda > > Most of the documentation for Rust is written within the source code > itself, as it is idiomatic for Rust projects. This applies to both > the shared infrastructure at `rust/` as well as any other Rust module > (e.g. drivers) written across the kernel. > > These documents contain general information that does not fit > particularly well in the source code, like the Quick Start guide. > ... snip ... > +rust-analyzer > +************* > + > +The `rust-analyzer `_ language server can > +be used with many editors to enable syntax highlighting, completion, go to > +definition, and other features. > + > +``rust-analyzer`` will need to be > +`configured `_ > +to work with the kernel by adding a ``rust-project.json`` file in the root folder. > +A ``rust-project.json`` can be generated by building the Make target ``rust-analyzer``, > +which will create a ``rust-project.json`` in the root of the output directory. Is rust-analyzer necessary to talk about? I think most kernel developers aren't using LSP clients, so it doesn't seem necessary to talk about for kernel development IMO. If a developer would like to use an LSP client, they should refer to the documentation of their LSP client. Should Documentation/process/changes.rst be updated to note which versions of all of these tools are currently supported? > + - ``armv6`` and compatible only, ``RUST_OPT_LEVEL >= 2`` For the compat table, for 32b ARM, why is v6 supported but not v7? Why only when optimizations are enabled? > +Currently, the Rust compiler (``rustc``) uses LLVM for code generation, > +which limits the supported architectures we can target. In addition, support > +for building the kernel with LLVM/Clang varies (see :ref:`kbuild_llvm`), > +which ``bindgen`` relies on through ``libclang``. Doesn't this also depend on rustc having support for a given target triple? Just because LLVM has a backend for a given architecture doesn't mean rustc can target it, right? -- Thanks, ~Nick Desaulniers