Commit 367b81ef authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull Rust fixes from Miguel Ojeda:
 "Toolchain and infrastructure:

   - Trigger rebuilds of the newly added 'proc-macro2' crate (and its
     dependencies) when the Rust compiler version changes

   - Fix error in '.rsi' targets (macro expanding single targets) under
     'O=' pointing to an external (not subdir) folder

   - Fix off-by-one line number in 'rustdoc' KUnit tests

   - Add '-fdiagnostics-show-context' to GCC flags skipped by 'bindgen'

   - Clean objtool warning by adding one more 'noreturn' function

   - Clean 'libpin_init_internal.{so,dylib}' in 'mrproper'

  'kernel' crate:

   - Fix build error when using expressions in formatting arguments

   - Mark 'num::Bounded::__new()' as unsafe and clean documentation
     accordingly

   - Always inline functions using 'build_assert' with arguments

   - Fix 'rusttest' build error providing the right 'isize_atomic_repr'
     type for the host

  'macros' crate:

   - Fix 'rusttest' build error by ignoring example

  rust-analyzer:

   - Remove assertion that was not true for distributions like NixOS

   - Add missing dependency edges and fix editions for 'quote' and
     sysroot crates to provide correct IDE support

  DRM Tyr:

   - Fix build error by adding missing dependency on 'CONFIG_COMMON_CLK'

  Plus clean a few typos in docs and comments"

* tag 'rust-fixes-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux: (28 commits)
  rust: num: bounded: clean __new documentation and comments
  scripts: generate_rust_analyzer: fix resolution of #[pin_data] macros
  drm/tyr: depend on `COMMON_CLK` to fix build error
  rust: sync: atomic: Provide stub for `rusttest` 32-bit hosts
  kbuild: rust: clean libpin_init_internal in mrproper
  rust: proc-macro2: rebuild if the version text changes
  rust: num: bounded: add missing comment for always inlined function
  rust: sync: refcount: always inline functions using build_assert with arguments
  rust: bits: always inline functions using build_assert with arguments
  scripts: generate_rust_analyzer: compile sysroot with correct edition
  scripts: generate_rust_analyzer: compile quote with correct edition
  scripts: generate_rust_analyzer: quote: treat `core` and `std` as dependencies
  scripts: generate_rust_analyzer: syn: treat `std` as a dependency
  scripts: generate_rust_analyzer: remove sysroot assertion
  rust: kbuild: give `--config-path` to `rustfmt` in `.rsi` target
  scripts: generate_rust_analyzer: Add pin_init_internal deps
  scripts: generate_rust_analyzer: Add pin_init -> compiler_builtins dep
  scripts: generate_rust_analyzer: Add compiler_builtins -> core dep
  rust: macros: ignore example with module parameters
  rust: num: bounded: mark __new as unsafe
  ...
parents 03610bd6 5016cae9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1624,7 +1624,8 @@ MRPROPER_FILES += include/config include/generated \
		  certs/x509.genkey \
		  vmlinux-gdb.py \
		  rpmbuild \
		  rust/libmacros.so rust/libmacros.dylib
		  rust/libmacros.so rust/libmacros.dylib \
		  rust/libpin_init_internal.so rust/libpin_init_internal.dylib

# clean - Delete most, but leave enough to build external modules
#
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ config DRM_TYR
	depends on RUST
	depends on ARM || ARM64 || COMPILE_TEST
	depends on !GENERIC_ATOMIC64  # for IOMMU_IO_PGTABLE_LPAE
	depends on COMMON_CLK
	default n
	help
	  Rust DRM driver for ARM Mali CSF-based GPUs.
+1 −0
Original line number Diff line number Diff line
@@ -383,6 +383,7 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
	-fno-inline-functions-called-once -fsanitize=bounds-strict \
	-fstrict-flex-arrays=% -fmin-function-alignment=% \
	-fzero-init-padding-bits=% -mno-fdpic \
	-fdiagnostics-show-context -fdiagnostics-show-context=% \
	--param=% --param asan-% -fno-isolate-erroneous-paths-dereference

# Derived from `scripts/Makefile.clang`.
+4 −2
Original line number Diff line number Diff line
@@ -27,7 +27,8 @@ pub fn [<checked_bit_ $ty>](n: u32) -> Option<$ty> {
            ///
            /// This version is the default and should be used if `n` is known at
            /// compile time.
            #[inline]
            // Always inline to optimize out error path of `build_assert`.
            #[inline(always)]
            pub const fn [<bit_ $ty>](n: u32) -> $ty {
                build_assert!(n < <$ty>::BITS);
                (1 as $ty) << n
@@ -75,7 +76,8 @@ pub fn [<genmask_checked_ $ty>](range: RangeInclusive<u32>) -> Option<$ty> {
            /// This version is the default and should be used if the range is known
            /// at compile time.
            $(#[$genmask_ex])*
            #[inline]
            // Always inline to optimize out error path of `build_assert`.
            #[inline(always)]
            pub const fn [<genmask_ $ty>](range: RangeInclusive<u32>) -> $ty {
                let start = *range.start();
                let end = *range.end();
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@

pub use core::fmt::{Arguments, Debug, Error, Formatter, Result, Write};

/// Internal adapter used to route allow implementations of formatting traits for foreign types.
/// Internal adapter used to route and allow implementations of formatting traits for foreign types.
///
/// It is inserted automatically by the [`fmt!`] macro and is not meant to be used directly.
///
Loading