Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp632677pxv; Wed, 14 Jul 2021 11:39:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyMdOZqH6L832XCozf+AyEdhsAe+wH5g8becmiYJcRVIKBHllCsaFvJc+WZwJcfeBgzIYN X-Received: by 2002:aa7:d48f:: with SMTP id b15mr15895594edr.271.1626287995977; Wed, 14 Jul 2021 11:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626287995; cv=none; d=google.com; s=arc-20160816; b=xsPNqo683mDesD6hkkUZqEgC2iywijDhSc5Iqnb6hqdhg8k0Q+E10t5VMbhVMOFhwj gfrlXp4vatCaWXDI02eqJxWVBwf3g0PQMrcpeSmOJ+0y8D2AuNWbtPkYezKCbvJBmHw4 TA6w1Jo1/vnW376mPocodBI+ORT3T7gRtN+xWlZgEM8ZojNNwuY0XWTgJXK2K3KZsPiV 5Q4AEWsGkWwN4pedqJ+LH8QTNSms8o9Do6OXbeGTeWWF0dYT199pV+AVfGB1RLtD/30M oPpw41weaTBxaN9XMsLiis1TB+ONpaysaI7vDwsWjJJfS/Wy508WMgcttEW2iZZDP7N8 NDCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UdE1i3Kh9CyaztlMs6Tom/6/6Qs2gen6RQY/2APYkeY=; b=kkZtNairP6Tt4RyExyJEQJNtyFsFOqVuud2cZ1YSp9uNT1VgywHIxr596VZ0oRL99G 5QeSG3YBduZIN/Wz8Y+D3FZFVtWUAc49vyuiD+Waf0O8g6rEWB23TlTiyCQvLSKzJ7sv chIbLQSNFH8y8UIYCo++C66FNqTjYA/H+hFBW500fz8RYLBj23LruR0HPpS9jiA8Xt5t mz/yjGOkTYiaP5gW5MeqoOYtqbAxUIFPAbSe0Fwc8mSga/jgz274HG9uN+KgDa/K6YpC 8Kqqk/s0J8WhLK6Rug/pVYY7MYxHWTiMVexIBo57EUsS8oxFeI8X/Pc7HTzmDgTppCBB 7Quw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AXUtjv8M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 11si3204817ejv.229.2021.07.14.11.39.32; Wed, 14 Jul 2021 11:39:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AXUtjv8M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239819AbhGNSlA (ORCPT + 99 others); Wed, 14 Jul 2021 14:41:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229861AbhGNSlA (ORCPT ); Wed, 14 Jul 2021 14:41:00 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55B63C061760 for ; Wed, 14 Jul 2021 11:38:08 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id u25so4827575ljj.11 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=tdwIaHd5UHs7+ldNr+X1jkluJrGAPK30KId+IOoi2E3A3+7zml3jnjt+78/Fi6mHCo n7jm1/UnMnMfRtKaNsW4zwNYgHtmS7xemaMfNpMabuAMFHFUlUvd2hpZDhZ+E3xSANUE SbC9XHtV3B+FTuAriU8jGCRC44YhVu61hYHzO/u8KE/WSSauGvvuQbSFWjbDQxvJAqTW 2pU2SODUjB8QaMqZlULIvWtRSMNlBrf7Fsl/hJBRsBbNRTCd3PUB8jqhUx/9UyL1R0GR XUnzrDxmy8bR0CL36Jmyqhy4BqGI7BFuB3NHmaiqI7GlLAPiNFojH2N08J+2Bo9rZf+t XJtA== X-Gm-Message-State: AOAM530dpgkHzV4vfLPpLjSR7R1g6bTRfAfuOk4YGhbAMe7fSBVbBDdX Xk8IoFzid3veCaz08TGSuC7dgC8IKR6eaLSNoKHDnw== 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: linux-kernel@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