Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to LLVM 18 #120055

Merged
merged 8 commits into from
Feb 13, 2024
Merged

Update to LLVM 18 #120055

merged 8 commits into from
Feb 13, 2024

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Jan 17, 2024

LLVM 18 final is planned to be released on Mar 5th. Rust 1.78 is planned to be released on May 2nd.

Tested images: dist-x86_64-linux, dist-s390x-linux, dist-aarch64-linux, dist-riscv64-linux, dist-loongarch64-linux, dist-x86_64-freebsd, dist-x86_64-illumos, dist-x86_64-musl, x86_64-linux-integration, test-various, armhf-gnu, i686-msvc, x86_64-msvc, i686-mingw, x86_64-mingw, x86_64-apple-1, x86_64-apple-2, dist-aarch64-apple

r? @ghost

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 17, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jan 17, 2024

These commits modify compiler targets.
(See the Target Tier Policy.)

@nikic nikic added relnotes Marks issues that should be documented in the release notes of the next release. S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 17, 2024
@rust-log-analyzer

This comment has been minimized.

@nikic
Copy link
Contributor Author

nikic commented Jan 17, 2024

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 17, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 17, 2024
@bors
Copy link
Contributor

bors commented Jan 17, 2024

⌛ Trying commit 0cd0ca9 with merge b10e375...

@bors
Copy link
Contributor

bors commented Jan 17, 2024

☀️ Try build successful - checks-actions
Build commit: b10e375 (b10e3758cdf73aa9155f6b955843731a66488b9c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b10e375): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.3% [0.2%, 3.5%] 5
Improvements ✅
(primary)
-2.5% [-14.2%, -0.3%] 230
Improvements ✅
(secondary)
-1.5% [-8.1%, -0.2%] 143
All ❌✅ (primary) -2.5% [-14.2%, -0.3%] 230

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.7% [0.6%, 3.5%] 10
Regressions ❌
(secondary)
3.5% [0.8%, 11.7%] 23
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.7%, -2.0%] 3
All ❌✅ (primary) 1.7% [0.6%, 3.5%] 10

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.2% [0.8%, 3.7%] 2
Improvements ✅
(primary)
-4.8% [-11.6%, -1.0%] 58
Improvements ✅
(secondary)
-3.8% [-6.7%, -1.4%] 24
All ❌✅ (primary) -4.8% [-11.6%, -1.0%] 58

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.7% [0.4%, 1.7%] 27
Regressions ❌
(secondary)
1.4% [0.7%, 16.0%] 42
Improvements ✅
(primary)
-0.8% [-1.5%, -0.4%] 20
Improvements ✅
(secondary)
-0.7% [-1.4%, -0.5%] 38
All ❌✅ (primary) 0.0% [-1.5%, 1.7%] 47

Bootstrap: 665.924s -> 629.581s (-5.46%)
Artifact size: 308.39 MiB -> 304.84 MiB (-1.15%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 17, 2024
@Kobzol
Copy link
Contributor

Kobzol commented Jan 18, 2024

Regarding runtime benchmarks, looks like some improvements were made to hashbrown's bitmask:

cargo run --bin collector profile_runtime cachegrind +52790a98e568f2e4f37b041ce353c660f5fb073d --rustc2 +b10e3758cdf73aa9155f6b955843731a66488b9c hashmap_find_misses_1m --group hashmap

> -9,175,044  benchlib::benchmark::BenchmarkGroup::register_benchmark::{{closure}}:
  -5,516,128    /home/ber0134/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.13.2/src/raw/mod.rs
  -5,505,024    /home/ber0134/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.13.2/src/raw/bitmask.rs
   1,835,009    library/core/src/iter/range.rs
  -1,835,008    library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs
   1,835,007    /home/ber0134/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.13.2/src/map.rs
      11,104    library/core/src/ptr/mut_ptr.rs

I tried finding codegen differences using cargo run --bin collector codegen_diff asm hashmap +52790a98e568f2e4f37b041ce353c660f5fb073d +b10e3758cdf73aa9155f6b955843731a66488b9c > assembly.txt, but I didn't find anything obviously better.

@mvelbaum
Copy link

This may be a bit offtopic, but @nikic -- any chance https://reviews.llvm.org/D159075 gets into LLVM18? It's the last patch in the series and shame to see it get lost :(.

@nikic
Copy link
Contributor Author

nikic commented Jan 22, 2024

dist-390x-linux fails with:

  running: "sccache" "s390x-ibm-linux-gnu-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-ffunction-sections" "-fdata-sections" "-fPIC" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-fomit-frame-pointer" "-ffile-prefix-map=/checkout/src/llvm-project/compiler-rt=." "-DVISIBILITY_HIDDEN" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/s390x-unknown-linux-gnu/release/build/compiler_builtins-acd098fd76de8b8d/out/45c91108d938afe8-divxc3.o" "-c" "/checkout/src/llvm-project/compiler-rt/lib/builtins/divxc3.c"
  cargo:warning=/checkout/src/llvm-project/compiler-rt/lib/builtins/divxc3.c:20:35: error: unknown type name 'xf_float'; did you mean 'tf_float'?
  cargo:warning= COMPILER_RT_ABI Lcomplex __divxc3(xf_float __a, xf_float __b, xf_float __c,
  cargo:warning=                                   ^~~~~~~~
  cargo:warning=                                   tf_float
  cargo:warning=/checkout/src/llvm-project/compiler-rt/lib/builtins/divxc3.c:20:49: error: unknown type name 'xf_float'; did you mean 'tf_float'?
  cargo:warning= COMPILER_RT_ABI Lcomplex __divxc3(xf_float __a, xf_float __b, xf_float __c,
  cargo:warning=                                                 ^~~~~~~~
  cargo:warning=                                                 tf_float
  cargo:warning=/checkout/src/llvm-project/compiler-rt/lib/builtins/divxc3.c:20:63: error: unknown type name 'xf_float'; did you mean 'tf_float'?
  cargo:warning= COMPILER_RT_ABI Lcomplex __divxc3(xf_float __a, xf_float __b, xf_float __c,
  cargo:warning=                                                               ^~~~~~~~
  cargo:warning=                                                               tf_float
  cargo:warning=/checkout/src/llvm-project/compiler-rt/lib/builtins/divxc3.c:21:35: error: unknown type name 'xf_float'; did you mean 'tf_float'?
  cargo:warning=                                   xf_float __d) {
  cargo:warning=                                   ^~~~~~~~
  cargo:warning=                                   tf_float

@nikic
Copy link
Contributor Author

nikic commented Jan 22, 2024

This looks like an issue in the compiler-builtins build script, which unconditionally adds files for 80-bit long double builtins in https://github.com/rust-lang/compiler-builtins/blob/ab849edf5c9e66ad2c9194f83b023847bd6dbe6d/build.rs#L289 We should only be doing that on x86 -- or maybe not at all? Does rust even support 80-bit floats?

@nikic
Copy link
Contributor Author

nikic commented Jan 22, 2024

Submitted rust-lang/compiler-builtins#568 to fix this.

@nikic
Copy link
Contributor Author

nikic commented Jan 22, 2024

rust-lang/compiler-builtins#564 is also needed for aarch64.

@nikic
Copy link
Contributor Author

nikic commented Jan 23, 2024

The codegen test update is now part of #120265.

@nikic
Copy link
Contributor Author

nikic commented Jan 23, 2024

test-various fails wasm32-unknown-unknown run-make with failures like these:

---- [run-make] tests/run-make/wasm-stringify-ints-small stdout ----

error: make failed
status: exit status: 2
command: cd "/checkout/tests/run-make/wasm-stringify-ints-small" && env -u CARGO_MAKEFLAGS -u MAKEFLAGS -u MFLAGS -u RUSTFLAGS AR="ar" CC="clang -ffunction-sections -fdata-sections -fPIC --target=wasm32-unknown-unknown" CXX="clang -ffunction-sections -fdata-sections -fPIC --target=wasm32-unknown-unknown" HOST_RPATH_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard codegen codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray" LLVM_FILECHECK="/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" NODE="/node-v18.12.0-linux-x64/bin/node" PYTHON="/usr/bin/python3" RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTDOC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" RUST_BUILD_STAGE="stage2-wasm32-unknown-unknown" S="/checkout" TARGET="wasm32-unknown-unknown" TARGET_RPATH_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-unknown/lib" TMPDIR="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-stringify-ints-small/wasm-stringify-ints-small" "make"
--- stdout -------------------------------
LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-stringify-ints-small/wasm-stringify-ints-small:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-stringify-ints-small/wasm-stringify-ints-small -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-stringify-ints-small/wasm-stringify-ints-small  -Ainternal_features foo.rs -C lto -O --target wasm32-unknown-unknown
------------------------------------------
--- stderr -------------------------------
error: linking with `rust-lld` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin/self-contained:/checkout/obj/build/x86_64-unknown-linux-gnu/lld/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "rust-lld" "-flavor" "wasm" "--rsp-quoting=posix" "--export" "foo" "--export=__heap_base" "--export=__data_end" "-z" "stack-size=1048576" "--stack-first" "--allow-undefined" "--fatal-warnings" "--no-demangle" "--no-entry" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-stringify-ints-small/wasm-stringify-ints-small/foo.foo.5be5606e1f6aa79b-cgu.0.rcgu.o" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-stringify-ints-small/wasm-stringify-ints-small" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-unknown/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-unknown/lib/libcompiler_builtins-9a7cc444abeb8283.rlib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-unknown/lib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-unknown/lib/self-contained" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/wasm-stringify-ints-small/wasm-stringify-ints-small/foo.wasm" "--gc-sections" "--no-entry" "-O2"
  = note: rust-lld: error: /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-unknown/lib/libcompiler_builtins-9a7cc444abeb8283.rlib: archive member 'lib.rmeta' is neither Wasm object file nor LLVM bitcode
          

error: aborting due to 1 previous error

make: *** [Makefile:5: all] Error 1
------------------------------------------



failures:
    [run-make] tests/run-make/issue-83112-incr-test-moved-file
    [run-make] tests/run-make/incr-prev-body-beyond-eof
    [run-make] tests/run-make/issue-85019-moved-src-dir
    [run-make] tests/run-make/wasm-abi
    [run-make] tests/run-make/wasm-custom-sections-opt
    [run-make] tests/run-make/wasm-exceptions-nostd
    [run-make] tests/run-make/wasm-symbols-different-module
    [run-make] tests/run-make/wasm-export-all-symbols
    [run-make] tests/run-make/wasm-symbols-not-imported
    [run-make] tests/run-make/wasm-spurious-import
    [run-make] tests/run-make/wasm-symbols-not-exported
    [run-make] tests/run-make/wasm-custom-section
    [run-make] tests/run-make/wasm-panic-small
    [run-make] tests/run-make/wasm-import-module
    [run-make] tests/run-make/wasm-stringify-ints-small

Key part:

  = note: rust-lld: error: /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-unknown/lib/libcompiler_builtins-9a7cc444abeb8283.rlib: archive member 'lib.rmeta' is neither Wasm object file nor LLVM bitcode

@nikic
Copy link
Contributor Author

nikic commented Jan 23, 2024

The wasm issue was introduced by llvm/llvm-project#78658.

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jan 23, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jan 23, 2024

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

dtolnay added a commit to dtolnay/clang-ast that referenced this pull request Feb 14, 2024
This bisects to rust-lang/rust#120055.

    Running tests/exhaustive.rs (target/release/deps/exhaustive-e2f6c3a78f65e6a2)

    running 1 test

    thread 'test' has overflowed its stack
    fatal runtime error: stack overflow
    error: test failed, to rerun pass `--test exhaustive`

    Caused by:
      process didn't exit successfully: `target/release/deps/exhaustive-e2f6c3a78f65e6a2` (signal: 6, SIGABRT: process abort signal)
bors added a commit to rust-lang/cargo that referenced this pull request Feb 15, 2024
Update tests for changes in latest nightly

There were two changes that has caused nightly tests to start failing:
* LLVM was updated, and that caused a change in the expected data layout for the target. (rust-lang/rust#120055 update to LLVM 18)
* rust-lang/rust#121049 Do not point at `#[allow(_)]` as the reason for compat lint triggering. The test was looking for the `unused_variables` note, which is no longer printed.
weihanglo pushed a commit to weihanglo/cargo that referenced this pull request Feb 16, 2024
Update tests for changes in latest nightly

There were two changes that has caused nightly tests to start failing:
* LLVM was updated, and that caused a change in the expected data layout for the target. (rust-lang/rust#120055 update to LLVM 18)
* rust-lang/rust#121049 Do not point at `#[allow(_)]` as the reason for compat lint triggering. The test was looking for the `unused_variables` note, which is no longer printed.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 6, 2024
…, r=workingjubilee

Remove outdated footnote "missing-stack-probe" in platform-support

... after rust-lang#120055 and rust-lang#118491.

cc rust-lang#77071 (comment).
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 7, 2024
Rollup merge of rust-lang#122094 - slanterns:arm-stack-probe-footnote, r=workingjubilee

Remove outdated footnote "missing-stack-probe" in platform-support

... after rust-lang#120055 and rust-lang#118491.

cc rust-lang#77071 (comment).
ojeda added a commit to ojeda/linux that referenced this pull request Apr 1, 2024
This is the next upgrade to the Rust toolchain, from 1.77.1 to 1.78.0
(i.e. the latest) [1].

See the upgrade policy [2] and the comments on the first upgrade in
commit 3ed03f4 ("rust: upgrade to Rust 1.68.2").

# Unstable features

There have been no changes to the set of unstable features used in
our own code. Therefore, the only unstable features allowed to be used
outside the `kernel` crate is still `new_uninit`.

However, since we are finally dropping our `alloc` fork [3], all the
unstable features used by `alloc` (~30 language ones, ~60 library ones)
are not a concern anymore. This reduces the maintanance burden, increases
the chances of new compiler versions working without changes and gets
us closer to the goal of supporting several compiler versions.

It also means that, ignoring non-language/library features, we are
currently left with just the few language features needed to implement the
kernel `Arc`, the `new_uninit` library feature, the `compiler_builtins`
marker and the few `no_*` `cfg`s we pass when compiling `core`/`alloc`.

Please see [4] for details.

# Required changes

## LLVM's data layout

Rust 1.77.0 (i.e. the previous upgrade) introduced a check for matching
LLVM data layouts [5]. Then, Rust 1.78.0 upgraded LLVM's bundled major
version from 17 to 18 [6], which changed the data layout in x86 [7]. Thus
update the data layout in our custom target specification for x86 so
that the compiler does not complain about the mismatch:

    error: data-layout for target `target-5559158138856098584`,
    `e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128`,
    differs from LLVM target's `x86_64-linux-gnu` default layout,
    `e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128`

In the future, the goal is to drop the custom target specification
files. Meanwhile, if we want to support other LLVM versions used
in `rustc` (e.g. for LTO), we will need to add some extra logic
(e.g. conditional on LLVM's version, or extracting the data layout from
an existing built-in target specification).

## `unused_imports`

Rust's `unused_imports` lint covers both unused and redudant imports.
Now, in 1.78.0, the lint detects more cases of redundant imports [8].
Thus the previous commit cleaned them up.

## Clippy's `new_without_default`

Clippy now suggests to implement `Default` even when `new()` is `const`,
since `Default::default()` may call `const` functions even if it is not
`const` itself [9]. Thus the previous commit added the implementation.

# Other changes in Rust

Rust 1.78.0 introduces `feature(asm_goto)` [10] [11]. This feature was
discussed in the past [12].

Rust 1.78.0 introduced support for mutable pointers to Rust statics,
including a test case for the Linux kernel's `VTABLE` use case [13].

Rust 1.78.0 with debug assertions enabled (i.e. `-Cdebug-assertions=y`,
kernel's `CONFIG_RUST_DEBUG_ASSERTIONS=y`) will now always check all
unsafe preconditions, without a way to opt-out for particular cases [14].

Rust 1.78.0 also improved a couple issues we reported when giving feedback
for the new `--check-cfg` feature [15] [16].

# `alloc` upgrade and reviewing

As mentioned above, compiler upgrades will not update `alloc` anymore,
since we are dropping our `alloc` fork [3].

As a bonus, even if that series is not applied, the new compiler release
happens to build cleanly the existing `alloc` too (i.e. the previous
version's).

Link: https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1770-2024-03-21 [1]
Link: https://rust-for-linux.com/rust-version-policy [2]
Link: https://lore.kernel.org/rust-for-linux/20240328013603.206764-1-wedsonaf@gmail.com/ [3]
Link: Rust-for-Linux#2 [4]
Link: rust-lang/rust#120062 [5]
Link: rust-lang/rust#120055 [6]
Link: https://reviews.llvm.org/D86310 [7]
Link: rust-lang/rust#117772 [8]
Link: rust-lang/rust-clippy#10903 [9]
Link: rust-lang/rust#119365 [10]
Link: rust-lang/rust#119364 [11]
Link: https://lore.kernel.org/rust-for-linux/ZWipTZysC2YL7qsq@Boquns-Mac-mini.home/ [12]
Link: rust-lang/rust#120932 [13]
Link: rust-lang/rust#120969 [14]
Link: rust-lang/rust#121202 [15]
Link: rust-lang/rust#121237 [16]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
ojeda added a commit to ojeda/linux that referenced this pull request Apr 1, 2024
This is the next upgrade to the Rust toolchain, from 1.77.1 to 1.78.0
(i.e. the latest) [1].

See the upgrade policy [2] and the comments on the first upgrade in
commit 3ed03f4 ("rust: upgrade to Rust 1.68.2").

# Unstable features

There have been no changes to the set of unstable features used in
our own code. Therefore, the only unstable features allowed to be used
outside the `kernel` crate is still `new_uninit`.

However, since we are finally dropping our `alloc` fork [3], all the
unstable features used by `alloc` (~30 language ones, ~60 library ones)
are not a concern anymore. This reduces the maintenance burden, increases
the chances of new compiler versions working without changes and gets
us closer to the goal of supporting several compiler versions.

It also means that, ignoring non-language/library features, we are
currently left with just the few language features needed to implement the
kernel `Arc`, the `new_uninit` library feature, the `compiler_builtins`
marker and the few `no_*` `cfg`s we pass when compiling `core`/`alloc`.

Please see [4] for details.

# Required changes

## LLVM's data layout

Rust 1.77.0 (i.e. the previous upgrade) introduced a check for matching
LLVM data layouts [5]. Then, Rust 1.78.0 upgraded LLVM's bundled major
version from 17 to 18 [6], which changed the data layout in x86 [7]. Thus
update the data layout in our custom target specification for x86 so
that the compiler does not complain about the mismatch:

    error: data-layout for target `target-5559158138856098584`,
    `e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128`,
    differs from LLVM target's `x86_64-linux-gnu` default layout,
    `e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128`

In the future, the goal is to drop the custom target specification
files. Meanwhile, if we want to support other LLVM versions used
in `rustc` (e.g. for LTO), we will need to add some extra logic
(e.g. conditional on LLVM's version, or extracting the data layout from
an existing built-in target specification).

## `unused_imports`

Rust's `unused_imports` lint covers both unused and redundant imports.
Now, in 1.78.0, the lint detects more cases of redundant imports [8].
Thus one of the previous patches cleaned them up.

## Clippy's `new_without_default`

Clippy now suggests to implement `Default` even when `new()` is `const`,
since `Default::default()` may call `const` functions even if it is not
`const` itself [9]. Thus one of the previous patches implemented it.

# Other changes in Rust

Rust 1.78.0 introduced `feature(asm_goto)` [10] [11]. This feature was
discussed in the past [12].

Rust 1.78.0 introduced support for mutable pointers to Rust statics,
including a test case for the Linux kernel's `VTABLE` use case [13].

Rust 1.78.0 with debug assertions enabled (i.e. `-Cdebug-assertions=y`,
kernel's `CONFIG_RUST_DEBUG_ASSERTIONS=y`) now always checks all unsafe
preconditions, without a way to opt-out for particular cases [14].

Rust 1.78.0 also improved a couple issues we reported when giving feedback
for the new `--check-cfg` feature [15] [16].

# `alloc` upgrade and reviewing

As mentioned above, compiler upgrades will not update `alloc` anymore,
since we are dropping our `alloc` fork [3].

Link: https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1780-2024-05-02 [1]
Link: https://rust-for-linux.com/rust-version-policy [2]
Link: https://lore.kernel.org/rust-for-linux/20240328013603.206764-1-wedsonaf@gmail.com/ [3]
Link: Rust-for-Linux#2 [4]
Link: rust-lang/rust#120062 [5]
Link: rust-lang/rust#120055 [6]
Link: https://reviews.llvm.org/D86310 [7]
Link: rust-lang/rust#117772 [8]
Link: rust-lang/rust-clippy#10903 [9]
Link: rust-lang/rust#119365 [10]
Link: rust-lang/rust#119364 [11]
Link: https://lore.kernel.org/rust-for-linux/ZWipTZysC2YL7qsq@Boquns-Mac-mini.home/ [12]
Link: rust-lang/rust#120932 [13]
Link: rust-lang/rust#120969 [14]
Link: rust-lang/rust#121202 [15]
Link: rust-lang/rust#121237 [16]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
ojeda added a commit to ojeda/linux that referenced this pull request Apr 1, 2024
This is the next upgrade to the Rust toolchain, from 1.77.1 to 1.78.0
(i.e. the latest) [1].

See the upgrade policy [2] and the comments on the first upgrade in
commit 3ed03f4 ("rust: upgrade to Rust 1.68.2").

# Unstable features

There have been no changes to the set of unstable features used in
our own code. Therefore, the only unstable features allowed to be used
outside the `kernel` crate is still `new_uninit`.

However, since we are finally dropping our `alloc` fork [3], all the
unstable features used by `alloc` (~30 language ones, ~60 library ones)
are not a concern anymore. This reduces the maintenance burden, increases
the chances of new compiler versions working without changes and gets
us closer to the goal of supporting several compiler versions.

It also means that, ignoring non-language/library features, we are
currently left with just the few language features needed to implement the
kernel `Arc`, the `new_uninit` library feature, the `compiler_builtins`
marker and the few `no_*` `cfg`s we pass when compiling `core`/`alloc`.

Please see [4] for details.

# Required changes

## LLVM's data layout

Rust 1.77.0 (i.e. the previous upgrade) introduced a check for matching
LLVM data layouts [5]. Then, Rust 1.78.0 upgraded LLVM's bundled major
version from 17 to 18 [6], which changed the data layout in x86 [7]. Thus
update the data layout in our custom target specification for x86 so
that the compiler does not complain about the mismatch:

    error: data-layout for target `target-5559158138856098584`,
    `e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128`,
    differs from LLVM target's `x86_64-linux-gnu` default layout,
    `e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128`

In the future, the goal is to drop the custom target specifications.
Meanwhile, if we want to support other LLVM versions used in `rustc`
(e.g. for LTO), we will need to add some extra logic (e.g. conditional on
LLVM's version, or extracting the data layout from an existing built-in
target specification).

## `unused_imports`

Rust's `unused_imports` lint covers both unused and redundant imports.
Now, in 1.78.0, the lint detects more cases of redundant imports [8].
Thus one of the previous patches cleaned them up.

## Clippy's `new_without_default`

Clippy now suggests to implement `Default` even when `new()` is `const`,
since `Default::default()` may call `const` functions even if it is not
`const` itself [9]. Thus one of the previous patches implemented it.

# Other changes in Rust

Rust 1.78.0 introduced `feature(asm_goto)` [10] [11]. This feature was
discussed in the past [12].

Rust 1.78.0 introduced support for mutable pointers to Rust statics,
including a test case for the Linux kernel's `VTABLE` use case [13].

Rust 1.78.0 with debug assertions enabled (i.e. `-Cdebug-assertions=y`,
kernel's `CONFIG_RUST_DEBUG_ASSERTIONS=y`) now always checks all unsafe
preconditions, without a way to opt-out for particular cases [14].

Rust 1.78.0 also improved a couple issues we reported when giving feedback
for the new `--check-cfg` feature [15] [16].

# `alloc` upgrade and reviewing

As mentioned above, compiler upgrades will not update `alloc` anymore,
since we are dropping our `alloc` fork [3].

Link: https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1780-2024-05-02 [1]
Link: https://rust-for-linux.com/rust-version-policy [2]
Link: https://lore.kernel.org/rust-for-linux/20240328013603.206764-1-wedsonaf@gmail.com/ [3]
Link: Rust-for-Linux#2 [4]
Link: rust-lang/rust#120062 [5]
Link: rust-lang/rust#120055 [6]
Link: https://reviews.llvm.org/D86310 [7]
Link: rust-lang/rust#117772 [8]
Link: rust-lang/rust-clippy#10903 [9]
Link: rust-lang/rust#119365 [10]
Link: rust-lang/rust#119364 [11]
Link: https://lore.kernel.org/rust-for-linux/ZWipTZysC2YL7qsq@Boquns-Mac-mini.home/ [12]
Link: rust-lang/rust#120932 [13]
Link: rust-lang/rust#120969 [14]
Link: rust-lang/rust#121202 [15]
Link: rust-lang/rust#121237 [16]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 4, 2024
coverage: Correctly report and check LLVM's coverage mapping version

I was puzzled by the fact that the LLVM 18 update (rust-lang#120055) didn't need to modify this version check, despite the fact that LLVM 18 uses a newer version of the coverage mapping format.

This turned out to be because we were inappropriately hard-coding a specific version (`Version6`) in the C++ wrapper, instead of using `CovMapVersion::CurrentVersion` to reflect the version actually used by LLVM on our behalf.

This PR fixes that, and also changes the Rust-side version check to accept the new coverage mapping version used by LLVM 18, since the necessary compatibility work has already been done.

---

### Quick history of `LLVMRustCoverageMappingVersion`:

- Originally it returned LLVM's `coverage::CovMapVersion::CurrentVersion`, as intended. The Rust-side code would verify it, and also embed it as the actual coverage version number in the output binary.
- At some point it was changed to a hard-coded value, to work around a (now-irrelevant) compatibility issue. This was incorrect (but mostly benign), because the override should have been performed on the Rust side instead, after verifying LLVM's value.
- Later contributors dutifully updated the hard-coded value, because they didn't have enough context to identify the problem.
- With this PR, it once again returns LLVM's current coverage version number, and the Rust-side code checks it against an expected range. We don't override the result, but we do indicate where that override should occur if it ever becomes necessary.
Oneirical added a commit to Oneirical/rust that referenced this pull request Apr 6, 2024
commit bbab2cf0209279cef607f859097c35d21939b898
Merge: 61b07b7f599 ea40fa210b8
Author: Julien <96022417+Oneirical@users.noreply.github.com>
Date:   Fri Apr 5 20:23:58 2024 +0000

    Merge branch 'master' into version

commit 61b07b7f599417bee714a6e8924b64b7ae466694
Author: Oneirical <manchot@videotron.ca>
Date:   Fri Apr 5 16:22:49 2024 -0400

    attempt to fix merge conflict

commit bebb3c4edeb12ef0a27b087508501d8c0e6d7d0c
Author: Oneirical <manchot@videotron.ca>
Date:   Fri Apr 5 16:14:32 2024 -0400

    try making tidy happy again

commit 6c727321f26ce61a52adc69cf965e0877de530d3
Author: Oneirical <manchot@videotron.ca>
Date:   Fri Apr 5 16:13:44 2024 -0400

    sync ui_tests.rs with master

commit 44bc9cae014808afad6b76cb7a02832b181adf76
Author: Oneirical <manchot@videotron.ca>
Date:   Fri Apr 5 16:10:19 2024 -0400

    a worthy sacrifice to tidy (possible merge conflict)

commit ea40fa210b87a322d2259852c149ffa212a3a0da
Merge: 1921968cc54 6cf6fd38ec0
Author: bors <bors@rust-lang.org>
Date:   Fri Apr 5 17:28:45 2024 +0000

    Auto merge of #123502 - bjorn3:sync_cg_clif-2024-04-05, r=bjorn3

    Subtree sync for rustc_codegen_cranelift

    This fixes an ICE when compiling unchecked_shl/unchecked_shr.

    r? `@ghost`

    `@rustbot` label +A-codegen +A-cranelift +T-compiler

commit 6cf6fd38ec06decc2e5896ca3659cd74b0b03363
Merge: 5958f5e08fa fbda869b4e2
Author: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date:   Fri Apr 5 16:20:23 2024 +0000

    Merge commit 'fbda869b4e230c788b6bce426038ba8419956f2d' into sync_cg_clif-2024-04-05

commit 1921968cc5403892739b43bdefe793a130badd15
Merge: 5958f5e08fa 9cb517aede5
Author: bors <bors@rust-lang.org>
Date:   Fri Apr 5 15:20:50 2024 +0000

    Auto merge of #123497 - GuillaumeGomez:rollup-usqb4q9, r=GuillaumeGomez

    Rollup of 8 pull requests

    Successful merges:

     - #122334 (Vendor rustc_codegen_gcc)
     - #122894 (Move check for error in impl header outside of reporting)
     - #123149 (Port argument-non-c-like-enum to Rust)
     - #123311 (Match ergonomics: implement "`&`pat everywhere")
     - #123350 (Actually use the inferred `ClosureKind` from signature inference in coroutine-closures)
     - #123474 (Port `run-make/issue-7349` to a codegen test)
     - #123489 (handle rustc args properly in bootstrap)
     - #123496 (ping on wf changes, remove fixme)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit fbda869b4e230c788b6bce426038ba8419956f2d
Author: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date:   Wed Mar 27 20:43:19 2024 +0000

    Add a couple more sync impls to mini_core

commit 454c87bdd442636b474d943c0e587750b46d822b
Merge: 40d40fb2293 1bab6df32b7
Author: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date:   Fri Apr 5 15:01:30 2024 +0000

    Merge branch 'build_system_changes'

commit 158c301cee972e36b2a615f98ce0ddd5db41a6f7
Author: Oneirical <manchot@videotron.ca>
Date:   Wed Apr 3 14:16:06 2024 -0400

    rewrite version as an UI test

    try fixing merge conflict

    also fix root_entry_limit

    make tidy happy

    remove does-nothing

    fix: set back to 860

commit 9cb517aede5500e80d25a39ba9f079dcf29fb8d4
Merge: b0ca3cd9d42 6db7ac62332
Author: Guillaume Gomez <guillaume1.gomez@gmail.com>
Date:   Fri Apr 5 16:38:52 2024 +0200

    Rollup merge of #123496 - lcnr:wf-ping, r=compiler-errors

    ping on wf changes, remove fixme

    extend core type system pings to `wf.rs`

    r? `@compiler-errors`

commit b0ca3cd9d42d797ccf8a2b172a237921d721dfed
Merge: 0d5ee650f86 199589d8146
Author: Guillaume Gomez <guillaume1.gomez@gmail.com>
Date:   Fri Apr 5 16:38:52 2024 +0200

    Rollup merge of #123489 - onur-ozkan:handle-rustc-args-properly, r=clubby789

    handle rustc args properly in bootstrap

    Because `RUSTFLAGS` gets overwritten during the conversion from `Cargo` to `Command`, the passed rustc args were being lost. This change combines the rustc args with the values that override `RUSTFLAGS`.

    Fixes #123228

commit 0d5ee650f8619021635e255447a036b2e98d42b8
Merge: 02ee8a8ceef 476156aedf4
Author: Guillaume Gomez <guillaume1.gomez@gmail.com>
Date:   Fri Apr 5 16:38:51 2024 +0200

    Rollup merge of #123474 - jieyouxu:issue-7349-port, r=Mark-Simulacrum

    Port `run-make/issue-7349` to a codegen test

    The test does not need to be a run-make test, it can use the codegen test infrastructure.

    Also took the opportunity to rename the test to `no-redundant-item-monomorphization` so it's not just some opaque issue number.

    Part of #121876.

commit 02ee8a8ceeff811adfb065028a48c1947d97ef91
Merge: f2f8d8b722f 55e46612c1c
Author: Guillaume Gomez <guillaume1.gomez@gmail.com>
Date:   Fri Apr 5 16:38:51 2024 +0200

    Rollup merge of #123350 - compiler-errors:async-closure-by-move, r=oli-obk

    Actually use the inferred `ClosureKind` from signature inference in coroutine-closures

    A follow-up to https://github.com/rust-lang/rust/pull/123349, which fixes another subtle bug: We were not taking into account the async closure kind we infer during closure signature inference.

    When I pass a closure directly to an arg like `fn(x: impl async FnOnce())`, that should have the side-effect of artificially restricting the kind of the async closure to `ClosureKind::FnOnce`. We weren't doing this -- that's a quick fix; however, it uncovers a second, more subtle bug with the way that `move`, async closures, and `FnOnce` interact.

    Specifically, when we have an async closure like:
    ```
    let x = Struct;
    let c = infer_as_fnonce(async move || {
      println!("{x:?}");
    }
    ```

    The outer closure captures `x` by move, but the inner coroutine still immutably borrows `x` from the outer closure. Since we've forced the closure to by `async FnOnce()`, we can't actually *do* a self borrow, since the signature of `AsyncFnOnce::call_once` doesn't have a borrowed lifetime. This means that all `async move` closures that are constrained to `FnOnce` will fail borrowck.

    We can fix that by detecting this case specifically, and making the *inner* async closure `move` as well. This is always beneficial to closure analysis, since if we have an `async FnOnce()` that's `move`, there's no reason to ever borrow anything, so `move` isn't artificially restrictive.

commit f2f8d8b722fdacc6a6e02c2289e3e36571749a68
Merge: c36c0095776 e5376f3947b
Author: Guillaume Gomez <guillaume1.gomez@gmail.com>
Date:   Fri Apr 5 16:38:50 2024 +0200

    Rollup merge of #123311 - Jules-Bertholet:andpat-everywhere, r=Nadrieril

    Match ergonomics: implement "`&`pat everywhere"

    Implements the eat-two-layers (feature gate `and_pat_everywhere`, all editions) ~and the eat-one-layer (feature gate `and_eat_one_layer_2024`, edition 2024 only, takes priority on that edition when both feature gates are active)~ (EDIT: will be done in later PR) semantics.

    cc #123076

    r? ``@Nadrieril``

    ``@rustbot`` label A-patterns A-edition-2024

commit c36c0095776f1cbc39d15a206b4b1018b329b4aa
Merge: cb6a1c8d455 fad8213150b
Author: Guillaume Gomez <guillaume1.gomez@gmail.com>
Date:   Fri Apr 5 16:38:50 2024 +0200

    Rollup merge of #123149 - jieyouxu:rmake-arguments-non-c-like-enum, r=Mark-Simulacrum

    Port argument-non-c-like-enum to Rust

    Part of #121876.

commit cb6a1c8d455a26c82165e3285557da2d82e22385
Merge: 8873ca57f86 5333f2a9d15
Author: Guillaume Gomez <guillaume1.gomez@gmail.com>
Date:   Fri Apr 5 16:38:49 2024 +0200

    Rollup merge of #122894 - compiler-errors:downgrade, r=lcnr

    Move check for error in impl header outside of reporting

    Fixes #121006

    r? lcnr

    test location kinda sucks, can move it if needed

commit 8873ca57f8646328bf0a10ee94918c8c597706e9
Merge: 4563f70c3b5 0f5140e3834
Author: Guillaume Gomez <guillaume1.gomez@gmail.com>
Date:   Fri Apr 5 16:38:49 2024 +0200

    Rollup merge of #122334 - GuillaumeGomez:vendor-cg_gcc, r=Mark-Simulacrum

    Vendor rustc_codegen_gcc

    I used https://github.com/rust-lang/rust/pull/115274 as base for this update.

    r? `@bjorn3`

commit 1bab6df32b7e593f75ab6470c0b650b345107995
Author: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date:   Tue Apr 2 14:17:35 2024 +0000

    Remove all checks for CI in the build system

    And introduce the CG_CLIF_EXPENSIVE_CHECKS env var in the place.

commit f269cdd80582ec92972483641676e4a933b583a0
Author: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date:   Fri Apr 5 13:56:21 2024 +0000

    Move disabling incr comp and denying warnings to the CI config

commit 603b2800f7fa61947b35419f1a5a33e265792001
Author: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date:   Tue Apr 2 15:17:56 2024 +0000

    Revoke all permissions from GHA workflows where possible

commit 65342df8cd9ed8ca5311edc69f445fdb7b60a191
Author: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date:   Tue Apr 2 15:11:20 2024 +0000

    Dedup default shell specification for GHA

commit 91ffd74de41fa473bf8e7ac94b8159578ba3e94c
Author: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date:   Tue Apr 2 15:05:06 2024 +0000

    Simplify GHA CI workflow

commit 5958f5e08fa88ee95ede8c00f1b89befe0372d54
Merge: 4563f70c3b5 3ad9c83cd25
Author: bors <bors@rust-lang.org>
Date:   Fri Apr 5 13:17:09 2024 +0000

    Auto merge of #123317 - RalfJung:test-in-miri, r=m-ou-se,saethlin,onur-ozkan

    Support running library tests in Miri

    This adds a new bootstrap subcommand `./x.py miri` which can test libraries in Miri. This is in preparation for eventually doing that as part of bors CI, but this PR only adds the infrastructure, and doesn't enable it yet.

    `@rust-lang/bootstrap` should this be `x.py test --miri library/core` or `x.py miri library/core`? The flag has the advantage that we don't have to copy all the arguments from `Subcommand::Test`. It has the disadvantage that most test steps just ignore `--miri` and still run tests the regular way. For clippy you went the route of making it a separate subcommand. ~~I went with a flag now as that seemed easier, but I can change this.~~ I made it a new subcommand. Note however that the regular cargo invocation would be `cargo miri test ...`, so `x.py` is still going to be different in that the `test` is omitted. That said, we could also make it `./x.py miri-test` to make that difference smaller -- that's in fact more consistent with the internal name of the command when bootstrap invokes cargo.

    `@rust-lang/libs` ~~unfortunately this PR does some unholy things to the `lib.rs` files of our library crates.~~
    `@m-ou-se` found a way that entirely avoids library-level hacks, except for some new small `lib.miri.rs` files that hopefully you will never have to touch. There's a new hack in cargo-miri but there it is in good company...

commit 6db7ac6233244c550b3b0a030387419ab2ac9ddd
Author: lcnr <rust@lcnr.de>
Date:   Fri Apr 5 15:09:48 2024 +0200

    ping on wf changes, remove fixme

commit 40d40fb2293734b6ac9c77e764bf0183819e4a95
Author: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date:   Tue Apr 2 14:29:00 2024 +0000

    Fix warning in mini_core

commit 737421a25b9a46aca017ffef1b1d648e278d1d87
Author: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date:   Fri Apr 5 12:15:41 2024 +0000

    Rustup to rustc 1.79.0-nightly (385fa9d84 2024-04-04)

commit 5a9940fe3dd8e48d98b92d13a03372ff7da93f31
Merge: 64d6da5cda2 6728f2fef42
Author: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date:   Fri Apr 5 11:39:51 2024 +0000

    Sync from rust 385fa9d845dd326c6bbfd58c22244215e431948a

commit 4563f70c3b599411836e285591479f4a3d364708
Merge: d009f60b55f aa9c9a36c06
Author: bors <bors@rust-lang.org>
Date:   Fri Apr 5 11:11:17 2024 +0000

    Auto merge of #122070 - Zoxc:dep-edges-from-previous, r=cjgillot

    Encode dep graph edges directly from the previous graph when promoting

    This encodes dep graph edges directly from the previous graph when promoting nodes from a previous session, avoiding allocations / copies.

    ~~Based on https://github.com/rust-lang/rust/pull/122064 and https://github.com/rust-lang/rust/pull/116375.~~

    <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check:unchanged</td><td align="right">0.4177s</td><td align="right">0.4072s</td><td align="right">💚  -2.52%</td></tr><tr><td>🟣 <b>hyper</b>:check:unchanged</td><td align="right">0.1430s</td><td align="right">0.1420s</td><td align="right"> -0.69%</td></tr><tr><td>🟣 <b>regex</b>:check:unchanged</td><td align="right">0.3106s</td><td align="right">0.3038s</td><td align="right">💚  -2.19%</td></tr><tr><td>🟣 <b>syn</b>:check:unchanged</td><td align="right">0.5823s</td><td align="right">0.5688s</td><td align="right">💚  -2.33%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check:unchanged</td><td align="right">1.3992s</td><td align="right">1.3692s</td><td align="right">💚  -2.14%</td></tr><tr><td>Total</td><td align="right">2.8528s</td><td align="right">2.7910s</td><td align="right">💚  -2.17%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9803s</td><td align="right">💚  -1.97%</td></tr></table>

commit 3ad9c83cd2538f865b62c87f998cb25e599da029
Author: Ralf Jung <post@ralfj.de>
Date:   Fri Apr 5 08:51:46 2024 +0200

    miri: go look for the item in all crates of the right name

commit d009f60b55fe4527e7ddf122bc4520f351d7b9d4
Merge: c0ddaef0757 af81ab76288
Author: bors <bors@rust-lang.org>
Date:   Fri Apr 5 09:09:35 2024 +0000

    Auto merge of #123469 - belovdv:remove-miri-jobserver-fixme, r=petrochenkov

    remove miri jobserver workaround

    This PR removes workaround, added in #113730, since jobserver is kept after [rust-lang/cargo#12776](https://github.com/rust-lang/cargo/pull/12776)

commit 199589d81466a4b436bd41cc0dfd2f35c908a951
Author: onur-ozkan <work@onurozkan.dev>
Date:   Fri Apr 5 10:52:36 2024 +0300

    handle rustc args properly in bootstrap

    Because `RUSTFLAGS` gets overwritten during the conversion from `Cargo` to `Command`,
    the passed rustc args were being lost. This change combines the rustc args with the values
    that override `RUSTFLAGS`.

    Signed-off-by: onur-ozkan <work@onurozkan.dev>

commit c0ddaef075748674140263840a185082f44458e9
Merge: 3d7e88148a0 b0b7c860e13
Author: bors <bors@rust-lang.org>
Date:   Fri Apr 5 04:34:05 2024 +0000

    Auto merge of #123444 - saethlin:const-eval-inline-cycles, r=tmiasko

    Teach MIR inliner query cycle avoidance about const_eval_select

    Fixes https://github.com/rust-lang/rust/issues/122659

    r? tmiasko

commit 3d7e88148a00c99e444c8f287d73ebe1846bc7aa
Merge: 9cbaa015991 e8b0c305780
Author: bors <bors@rust-lang.org>
Date:   Fri Apr 5 02:32:03 2024 +0000

    Auto merge of #123484 - jhpratt:rollup-usz4e64, r=jhpratt

    Rollup of 9 pull requests

    Successful merges:

     - #123206 (Require Pointee::Metadata to be Freeze)
     - #123363 (change `NormalizesTo` to fully structurally normalize)
     - #123407 (Default to light theme if JS is enabled but not working)
     - #123417 (Add Description for cargo in rustdoc documentation)
     - #123437 (Manually run `clang-format` on `CoverageMappingWrapper.cpp`)
     - #123454 (hir: Use `ItemLocalId::ZERO` in a couple more places)
     - #123464 (Cleanup: Rename `HAS_PROJECTIONS` to `HAS_ALIASES` etc.)
     - #123477 (do not ICE in `fn forced_ambiguity` if we get an error)
     - #123478 (CFI: Add test for `call_once` addr taken)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit e8b0c3057807e50ac1f95fdba36d79b72fbd206d
Merge: e01d3e0824c b53a0f2c9e9
Author: Jacob Pratt <jacob@jhpratt.dev>
Date:   Thu Apr 4 21:16:59 2024 -0400

    Rollup merge of #123478 - maurer:cfi-call-once-addr-taken, r=compiler-errors

    CFI: Add test for `call_once` addr taken

    One of the proposed ways to reduce the non-passed argument erasure would cause this test to fail. Adding this now ensures that any attempt to reduce non-passed argument erasure won't make the same mistake.

    r? `@compiler-errors`

    cc `@rcvalle`

commit e01d3e0824cd24dc02c0b22db2fa0d4677f1a0c3
Merge: 58eb6e58031 9444ca354a5
Author: Jacob Pratt <jacob@jhpratt.dev>
Date:   Thu Apr 4 21:16:58 2024 -0400

    Rollup merge of #123477 - lcnr:forced_ambig-no-ice, r=compiler-errors

    do not ICE in `fn forced_ambiguity` if we get an error

    see the comment. currently causing an ICE in typenum which we've been unable to minimize.

    r? `@compiler-errors`

commit 58eb6e580316b01cfbd68d9d02c98e1e68daf249
Merge: 929e0db6a9a 6f17b7f0aba
Author: Jacob Pratt <jacob@jhpratt.dev>
Date:   Thu Apr 4 21:16:58 2024 -0400

    Rollup merge of #123464 - fmease:rn-has-proj-to-has-aliases, r=compiler-errors

    Cleanup: Rename `HAS_PROJECTIONS` to `HAS_ALIASES` etc.

    The name of the bitflag `HAS_PROJECTIONS` and of its corresponding method `has_projections` is quite historical dating back to a time when projections were the only kind of alias type.

    I think it's time to update it to clear up any potential confusion for newcomers and to reduce unnecessary friction during contributor onboarding.

    r? types

commit 929e0db6a9a31b6079839df5834ee211d191802f
Merge: daef0fd8782 17475de5de1
Author: Jacob Pratt <jacob@jhpratt.dev>
Date:   Thu Apr 4 21:16:57 2024 -0400

    Rollup merge of #123454 - petrochenkov:zeroindex2, r=fmease

    hir: Use `ItemLocalId::ZERO` in a couple more places

    Follow up to https://github.com/rust-lang/rust/pull/123415 and https://github.com/rust-lang/rust/pull/123419.

commit daef0fd87829dc063201828f591c70ac47beffd9
Merge: 50603cbb6d0 f6b97ef5e56
Author: Jacob Pratt <jacob@jhpratt.dev>
Date:   Thu Apr 4 21:16:57 2024 -0400

    Rollup merge of #123437 - Zalathar:clang-format, r=cuviper

    Manually run `clang-format` on `CoverageMappingWrapper.cpp`

    In the current version of #123409, there are several unrelated changes to `CoverageMappingWrapper.cpp` that seem to be the result of running `clang-format` on that file.

    Instead of asking for those changes to be undone, I figure it's easier to just make them myself as a separate PR, since I was vaguely intending to do that at some point anyway.

    In a few cases I've strategically added comments to make the grouping of parameters a little nicer, but mostly it doesn't matter much.

commit 50603cbb6d019789e5838a0ff720102c38a5ee58
Merge: ac298726afb 612acf8397f
Author: Jacob Pratt <jacob@jhpratt.dev>
Date:   Thu Apr 4 21:16:56 2024 -0400

    Rollup merge of #123417 - harryhanYuhao:master, r=GuillaumeGomez

    Add Description for cargo in rustdoc documentation

    As most people use cargo now, I prioritised the description for cargo in rustdoc documentation.

    I also added how to open the generated doc with cargo.

    Btw, may I ask how to use `./x tidy`? It says `warning: `tidy` is not installed;`

commit ac298726afbb2719c966153539b4229da6c8b8b6
Merge: fcb0e9d07a3 a815b97850e
Author: Jacob Pratt <jacob@jhpratt.dev>
Date:   Thu Apr 4 21:16:56 2024 -0400

    Rollup merge of #123407 - GuillaumeGomez:js-failed-theme, r=notriddle

    Default to light theme if JS is enabled but not working

    It doesn't [fix] #123399 but it allows to reduce the problem:

    * if JS is completely disabled, then `noscript.css` will be applied
    * if JS failed for any reason, then the light theme will be applied (because `noscript.css` won't be applied)

    r? `@notriddle`

commit fcb0e9d07a3397731acd20059b8adf47b6863cd6
Merge: de2cb0d76c7 92b280ce81e
Author: Jacob Pratt <jacob@jhpratt.dev>
Date:   Thu Apr 4 21:16:56 2024 -0400

    Rollup merge of #123363 - lcnr:normalizes-to-zero-to-inf, r=BoxyUwU

    change `NormalizesTo` to fully structurally normalize

    notes in https://hackmd.io/wZ016dE4QKGIhrOnHLlThQ

    need to also update the dev-guide once this PR lands. in short, the setup is now as follows:

    `normalizes-to` internally implements one step normalization, applying that normalization to the `goal.predicate.term` causes the projected term to get recursively normalized. With this `normalizes-to` normalizes until the projected term is rigid, meaning that we normalize as many steps necessary, but at least 1.

    To handle rigid aliases, we add another candidate only if the 1 to inf step normalization failed. With this `normalizes-to` is now full structural normalization. We can now change `AliasRelate` to simply emit `normalizes-to` goals for the rhs and lhs.

    This avoids the concerns from https://github.com/rust-lang/trait-system-refactor-initiative/issues/103 and generally feels cleaner

commit de2cb0d76c79720eb641e3ebbacf26907eac69dc
Merge: 385fa9d845d 8f5a28e0aa3
Author: Jacob Pratt <jacob@jhpratt.dev>
Date:   Thu Apr 4 21:16:55 2024 -0400

    Rollup merge of #123206 - stepancheg:pointee-metadata-freeze, r=Amanieu

    Require Pointee::Metadata to be Freeze

    So pointee metadata can be used in anonymous statics.

    This is prerequisite for implementing ThinBox without allocation for ZST.

    See https://github.com/rust-lang/rust/pull/123184#discussion_r1544627488

    r? joboet

commit 9cbaa015991b7ac5f6e1b4d713ab9096573ad30d
Merge: 385fa9d845d 5d66521dfef
Author: bors <bors@rust-lang.org>
Date:   Fri Apr 5 00:30:47 2024 +0000

    Auto merge of #123465 - flip1995:clippy-subtree-update, r=Manishearth

    Clippy subtree update

    r? `@Manishearth`

commit 55e46612c1ccceb30a7a6acf11fd485f34e393e5
Author: Michael Goulet <michael@errs.io>
Date:   Wed Apr 3 12:16:17 2024 -0400

    Force `move` async-closures that are `FnOnce` to make their inner coroutines also `move`

commit 3d9d5d7c96ae3df2cfc47e933ab11ad5fa30f3bc
Author: Michael Goulet <michael@errs.io>
Date:   Mon Apr 1 14:47:12 2024 -0400

    Actually use the inferred ClosureKind from signature inference in coroutine-closures

commit 5d66521dfefe64c0e4f571edcd4408a07505ff48
Author: y21 <30553356+y21@users.noreply.github.com>
Date:   Fri Apr 5 00:17:27 2024 +0200

    use `Lrc` instead of the aliased type `Arc` directly

commit b53a0f2c9e96778a044cb72472aa898f9804471d
Author: Matthew Maurer <mmaurer@google.com>
Date:   Thu Apr 4 22:06:58 2024 +0000

    CFI: Add test for `call_once` addr taken

    One of the proposed ways to reduce the non-passed argument erasure would
    cause this test to fail. Adding this now ensures that any attempt to
    reduce non-passed argument erasure won't make the same mistake.

commit 9444ca354a5ed82ab7c8b264117c9a9436948ce9
Author: lcnr <rust@lcnr.de>
Date:   Thu Apr 4 07:47:13 2024 +0200

    do not ICE in forced ambiguity if we get an error

commit a815b97850e487f5c668edf83357cf871b3db57a
Author: Guillaume Gomez <guillaume.gomez@huawei.com>
Date:   Thu Apr 4 23:49:34 2024 +0200

    Add regression test to ensure that even if JS is enabled but not working, a theme will still get applied

commit f2ff9c903548d88211df90cd4e1673577ff58ad5
Author: Guillaume Gomez <guillaume.gomez@huawei.com>
Date:   Thu Apr 4 23:48:35 2024 +0200

    Update browser-ui-test version to 0.17.1

commit 476156aedf4b4bc74e10d82d59c3a7c4429a8d0e
Author: 许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>
Date:   Thu Apr 4 21:59:08 2024 +0100

    Port issue-7349 to a codegen test

commit 385fa9d845dd326c6bbfd58c22244215e431948a
Merge: a4b11c8e605 0dca1368411
Author: bors <bors@rust-lang.org>
Date:   Thu Apr 4 20:52:52 2024 +0000

    Auto merge of #123097 - oli-obk:perf_experiment, r=petrochenkov

    Try using a `dyn Debug` trait object instead of a closure

    These closures were introduced in https://github.com/rust-lang/rust/pull/93098

    let's see if we can't use fmt::Arguments instead

    cc `@Aaron1011`

commit af81ab762888eb04d01e9ad5269df5202d6a38b8
Author: belovdv <70999565+belovdv@users.noreply.github.com>
Date:   Thu Apr 4 22:40:00 2024 +0300

    remove miri jobserver workaround

commit a809a726671bc81206e2ab9cba59873f6e741212
Author: Philipp Krones <hello@philkrones.com>
Date:   Thu Apr 4 19:53:00 2024 +0200

    Update Cargo.lock

commit eedf15a1dc54097439ecd524e315665f18eaf31c
Merge: 96eaf553e54 9725c4a1625
Author: Philipp Krones <hello@philkrones.com>
Date:   Thu Apr 4 19:52:55 2024 +0200

    Merge commit '9725c4a162502a02c1c67fdca6b797fe09b2b73c' into clippy-subtree-update

commit 9725c4a162502a02c1c67fdca6b797fe09b2b73c
Merge: 5a9e9b0e65d bb023e90d8d
Author: bors <bors@rust-lang.org>
Date:   Thu Apr 4 17:50:22 2024 +0000

    Auto merge of #12632 - flip1995:rustup, r=flip1995

    Rustup

    r? `@ghost`

    changelog: none

commit bb023e90d8dfbdee714aa33cfa44b91753a99a03
Author: Philipp Krones <hello@philkrones.com>
Date:   Thu Apr 4 19:48:53 2024 +0200

    Bump nightly version -> 2024-04-04

commit 277303b210a3501211961d69ad2a09cae0b2643f
Merge: 53e31dc45ce 5a9e9b0e65d
Author: Philipp Krones <hello@philkrones.com>
Date:   Thu Apr 4 19:26:44 2024 +0200

    Merge remote-tracking branch 'upstream/master' into rustup

commit a4b11c8e6057bd47f8d241baafd5ae1e813d62fd
Merge: 0fd571286ef 4e8d2f0040f
Author: bors <bors@rust-lang.org>
Date:   Thu Apr 4 17:42:07 2024 +0000

    Auto merge of #121394 - oli-obk:define_opaque_types, r=compiler-errors

    some smaller DefiningOpaqueTypes::No -> Yes switches

    r? `@compiler-errors`

    These are some easy cases, so let's get them out of the way first.
    I added tests exercising the specialization code paths that I believe weren't tested so far.

    follow-up to https://github.com/rust-lang/rust/pull/117348

commit 6f17b7f0aba4e07f5aa202ecb1e95e0e3d97f828
Author: León Orell Valerian Liehr <me@fmease.dev>
Date:   Thu Apr 4 19:26:17 2024 +0200

    Rename HAS_PROJECTIONS to HAS_ALIASES etc.

commit 4e8d2f0040f108e3f07854b231a5987005217763
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Feb 21 15:50:40 2024 +0000

    Add regression test

commit ede0556ab538ccaa928299812519db95aff9d7ca
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Feb 21 15:36:49 2024 +0000

    Effects are boolean consts and don't contain opaque types

commit 0183d92df0591b25363b3e12ae0a4a8f1b0b076c
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Feb 21 15:33:09 2024 +0000

    Allow defining opaque types when checking const equality bounds

commit 0fd571286ef6df8a6cce06d432013239a8c0665f
Merge: 96eaf553e54 83bd12c70fd
Author: bors <bors@rust-lang.org>
Date:   Thu Apr 4 15:39:00 2024 +0000

    Auto merge of #123377 - oli-obk:private_projection, r=compiler-errors

    Only inspect user-written predicates for privacy concerns

    fixes #123288

    Previously we looked at the elaborated predicates, which, due to adding various bounds on fields, end up requiring trivially true bounds. But these bounds can contain private types, which the privacy visitor then found and errored about.

commit 29fba9f994d5c32448cb6937aaae9b319ddcf392
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Feb 21 15:29:44 2024 +0000

    Add regression test

commit 8e226e092eba650ce0e71d1336519e4045a8ba0e
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Feb 21 14:59:43 2024 +0000

    Add some regression tests for opaque types and const generics

commit ba316a902d4a350f41bfaeba17df66b582de9d99
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Apr 4 14:53:31 2024 +0000

    amend to  Switch `can_eq` and `can_sub` to `DefineOpaqueTypes::Yes`

commit 83bd12c70fd34dece71bcc632ee3df64036ca1d8
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Tue Apr 2 17:27:35 2024 +0000

    Only inspect user-written predicates for privacy concerns

commit 169a045dca0e8cc7c720a962cef274fb5f8fafef
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Feb 21 14:50:17 2024 +0000

    Switch upcast projections to allowing opaque types and add a test showing it works.

    The old solver was already ICEing on this test before this change

commit cdcca7e8f4842fe4a3b64c0e5ac7d25025950889
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Feb 21 14:29:28 2024 +0000

    Switch `can_eq` and `can_sub` to `DefineOpaqueTypes::Yes`

    They are mostly used in diagnostics anyway

commit 612acf8397f0f8d55fc533d61ea835b73a1e696d
Author: Harry Han <s2162783@ed.ac.uk>
Date:   Thu Apr 4 15:04:46 2024 +0100

    rustdoc prioritise cargo doc: suggestions applied

commit 96eaf553e547e36003e235a9de26c11460712231
Merge: ca7d34efa94 4ba3f46be3c
Author: bors <bors@rust-lang.org>
Date:   Thu Apr 4 13:10:22 2024 +0000

    Auto merge of #123455 - matthiaskrgr:rollup-b6nu296, r=matthiaskrgr

    Rollup of 9 pull requests

    Successful merges:

     - #121546 (Error out of layout calculation if a non-last struct field is unsized)
     - #122448 (Port hir-tree run-make test to ui test)
     - #123212 (CFI: Change type transformation to use TypeFolder)
     - #123218 (Add test for getting parent HIR for synthetic HIR node)
     - #123324 (match lowering: make false edges more precise)
     - #123389 (Avoid panicking unnecessarily on startup)
     - #123397 (Fix diagnostic for qualifier in extern block)
     - #123431 (Stabilize `proc_macro_byte_character` and `proc_macro_c_str_literals`)
     - #123439 (coverage: Remove useless constants)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit 4ba3f46be3c28ba5b17c9a7b732b569868ad7d01
Merge: ad300b67386 e08fdb0f2fc
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Apr 4 14:51:18 2024 +0200

    Rollup merge of #123439 - Zalathar:constants, r=oli-obk

    coverage: Remove useless constants

    After #122972 and #123419, these constants don't serve any useful purpose, so get rid of them.

    `@rustbot` label +A-code-coverage

commit ad300b673865d25b76e4d00da58c80df0bcba271
Merge: f254ab08f15 fbc56dfac13
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Apr 4 14:51:18 2024 +0200

    Rollup merge of #123431 - slanterns:literal_byte_character_c_string_stabilize, r=dtolnay

    Stabilize `proc_macro_byte_character` and `proc_macro_c_str_literals`

    This PR stabilizes `proc_macro_byte_character` and `proc_macro_c_str_literals`:

    ```rust
    // proc_macro::Literal

    impl Literal {
        pub fn byte_character(byte: u8) -> Literal;
        pub fn c_string(string: &CStr) -> Literal
    }
    ```

    <br>

    Tracking issue: https://github.com/rust-lang/rust/issues/115268, https://github.com/rust-lang/rust/issues/119750.
    Implementation PR: https://github.com/rust-lang/rust/pull/112711, https://github.com/rust-lang/rust/pull/119651.

    FCPs already completed in their respective tracking issues.

    Closes https://github.com/rust-lang/rust/issues/115268. Closes https://github.com/rust-lang/rust/issues/119750.

    r? libs-api

commit f254ab08f155ae118a71b438fa56d85e9251b0ce
Merge: ee5009e745b 109daa2d4ba
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Apr 4 14:51:17 2024 +0200

    Rollup merge of #123397 - krtab:foreign_fn_qualif_diag, r=petrochenkov

    Fix diagnostic for qualifier in extern block

    Closes: https://github.com/rust-lang/rust/issues/123306

commit ee5009e745b4088f8ef942ab9bcf6f28b7bbac0d
Merge: 504a78e2f24 7b8f93ef4c2
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Apr 4 14:51:17 2024 +0200

    Rollup merge of #123389 - ChrisDenton:dont-panic-on-startup, r=joboet

    Avoid panicking unnecessarily on startup

    On Windows, in `lang_start` we add an exception handler to catch stack overflows and we also reserve some stack space for the handler. Both of these are useful but they're not strictly necessary. The standard library has to work without them (e.g. if Rust is used from a foreign entry point) and the negative effect of not doing them is limited (i.e. you don't get the friendly stack overflow message).

    As we really don't want to panic pre-main unless absolutely necessary, it now won't panic on failure. I've added some debug assertions so as to avoid programmer error.

commit 504a78e2f24a7ce0e11116429c86c0be9553c79c
Merge: 7c2d4eaf922 e2ebaa1a08a
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Apr 4 14:51:16 2024 +0200

    Rollup merge of #123324 - Nadrieril:false-edges2, r=matthewjasper

    match lowering: make false edges more precise

    When lowering match expressions, we add false edges to hide details of the lowering from borrowck. Morally we pretend we're testing the patterns (and guards) one after the other in order. See the tests for examples. Problem is, the way we implement this today is too coarse for deref patterns.

    In deref patterns, a pattern like `deref [1, x]` matches on a `Vec` by creating a temporary to store the output of the call to `deref()` and then uses that to continue matching. Here the pattern has a binding, which we set up after the pre-binding block. Problem is, currently the false edges tell borrowck that the pre-binding block can be reached from a previous arm as well, so the `deref()` temporary may not be initialized. This triggers an error when we try to use the binding `x`.

    We could call `deref()` a second time, but this opens the door to soundness issues if the deref impl is weird. Instead in this PR I rework false edges a little bit.

    What we need from false edges is a (fake) path from each candidate to the next, specifically from candidate C's pre-binding block to next candidate D's pre-binding block. Today, we link the pre-binding blocks directly. In this PR, I link them indirectly by choosing an earlier node on D's success path. Specifically, I choose the earliest block on D's success path that doesn't make a loop (if I chose e.g. the start block of the whole match (which is on the success path of all candidates), that would make a loop). This turns out to be rather straightforward to implement.

    r? `@matthewjasper` if you have the bandwidth, otherwise let me know

commit 7c2d4eaf922664882d3af1041f776019d02f9562
Merge: f03535b2971 f0296029206
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Apr 4 14:51:16 2024 +0200

    Rollup merge of #123218 - compiler-errors:synthetic-hir-parent, r=petrochenkov

    Add test for getting parent HIR for synthetic HIR node

    Fixes #122991, which was actually fixed by #123415

commit f03535b29712441999544e3306582fb41b5c0f4f
Merge: 0b54db7e3fe bc8c3eff6b8
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Apr 4 14:51:15 2024 +0200

    Rollup merge of #123212 - rcvalle:rust-cfi-use-type-folder, r=compiler-errors

    CFI: Change type transformation to use TypeFolder

    Change type transformation to use TypeFolder.

    cc `@compiler-errors` `@maurer`

commit 0b54db7e3feffad43cc55c17ee26104feb24739f
Merge: d5a657c95ca 2575b8e79c8
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Apr 4 14:51:15 2024 +0200

    Rollup merge of #122448 - high-cloud:move-hir-tree, r=oli-obk

    Port hir-tree run-make test to ui test

    As part of #121876

    cc `@jieyouxu`

commit d5a657c95ca2f29c356c278b4e0be43bd8a7743d
Merge: 4c6c6298664 313714331ac
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Apr 4 14:51:14 2024 +0200

    Rollup merge of #121546 - gurry:121473-ice-sizeof-mir-op, r=oli-obk

    Error out of layout calculation if a non-last struct field is unsized

    Fixes #121473
    Fixes #123152

commit 17475de5de1978afbea982ba4efeaa6cea259d4a
Author: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Date:   Thu Apr 4 14:43:49 2024 +0300

    hir: Use `ItemLocalId` in a couple more places

commit 5a9e9b0e65d27bb294a5e13ca554878b43af6224
Merge: 398a52a8dc6 b6486fae5c9
Author: bors <bors@rust-lang.org>
Date:   Thu Apr 4 11:39:45 2024 +0000

    Auto merge of #12628 - franciscoBSalgueiro:fix-book-links, r=flip1995

    Add missing links in the book

    Added a few missing links marked with FIXME in the development book.

    changelog: none

commit 7b8f93ef4c2b01b6cc7656123301f0f5e322b603
Author: Chris Denton <chris@chrisdenton.dev>
Date:   Thu Apr 4 10:48:11 2024 +0000

    Add comments about using debug_assert

commit ca7d34efa94afe271accf2bd3d44152a5bd6fff1
Merge: 4c6c6298664 8289dadfbc5
Author: bors <bors@rust-lang.org>
Date:   Thu Apr 4 10:45:21 2024 +0000

    Auto merge of #121026 - Zalathar:version, r=oli-obk

    coverage: Correctly report and check LLVM's coverage mapping version

    I was puzzled by the fact that the LLVM 18 update (#120055) didn't need to modify this version check, despite the fact that LLVM 18 uses a newer version of the coverage mapping format.

    This turned out to be because we were inappropriately hard-coding a specific version (`Version6`) in the C++ wrapper, instead of using `CovMapVersion::CurrentVersion` to reflect the version actually used by LLVM on our behalf.

    This PR fixes that, and also changes the Rust-side version check to accept the new coverage mapping version used by LLVM 18, since the necessary compatibility work has already been done.

    ---

    ### Quick history of `LLVMRustCoverageMappingVersion`:

    - Originally it returned LLVM's `coverage::CovMapVersion::CurrentVersion`, as intended. The Rust-side code would verify it, and also embed it as the actual coverage version number in the output binary.
    - At some point it was changed to a hard-coded value, to work around a (now-irrelevant) compatibility issue. This was incorrect (but mostly benign), because the override should have been performed on the Rust side instead, after verifying LLVM's value.
    - Later contributors dutifully updated the hard-coded value, because they didn't have enough context to identify the problem.
    - With this PR, it once again returns LLVM's current coverage version number, and the Rust-side code checks it against an expected range. We don't override the result, but we do indicate where that override should occur if it ever becomes necessary.

commit 2575b8e79c881db316af12ad66191a4b1000ff54
Author: Yaodong Yang <highcloud333@outlook.com>
Date:   Thu Mar 14 01:23:43 2024 +0800

    move hir-tree test from run-make to ui test

commit 92b280ce81e2cf9834ed1965ae4e63e80bce0dc1
Author: lcnr <rust@lcnr.de>
Date:   Tue Apr 2 15:12:20 2024 +0200

    normalizes-to change from '1' to '0 to inf' steps

commit 313714331ac3fbc63e767fe95d175f293cf5d875
Author: Gurinder Singh <frederick.the.fool@gmail.com>
Date:   Thu Apr 4 15:50:36 2024 +0530

    Error out of layout calculation if a non-last struct field is unsized

    Fixes an ICE that occurs when a struct with an unsized field
    at a non-last position is const evaluated.

commit 10e8bca7fe00b4b10eca33a8d70ebb06d71cd621
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Feb 21 12:31:41 2024 +0000

    FRU remaining fields does not actually define opaque types

commit 95948b75b2e036f07462c3f7a51d7ced659057a3
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Feb 21 11:44:59 2024 +0000

    Use `DefineOpaqueTypes::Yes` since we are guaranteed to error already

commit 2247aaf276029888fc7c14a372d9033276ec0c86
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Feb 21 11:42:39 2024 +0000

    Use `DefineOpaqueTypes::Yes` where the new solver is unconditionally used already

commit 82ceed2add79244d53a960735a68ce85d55a4232
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Feb 21 11:35:50 2024 +0000

    Specialization can switch to `DefineOpaqueTypes::Yes` without having an effect.

    The reason is that in specialization graph computation we use `DefiningAnchor::Error`, so there's no difference anyway. And in the other use cases, we

    * already errored in the specialization_graph computation, or
    * already errored in coherence, or
    * are comparing opaque types with inference variables already, or
    * there are no opaque types involved

commit b8bd9815455ac3c1bff865dee30aa694ad19beb6
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Feb 21 11:30:57 2024 +0000

    Specialization already rejects defining opaque types

commit 150448d2e043061cfa39f94b0d87e1c80fb6a121
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Feb 21 10:43:50 2024 +0000

    use `DefineOpaqueTypes::Yes` in rustdoc

    Since we have a `DefiningAnchor::Error`, we will reject registering hidden types already

commit b54d72264aebf88e1099004c52aac6e4a06affd8
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Feb 21 10:38:54 2024 +0000

    Use `DefineOpaqueTypes::Yes` in diagnostics code

commit 109daa2d4bafc37b9e86a751b930aa033b7d4b14
Author: Arthur Carcano <arthur.carcano@ocamlpro.com>
Date:   Wed Apr 3 02:43:54 2024 +0200

    Fix diagnostic for qualifier in extern block

    Closes: https://github.com/rust-lang/rust/issues/123306

commit 0dca136841191074e1703ae9eccc8b15aadb643f
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Apr 4 09:46:53 2024 +0000

    Try explicitly outlining the panic machinery

commit 769ab55558488d1ff786fa13e8ba1fb071a9791b
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Tue Apr 2 16:20:04 2024 +0000

    Add regression test

commit 398a52a8dc6aa96f2c942b24715288f4f96b9c31
Merge: e80ca2f3816 0478d26c8b3
Author: bors <bors@rust-lang.org>
Date:   Thu Apr 4 09:16:44 2024 +0000

    Auto merge of #12340 - not-elm:fix/issue-12334, r=llogiq

    FIX(12334): manual_swap auto fix

    Fixed: #12334

    Initialization expressions are now generated as needed if the slice index is bound to a variable.

    ----

    changelog: Fix [`manual_swap`]

commit 4c6c6298664fff9f3549f05ba2b689bcd30b0fc7
Merge: 29fe618f750 82789763c7c
Author: bors <bors@rust-lang.org>
Date:   Thu Apr 4 08:43:53 2024 +0000

    Auto merge of #115538 - lcnr:fn-def-wf, r=compiler-errors

    check `FnDef` return type for WF

    better version of #106807, fixes #84533 (mostly). It's not perfect given that we still ignore WF requirements involving bound regions but I wasn't able to quickly write an example, so even if theoretically exploitable, it should be far harder to trigger.

    This is strictly more restrictive than checking the return type for WF as part of the builtin `FnDef: FnOnce` impl (#106807) and moving to this approach in the future will not break any code.

    ~~It also agrees with my theoretical view of how this should behave~~

    r? types

commit c2e4916cf8b28404f60523f22c096652c172070d
Author: Ralf Jung <post@ralfj.de>
Date:   Tue Apr 2 08:23:38 2024 +0200

    adjust frame_in_std to recognize std tests

commit 9e35555474a40d20ebe8d29da56f2d715af21cdd
Author: Ralf Jung <post@ralfj.de>
Date:   Sat Mar 30 17:22:28 2024 +0100

    smoke-test 'x.py test --miri' on CI

commit ecc714d88ee0781192cfedcd7b717a7c0a9a4f05
Author: Ralf Jung <post@ralfj.de>
Date:   Fri Mar 29 19:18:51 2024 +0100

    fix parsing the test harness JSON when time could not be measured

commit 29fe618f750c5ff7f8fb75871e75280b569b4e67
Merge: 43f4f2a3b1a 473a70de845
Author: bors <bors@rust-lang.org>
Date:   Thu Apr 4 06:40:30 2024 +0000

    Auto merge of #123052 - maurer:addr-taken, r=compiler-errors

    CFI: Support function pointers for trait methods

    Adds support for both CFI and KCFI for function pointers to trait methods by attaching both concrete and abstract types to functions.

    KCFI does this through generation of a `ReifyShim` on any function pointer for a method that could go into a vtable, and keeping this separate from `ReifyShim`s that are *intended* for vtable us by setting a `ReifyReason` on them.

    CFI does this by setting both the concrete and abstract type on every instance.

    This should land after #123024 or a similar PR, as it diverges the implementation of CFI vs KCFI.

    r? `@compiler-errors`

commit d99c775febff75f578437504fed69c9f4df5e92d
Author: lcnr <rust@lcnr.de>
Date:   Tue Apr 2 13:20:03 2024 +0200

    unconstrained `NormalizesTo` term for opaques

commit 43f4f2a3b1a3d3fb3dbbbe4fde33fb97c780ee98
Merge: 0accf4ec4c0 f090de88759
Author: bors <bors@rust-lang.org>
Date:   Thu Apr 4 04:36:12 2024 +0000

    Auto merge of #119820 - lcnr:leak-check-2, r=jackh726

    instantiate higher ranked goals outside of candidate selection

    This PR modifies `evaluate` to more eagerly instantiate higher-ranked goals, preventing the `leak_check` during candidate selection from detecting placeholder errors involving that binder.

    For a general background regarding higher-ranked region solving and the leak check, see https://hackmd.io/qd9Wp03cQVy06yOLnro2Kg.

    > The first is something called the **leak check**. You can think of it as a "quick and dirty" approximation for the region check, which will come later. The leak check detects some kinds of errors early, essentially deciding between "this set of outlives constraints are guaranteed to result in an error eventually" or "this set of outlives constraints may be solvable".

    ## The ideal future

    We would like to end up with the following idealized design to handle universal binders:
    ```rust
    fn enter_forall<'tcx, T, R>(
        forall: Binder<'tcx, T>,
        f: impl FnOnce(T) -> R,
    ) -> R {
        let new_universe = infcx.increment_universe_index();
        let value = instantiate_binder_with_placeholders_in(new_universe, forall);

        let result = f(value);

        eagerly_handle_higher_ranked_region_constraints_in(new_universe);
        infcx.decrement_universe_index();

        assert!(!result.has_placeholders_in_or_above(new_universe));
        result
    }
    ```

    That is, when universally instantiating a binder, anything using the placeholders has to happen inside of a limited scope (the closure `f`). After this closure has completed, all constraints involving placeholders are known.

    We then handle any *external constraints* which name these placeholders. We destructure `TypeOutlives` constraints involving placeholders and eagerly handle any region constraints involving these placeholders. We do not return anything mentioning the placeholders created inside of this function to the caller.

    Being able to eagerly handle *all* region constraints involving placeholders will be difficult due to complex `TypeOutlives` constraints, involving inference variables or alias types, and higher ranked implied bounds. The exact issues and possible solutions are out of scope of this FCP.

    #### How does the leak check fit into this

    The `leak_check` is an underapproximation of `eagerly_handle_higher_ranked_region_constraints_in`. It detects some kinds of errors involving placeholders from `new_universe`, but not all of them.

    It only looks at region outlives constraints, ignoring `TypeOutlives`, and checks whether one of the following two conditions are met for **placeholders in or above `new_universe`**, in which case it results in an error:
    - `'!p1: '!p2` a placeholder `'!p2` outlives a different placeholder `'!p1`
    - `'!p1: '?2` an inference variable `'?2` outlives a placeholder `'!p1` *which it cannot name*

    It does not handle all higher ranked region constraints, so we still return constraints involving placeholders from `new_universe` which are then (re)checked by `lexical_region_resolve` or MIR borrowck.

    As we check higher ranked constraints in the full regionck anyways, the `leak_check` is not soundness critical. It's current only purpose is to move some higher ranked region errors earlier, enabling it to guide type inference and trait solving. Adding additional uses of the `leak_check` in the future would only strengthen inference and is therefore not breaking.

    ## Where do we use currently use the leak check

    The `leak_check` is currently used in two places:

    Coherence does not use a proper regionck, only relying on the `leak_check` called [at the end of the implicit negative overlap check](https://github.com/rust-lang/rust/blob/8b94152af68a0ed6d6af0b5ba57491e40481008e/compiler/rustc_trait_selection/src/traits/coherence.rs#L235-L238). During coherence all parameters are instantiated with inference variables, so the only possible region errors are higher-ranked. We currently also sometimes make guesses when destructuring `TypeOutlives` constraints which can theoretically result in incorrect errors. This could result in overlapping impls.

    We also use the `leak_check` [at the end of `fn evaluation_probe`](https://github.com/rust-lang/rust/blob/8b94152af68a0ed6d6af0b5ba57491e40481008e/compiler/rustc_trait_selection/src/traits/select/mod.rs#L607-L610). This function is used during candidate assembly for `Trait` goals. Most notably we use [inside of `evaluate_candidate` during winnowing](https://github.com/rust-lang/rust/blob/0e4243538b9119654c22dce688f8a63c81864de9/compiler/rustc_trait_selection/src/traits/select/mod.rs#L491-L502). Conceptionally, it is as if we compute each candidate in a separate `enter_forall`.

    ## The current use in `fn evaluation_probe` is undesirable

    Because we only instantiate a higher-ranked goal once inside of `fn evaluation_probe`, errors involving placeholders from that binder can impact selection. This results in inconsistent behavior ([playground](
    *[playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=dac60ebdd517201788899ffa77364831)*)):

    ```rust
    trait Leak<'a> {}
    impl Leak<'_>      for Box<u32> {}
    impl Leak<'static> for Box<u16> {}

    fn impls_leak<T: for<'a> Leak<'a>>() {}

    trait IndirectLeak<'a> {}
    impl<'a, T: Leak<'a>> IndirectLeak<'a> for T {}
    fn impls_indirect_leak<T: for<'a> IndirectLeak<'a>>() {}

    fn main() {
        // ok
        //
        // The `Box<u16>` impls fails the leak check,
        // meaning that we apply the `Box<u32>` impl.
        impls_leak::<Box<_>>();

        // error: type annotations needed
        //
        // While the `Box<u16>` impl would fail the leak check
        // we have already instantiated the binder while applying
        // the generic `IndirectLeak` impl, so during candidate
        // selection of `Leak` we do not detect the placeholder error.
        // Evaluation of `Box<_>: Leak<'!a>` is therefore ambiguous,
        // resulting in `for<'a> Box<_>: Leak<'a>` also being ambiguous.
        impls_indirect_leak::<Box<_>>();
    }
    ```

    We generally prefer `where`-bounds over implementations during candidate selection, both for [trait goals](https://github.com/rust-lang/rust/blob/11f32b73e0dc9287e305b5b9980d24aecdc8c17f/compiler/rustc_trait_selection/src/traits/select/mod.rs#L1863-L1887) and during [normalization](https://github.com/rust-lang/rust/blob/11f32b73e0dc9287e305b5b9980d24aecdc8c17f/compiler/rustc_trait_selection/src/traits/project.rs#L184-L198). However, we currently **do not** use the `leak_check` during candidate assembly in normalizing. This can result in inconsistent behavior:
    ```rust
    trait Trait<'a> {
        type Assoc;
    }
    impl<'a, T> Trait<'a> for T {
        type Assoc = usize;
    }

    fn trait_bound<T: for<'a> Trait<'a>>() {}
    fn projection_bound<T: for<'a> Trait<'a, Assoc = usize>>() {}

    // A function with a trivial where-bound which is more
    // restrictive than the impl.
    fn function<T: Trait<'static, Assoc = usize>>() {
        // ok
        //
        // Proving `for<'a> T: Trait<'a>` using the where-bound results
        // in a leak check failure, so we use the more general impl,
        // causing this to succeed.
        trait_bound::<T>();

        // error
        //
        // Proving the `Projection` goal `for<'a> T: Trait<'a, Assoc = usize>`
        // does not use the leak check when trying the where-bound, causing us
        // to prefer it over the impl, resulting in a placeholder error.
        projection_bound::<T>();

        // error
        //
        // Trying to normalize the type `for<'a> fn(<T as Trait<'a>>::Assoc)`
        // only gets to `<T as Trait<'a>>::Assoc` once `'a` has been already
        // instantiated, causing us to prefer the where-bound over the impl
        // resulting in a placeholder error. Even if were were to also use the
        // leak check during candidate selection for normalization, this
        // case would still not compile.
        let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
    }
    ```

    This is also likely to be more performant. It enables more caching in the new trait solver by simply [recursively calling the canonical query][new solver] after instantiating the higher-ranked goal.

    It is also unclear how to add the leak check to normalization in the new solver. To handle https://github.com/rust-lang/trait-system-refactor-initiative/issues/1 `Projection` goals are implemented via `AliasRelate`. This again means that we instantiate the binder before ever normalizing any alias. Even if we were to avoid this, we lose the ability to [cache normalization by itself, ignoring the expected `term`](https://github.com/rust-lang/rust/blob/5bd5d214effd494f4bafb29b3a7a2f6c2070ca5c/compiler/rustc_trait_selection/src/solve/normalizes_to/mod.rs#L34-L49). We cannot replace the `term` with an inference variable before instantiating the binder, as otherwise `for<'a> T: Trait<Assoc<'a> = &'a ()>` breaks. If we only replace the term after instantiating the binder, we cannot easily evaluate the goal in a separate context, as [we'd then lose the information necessary for the leak check](https://github.com/rust-lang/rust/blob/11f32b73e0dc9287e305b5b9980d24aecdc8c17f/compiler/rustc_next_trait_solver/src/canonicalizer.rs#L230-L232). Adding this information to the canonical input also seems non-trivial.

    ## Proposed solution

    I propose to instantiate the binder outside of candidate assembly, causing placeholders from higher-ranked goals to get ignored while selecting their candidate. This mostly[^1] matches the [current behavior of the new solver][new solver]. The impact of this change is therefore as follows:

    ```rust
    trait Leak<'a> {}
    impl Leak<'_>      for Box<u32> {}
    impl Leak<'static> for Box<u16> {}

    fn impls_leak<T: for<'a> Leak<'a>>() {}

    trait IndirectLeak<'a> {}
    impl<'a, T: Leak<'a>> IndirectLeak<'a> for T {}
    fn impls_indirect_leak<T: for<'a> IndirectLeak<'a>>() {}

    fn guide_selection() {
        // ok -> ambiguous
        impls_leak::<Box<_>>();

        // ambiguous
        impls_indirect_leak::<Box<_>>();
    }

    trait Trait<'a> {
        type Assoc;
    }
    impl<'a, T> Trait<'a> for T {
        type Assoc = usize;
    }

    fn trait_bound<T: for<'a> Trait<'a>>() {}
    fn projection_bound<T: for<'a> Trait<'a, Assoc = usize>>() {}

    // A function which a trivial where-bound which is more
    // restrictive than the impl.
    fn function<T: Trait<'static, Assoc = usize>>() {
        // ok -> error
        trait_bound::<T>();

        // error
        projection_bound::<T>();

        // error
        let _higher_ranked_norm: for<'a> fn(<T as Trait<'a>>::Assoc) = |_| ();
    }
    ```

    This does not change the behavior if candidates have higher ranked nested goals, as in this case the `leak_check` causes the nested goal to result in an error ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a74c25300b23db9022226de99d8a2fa6)):
    ```rust
    trait LeakCheckFailure<'a> {}
    impl LeakCheckFailure<'static> for () {}

    trait Trait<T> {}
    impl Trait<u32> for () where for<'a> (): LeakCheckFailure<'a> {}
    impl Trait<u16> for () {}
    fn impls_trait<T: Trait<U>, U>() {}
    fn main() {
        // ok
        //
        // It does not matter whether candidate assembly
        // considers the placeholders from higher-ranked goal.
        //
        // Either `for<'a> (): LeakCheckFailure<'a>` has no
        // applicable candidate or it has a single applicable candidate
        // when then later results in an error. This allows us to
        // infer `U` to `u16`.
        impls_trait::<(), _>()
    }
    ```

    ## Impact on existing crates

    This is a **breaking change**. [A crater run](https://github.com/rust-lang/rust/pull/119820#issuecomment-1926862174) found 17 regressed crates with 7 root causes.

    For a full analysis of all affected crates, see https://gist.github.com/lcnr/7c1c652f30567048ea240554a36ed95c.

    ---

    I believe this breakage to be acceptable and would merge this change. I am confident that the new position of the leak check matches our idealized future and cannot envision any other consistent alternative. Where possible, I intend to open PRs fixing/avoiding the regressions before landing this PR.

    I originally intended to remove the `coherence_leak_check` lint in the same PR. However, while I am confident in the *position* of the leak check, deciding on its exact behavior is left as future work, cc #112999. This PR therefore only moves the leak check while keeping the lint when relying on it in coherence.

    [new solver]: https://github.com/rust-lang/rust/blob/master/compiler/rustc_trait_selection/src/solve/eval_ctxt/mod.rs#L479-L484

    [^1]: the new solver has a separate cause of inconsistent behavior rn https://github.com/rust-lang/trait-system-refactor-initiative/issues/53#issuecomment-1914310171

    r? `@nikomatsakis`

commit b0b7c860e13858cbc344dcf2baf860752e3a2dd3
Author: Ben Kimock <kimockb@gmail.com>
Date:   Thu Apr 4 00:10:01 2024 -0400

    Teach MIR inliner query cycle avoidance about const_eval_select

commit 0accf4ec4c07d23aa86f6a97aeb8797941abc30e
Merge: b4acbe4233b 4332498a6da
Author: bors <bors@rust-lang.org>
Date:   Thu Apr 4 02:11:23 2024 +0000

    Auto merge of #123440 - jhpratt:rollup-yat6crk, r=jhpratt

    Rollup of 4 pull requests

    Successful merges:

     - #122356 (std::rand: fix dragonflybsd after #121942.)
     - #123093 (Add a nice header to our README.md)
     - #123307 (Fix f16 and f128 feature gating on different editions)
     - #123401 (Check `x86_64` size assertions on `aarch64`, too)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit 82789763c7c5c09c6b0481d18cf00ef67b4b6fa3
Author: Boxy <supbscripter@gmail.com>
Date:   Thu Apr 4 02:14:52 2024 +0100

    rebase

commit 2b67f0104a9fcdb3a6aa41bceb33e62e609e6b6c
Author: lcnr <rust@lcnr.de>
Date:   Mon Sep 4 17:35:51 2023 +0200

    check `FnDef` return type for WF

commit e5376f3947ba8faf0f7c3a9543366060d662357d
Author: Jules Bertholet <julesbertholet@quoi.xyz>
Date:   Wed Apr 3 20:35:02 2024 -0400

    Address final nits

commit 4332498a6daff23e4403d9bce43d97ed63cad382
Merge: 819568a7b41 2d47cd77ac7
Author: Jacob Pratt <jacob@jhpratt.dev>
Date:   Wed Apr 3 20:17:06 2024 -0400

    Rollup merge of #123401 - Zalathar:assert-size-aarch64, r=fmease

    Check `x86_64` size assertions on `aarch64`, too

    (Context: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Checking.20size.20assertions.20on.20aarch64.3F)

    Currently the compiler has around 30 sets of `static_assert_size!` for various size-critical data structures (e.g. various IR nodes), guarded by `#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]`.

    (Presumably this cfg avoids having to maintain separate size values for 32-bit targets and unusual 64-bit targets. Apparently it may have been necessary before the i128/u128 alignment changes, too.)

    This is slightly incovenient for people on aarch64 workstations (e.g. Macs), because the assertions normally aren't checked until we push to a PR. So this PR adds `aarch64` to the `#[cfg(..)]` guarding all of those assertions in the compiler.

    ---

    Implemented with a simple find/replace. Verified by manually inspecting each `static_assert_size!` in `compiler/`, and checking that either the replacement succeeded, or adding aarch64 wouldn't have been appropriate.

commit 819568a7b41cf5b453df675b41569b311216460c
Merge: c8cd010616d 5afe072ead1
Author: Jacob Pratt <jacob@jhpratt.dev>
Date:   Wed Apr 3 20:17:05 2024 -0400

    Rollup merge of #123307 - tgross35:f16-f128-feature-gate-fix, r=petrochenkov

    Fix f16 and f128 feature gating on different editions

    Apply the fix from https://github.com/rust-lang/rust/issues/123282#issuecomment-2035063388 to correctly gates `f16` and `f128` in editions other than 2015

commit c8cd010616d9dfa49864527388e7c065937e94c9
Merge: 875d2547500 ce4cc9df960
Author: Jacob Pratt <jacob@jhpratt.dev>
Date:   Wed Apr 3 20:17:05 2024 -0400

    Rollup merge of #123093 - Urgau:improve-readme, r=workingjubilee

    Add a nice header to our README.md

    This PR improves our README, it is greatly inspired by [esbuild](https://github.com/evanw/esbuild/blob/9d1777f23d9b64c186345223d92f319e59388d8b/README.md) README.

    Context: As was reading https://johnjago.com/great-docs/ I though we could greatly improve ours. So that's what I did.

    It provides direct "quick-access" links to pages in rust-lang.org.

    The "Why Rust?" section is ~~a direct copy/paste of the same~~ modified version of section in [rust-lang.org](https://www.rust-lang.org/).

    | Before | After |
    |--------|-------|
    | ![before](https://github.com/rust-lang/rust/assets/3616612/4afb6753-18a9-4881-919e-2a79328beb5a) | ![after](https://github.com/rust-lang/rust/assets/3616612/408dea7b-5d97-4bb8-a77e-35541ddd50cb) <details> ![after](https://github.com/rust-lang/rust/assets/3616612/76e4a8c6-b61c-46e8-b5ba-4f09c13cfc94) </details> <details> ![after -1](https://github.com/rust-lang/rust/assets/3616612/ed50675c-8301-457c-8b9a-a1199c515fb7) </details> |

    Note: I removed the manual TOC, since GitHub provides it's own at the top right corner and I don't think it's needed anymore.
    Same for the notice about the readme being for users, it's now clear enough and that notice was distracting anyway.

commit 875d2547500f9c588c0537ab12672b4cf844eca4
Merge: 4fd4797c265 6a16638de64
Author: Jacob Pratt <jacob@jhpratt.dev>
Date:   Wed Apr 3 20:17:04 2024 -0400

    Rollup merge of #122356 - devnexen:dfbsd_build_fix, r=jhpratt

    std::rand: fix dragonflybsd after #121942.

commit b4acbe4233b97ec51605c513ce6b215470574f80
Merge: 4fd4797c265 bd8ca780a51
Author: bors <bors@rust-lang.org>
Date:   Thu Apr 4 00:09:02 2024 +0000

    Auto merge of #123240 - compiler-errors:assert-args-compat, r=fmease

    Assert that args are actually compatible with their generics, rather than just their count

    Right now we just check that the number of args is right, rather than actually checking the kinds. Uplift a helper fn that I wrote from trait selection to do just that. Found a couple bugs along the way.

    r? `@lcnr` or `@fmease` (or anyone really lol)

commit e08fdb0f2fcb4cabb430b0512331bb781b4ea653
Author: Zalathar <Zalathar@users.noreply.github.com>
Date:   Thu Apr 4 11:04:32 2024 +1100

    coverage: Remove useless constants

commit f6b97ef5e567f9893cd58b6fd00fee033593bd59
Author: Zalathar <Zalathar@users.noreply.github.com>
Date:   Thu Apr 4 10:55:20 2024 +1100

    Manually run `clang-format` on `CoverageMappingWrapper.cpp`

commit f090de88759ed9abc65074ff9926e03a3d550d77
Author: Boxy <supbscripter@gmail.com>
Date:   Wed Apr 3 22:48:48 2024 +0100

    rebase oddity

commit f029602920638d0f73488e2517ce7547d287a14b
Author: Michael Goulet <michael@errs.io>
Date:   Wed Apr 3 17:41:03 2024 -0400

    Tests for getting parent of synthetic HIR

commit 4fa5fb684e891978303db0b8f100fab1e19eb06d
Author: lcnr <rust@lcnr.de>
Date:   Wed Apr 3 22:27:13 2024 +0100

    move leak check out of candidate evaluation

    this prevents higher ranked goals from guiding selection

commit e2ebaa1a08aff195487cd7afacdaf7fb0ef62aa7
Author: Nadrieril <nadrieril+git@gmail.com>
Date:   Wed Apr 3 21:17:36 2024 +0200

    Add `if let` tests

commit fbc56dfac13ba6fb81bca6439e120a9c554c3a57
Author: Slanterns <slanterns.w@gmail.com>
Date:   Thu Apr 4 05:04:27 2024 +0800

    Stabilize `Literal::c_string`

commit 61ac7812c65601695460a1ab6a4999d35efb66cc
Author: Slanterns <slanterns.w@gmail.com>
Date:   Thu Apr 4 05:00:49 2024 +0800

    Stabilize `Literal::byte_character`

commit 4fd4797c2654977f545c9a91e2aa4e6cdbb38919
Merge: 98efd808e1b 65398c46b82
Author: bors <bors@rust-lang.org>
Date:   Wed Apr 3 20:19:51 2024 +0000

    Auto merge of #123429 - matthiaskrgr:rollup-4emw4e9, r=matthiaskrgr

    Rollup of 8 pull requests

    Successful merges:

     - #121595 (Better reporting on generic argument mismatchs)
     - #122619 (Fix some unsoundness with PassMode::Cast ABI)
     - #122964 (Rename `expose_addr` to `expose_provenance`)
     - #123291 (Move some tests)
     - #123301 (pattern analysis: fix union handling)
     - #123395 (More postfix match fixes)
     - #123419 (rustc_index: Add a `ZERO` constant to index types)
     - #123421 (Fix target name in NetBSD platform-support doc)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit 6728f2fef4286d7060feb7667b5da9ef3f512e34
Merge: b0710dc5f5b 46fc398706d
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Wed Apr 3 22:11:02 2024 +0200

    Rollup merge of #123419 - petrochenkov:zeroindex, r=compiler-errors

    rustc_index: Add a `ZERO` constant to index types

    It is commonly used.

commit 65398c46b8207fb36d85bdab1ff2d68c38f0e3a4
Merge: 25b0e841705 6edb021fd36
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Wed Apr 3 22:11:02 2024 +0200

    Rollup me…
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request May 4, 2024
Pkgsrc changes:
 * Adapt checksums and patches, some have beene intregrated upstream.

Upstream chnages:

Version 1.78.0 (2024-05-02)
===========================

Language
--------
- [Stabilize `#[cfg(target_abi = ...)]`]
  (rust-lang/rust#119590)
- [Stabilize the `#[diagnostic]` namespace and
  `#[diagnostic::on_unimplemented]` attribute]
  (rust-lang/rust#119888)
- [Make async-fn-in-trait implementable with concrete signatures]
  (rust-lang/rust#120103)
- [Make matching on NaN a hard error, and remove the rest of
  `illegal_floating_point_literal_pattern`]
  (rust-lang/rust#116284)
- [static mut: allow mutable reference to arbitrary types, not just
  slices and arrays]
  (rust-lang/rust#117614)
- [Extend `invalid_reference_casting` to include references casting
  to bigger memory layout]
  (rust-lang/rust#118983)
- [Add `non_contiguous_range_endpoints` lint for singleton gaps
  after exclusive ranges]
  (rust-lang/rust#118879)
- [Add `wasm_c_abi` lint for use of older wasm-bindgen versions]
  (rust-lang/rust#117918)
  This lint currently only works when using Cargo.
- [Update `indirect_structural_match` and `pointer_structural_match`
  lints to match RFC]
  (rust-lang/rust#120423)
- [Make non-`PartialEq`-typed consts as patterns a hard error]
  (rust-lang/rust#120805)
- [Split `refining_impl_trait` lint into `_reachable`, `_internal` variants]
  (rust-lang/rust#121720)
- [Remove unnecessary type inference when using associated types
  inside of higher ranked `where`-bounds]
  (rust-lang/rust#119849)
- [Weaken eager detection of cyclic types during type inference]
  (rust-lang/rust#119989)
- [`trait Trait: Auto {}`: allow upcasting from `dyn Trait` to `dyn Auto`]
  (rust-lang/rust#119338)

Compiler
--------

- [Made `INVALID_DOC_ATTRIBUTES` lint deny by default]
  (rust-lang/rust#111505)
- [Increase accuracy of redundant `use` checking]
  (rust-lang/rust#117772)
- [Suggest moving definition if non-found macro_rules! is defined later]
  (rust-lang/rust#121130)
- [Lower transmutes from int to pointer type as gep on null]
  (rust-lang/rust#121282)

Target changes:

- [Windows tier 1 targets now require at least Windows 10]
  (rust-lang/rust#115141)
 - [Enable CMPXCHG16B, SSE3, SAHF/LAHF and 128-bit Atomics in tier 1 Windows]
  (rust-lang/rust#120820)
- [Add `wasm32-wasip1` tier 2 (without host tools) target]
  (rust-lang/rust#120468)
- [Add `wasm32-wasip2` tier 3 target]
  (rust-lang/rust#119616)
- [Rename `wasm32-wasi-preview1-threads` to `wasm32-wasip1-threads`]
  (rust-lang/rust#122170)
- [Add `arm64ec-pc-windows-msvc` tier 3 target]
  (rust-lang/rust#119199)
- [Add `armv8r-none-eabihf` tier 3 target for the Cortex-R52]
  (rust-lang/rust#110482)
- [Add `loongarch64-unknown-linux-musl` tier 3 target]
  (rust-lang/rust#121832)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

Libraries
---------

- [Bump Unicode to version 15.1.0, regenerate tables]
  (rust-lang/rust#120777)
- [Make align_offset, align_to well-behaved in all cases]
  (rust-lang/rust#121201)
- [PartialEq, PartialOrd: document expectations for transitive chains]
  (rust-lang/rust#115386)
- [Optimize away poison guards when std is built with panic=abort]
  (rust-lang/rust#100603)
- [Replace pthread `RwLock` with custom implementation]
  (rust-lang/rust#110211)
- [Implement unwind safety for Condvar on all platforms]
  (rust-lang/rust#121768)
- [Add ASCII fast-path for `char::is_grapheme_extended`]
  (rust-lang/rust#121138)

Stabilized APIs
---------------

- [`impl Read for &Stdin`]
  (https://doc.rust-lang.org/stable/std/io/struct.Stdin.html#impl-Read-for-%26Stdin)
- [Accept non `'static` lifetimes for several `std::error::Error`
  related implementations] (rust-lang/rust#113833)
- [Make `impl<Fd: AsFd>` impl take `?Sized`]
  (rust-lang/rust#114655)
- [`impl From<TryReserveError> for io::Error`]
  (https://doc.rust-lang.org/stable/std/io/struct.Error.html#impl-From%3CTryReserveError%3E-for-Error)

These APIs are now stable in const contexts:

- [`Barrier::new()`]
  (https://doc.rust-lang.org/stable/std/sync/struct.Barrier.html#method.new)

Cargo
-----

- [Stabilize lockfile v4](rust-lang/cargo#12852)
- [Respect `rust-version` when generating lockfile]
  (rust-lang/cargo#12861)
- [Control `--charset` via auto-detecting config value]
  (rust-lang/cargo#13337)
- [Support `target.<triple>.rustdocflags` officially]
  (rust-lang/cargo#13197)
- [Stabilize global cache data tracking]
  (rust-lang/cargo#13492)

Misc
----

- [rustdoc: add `--test-builder-wrapper` arg to support wrappers
  such as RUSTC_WRAPPER when building doctests]
  (rust-lang/rust#114651)

Compatibility Notes
-------------------

- [Many unsafe precondition checks now run for user code with debug
  assertions enabled] (rust-lang/rust#120594)
  This change helps users catch undefined behavior in their code,
  though the details of how much is checked are generally not
  stable.
- [riscv only supports split_debuginfo=off for now]
  (rust-lang/rust#120518)
- [Consistently check bounds on hidden types of `impl Trait`]
  (rust-lang/rust#121679)
- [Change equality of higher ranked types to not rely on subtyping]
  (rust-lang/rust#118247)
- [When called, additionally check bounds on normalized function return type]
  (rust-lang/rust#118882)
- [Expand coverage for `arithmetic_overflow` lint]
  (rust-lang/rust#119432)

Internal Changes
----------------

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

- [Update to LLVM 18](rust-lang/rust#120055)
- [Build `rustc` with 1CGU on `x86_64-pc-windows-msvc`]
  (rust-lang/rust#112267)
- [Build `rustc` with 1CGU on `x86_64-apple-darwin`]
  (rust-lang/rust#112268)
- [Introduce `run-make` V2 infrastructure, a `run_make_support`
  library and port over 2 tests as example]
  (rust-lang/rust#113026)
- [Windows: Implement condvar, mutex and rwlock using futex]
  (rust-lang/rust#121956)
ojeda added a commit to ojeda/linux that referenced this pull request May 5, 2024
This is the next upgrade to the Rust toolchain, from 1.77.1 to 1.78.0
(i.e. the latest) [1].

See the upgrade policy [2] and the comments on the first upgrade in
commit 3ed03f4 ("rust: upgrade to Rust 1.68.2").

It is much smaller than previous upgrades, since the `alloc` fork was
dropped in commit 9d0441b ("rust: alloc: remove our fork of the
`alloc` crate") [3].

# Unstable features

There have been no changes to the set of unstable features used in
our own code. Therefore, the only unstable features allowed to be used
outside the `kernel` crate is still `new_uninit`.

However, since we finally dropped our `alloc` fork [3], all the unstable
features used by `alloc` (~30 language ones, ~60 library ones) are not
a concern anymore. This reduces the maintenance burden, increases the
chances of new compiler versions working without changes and gets us
closer to the goal of supporting several compiler versions.

It also means that, ignoring non-language/library features, we are
currently left with just the few language features needed to implement the
kernel `Arc`, the `new_uninit` library feature, the `compiler_builtins`
marker and the few `no_*` `cfg`s we pass when compiling `core`/`alloc`.

Please see [4] for details.

# Required changes

## LLVM's data layout

Rust 1.77.0 (i.e. the previous upgrade) introduced a check for matching
LLVM data layouts [5]. Then, Rust 1.78.0 upgraded LLVM's bundled major
version from 17 to 18 [6], which changed the data layout in x86 [7]. Thus
update the data layout in our custom target specification for x86 so
that the compiler does not complain about the mismatch:

    error: data-layout for target `target-5559158138856098584`,
    `e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128`,
    differs from LLVM target's `x86_64-linux-gnu` default layout,
    `e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128`

In the future, the goal is to drop the custom target specifications.
Meanwhile, if we want to support other LLVM versions used in `rustc`
(e.g. for LTO), we will need to add some extra logic (e.g. conditional on
LLVM's version, or extracting the data layout from an existing built-in
target specification).

## `unused_imports`

Rust's `unused_imports` lint covers both unused and redundant imports.
Now, in 1.78.0, the lint detects more cases of redundant imports [8].
Thus one of the previous patches cleaned them up.

## Clippy's `new_without_default`

Clippy now suggests to implement `Default` even when `new()` is `const`,
since `Default::default()` may call `const` functions even if it is not
`const` itself [9]. Thus one of the previous patches implemented it.

# Other changes in Rust

Rust 1.78.0 introduced `feature(asm_goto)` [10] [11]. This feature was
discussed in the past [12].

Rust 1.78.0 introduced `feature(const_refs_to_static)` [13] to allow
referencing statics in constants and extended `feature(const_mut_refs)`
to allow raw mutable pointers in constants. Together, this should cover
the kernel's `VTABLE` use case. In fact, the implementation [14] in
upstream Rust added a test case for it [15].

Rust 1.78.0 with debug assertions enabled (i.e. `-Cdebug-assertions=y`,
kernel's `CONFIG_RUST_DEBUG_ASSERTIONS=y`) now always checks all unsafe
preconditions, though without a way to opt-out for particular cases [16].
It would be ideal to have a way to selectively disable certain checks
per-call site for this one (i.e. not just per check but for particular
instances of a check), even if the vast majority of the checks remain
in place [17].

Rust 1.78.0 also improved a couple issues we reported when giving feedback
for the new `--check-cfg` feature [18] [19].

# `alloc` upgrade and reviewing

As mentioned above, compiler upgrades will not update `alloc` anymore,
since we dropped our `alloc` fork [3].

Link: https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1780-2024-05-02 [1]
Link: https://rust-for-linux.com/rust-version-policy [2]
Link: https://lore.kernel.org/rust-for-linux/20240328013603.206764-1-wedsonaf@gmail.com/ [3]
Link: Rust-for-Linux#2 [4]
Link: rust-lang/rust#120062 [5]
Link: rust-lang/rust#120055 [6]
Link: https://reviews.llvm.org/D86310 [7]
Link: rust-lang/rust#117772 [8]
Link: rust-lang/rust-clippy#10903 [9]
Link: rust-lang/rust#119365 [10]
Link: rust-lang/rust#119364 [11]
Link: https://lore.kernel.org/rust-for-linux/ZWipTZysC2YL7qsq@Boquns-Mac-mini.home/ [12]
Link: rust-lang/rust#119618 [13]
Link: rust-lang/rust#120932 [14]
Link: https://github.com/rust-lang/rust/pull/120932/files#diff-e6fc1622c46054cd46b1d225c5386c5554564b3b0fa8a03c2dc2d8627a1079d9 [15]
Link: rust-lang/rust#120969 [16]
Link: Rust-for-Linux#354 [17]
Link: rust-lang/rust#121202 [18]
Link: rust-lang/rust#121237 [19]
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20240401212303.537355-4-ojeda@kernel.org
[ Added a few more details and links I mentioned in the list. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Oct 13, 2024
This is based on the pkgsrc-wip rust180 package, retaining
the main pkgsrc changes as best as I could.

Pkgsrc changes:
 * Adapt checksums and patches.
 * Make this work again on big-endian aarch64 (at least on NetBSD).
 * Make the choice of GCC = 12 work for sparc64 by testing options
   after options.mk is included (which is required...).  Makes this
   work on NetBSD/sparc64 10.0 again.

Upstream chnages:

Version 1.80.1 (2024-08-08)
===========================

- [Fix miscompilation in the jump threading MIR optimization when
  comparing floats]
  (rust-lang/rust#128271)
- [Revert changes to the `dead_code` lint from 1.80.0]
  (rust-lang/rust#128618)

Version 1.80.0 (2024-07-25)
==========================

Language
--------
- [Document maximum allocation size]
  (rust-lang/rust#116675)
- [Allow zero-byte offsets and ZST read/writes on arbitrary pointers]
  (rust-lang/rust#117329)
- [Support C23's variadics without a named parameter]
  (rust-lang/rust#124048)
- [Stabilize `exclusive_range_pattern` feature]
  (rust-lang/rust#124459)
- [Guarantee layout and ABI of `Result` in some scenarios]
  (rust-lang/rust#124870)

Compiler
--------
- [Update cc crate to v1.0.97 allowing additional spectre mitigations
  on MSVC targets]
  (rust-lang/rust#124892)
- [Allow field reordering on types marked `repr(packed(1))`]
  (rust-lang/rust#125360)
- [Add a lint against never type fallback affecting unsafe code]
  (rust-lang/rust#123939)
- [Disallow cast with trailing braced macro in let-else]
  (rust-lang/rust#125049)
- [Expand `for_loops_over_fallibles` lint to lint on fallibles
  behind references.]
  (rust-lang/rust#125156)
- [self-contained linker: retry linking without `-fuse-ld=lld` on
  CCs that don't support it]
  (rust-lang/rust#125417)
- [Do not parse CVarArgs (`...`) as a type in trait bounds]
  (rust-lang/rust#125863)
- Improvements to LLDB formatting [#124458]
  (rust-lang/rust#124458) [#124500]
  (rust-lang/rust#124500)
- [For the wasm32-wasip2 target default to PIC and do not use `-fuse-ld=lld`]
  (rust-lang/rust#124858)
- [Add x86_64-unknown-linux-none as a tier 3 target]
  (rust-lang/rust#125023)
- [Lint on `foo.into_iter()` resolving to `&Box<[T]>: IntoIterator`]
  (rust-lang/rust#124097)

Libraries
---------
- [Add `size_of` and `size_of_val` and `align_of` and `align_of_val`
  to the prelude]
  (rust-lang/rust#123168)
- [Abort a process when FD ownership is violated]
  (rust-lang/rust#124210)
- [io::Write::write_fmt: panic if the formatter fails when the
  stream does not fail]
  (rust-lang/rust#125012)
- [Panic if `PathBuf::set_extension` would add a path separator]
  (rust-lang/rust#125070)
- [Add assert_unsafe_precondition to unchecked_{add,sub,neg,mul,shl,shr}
  methods] (rust-lang/rust#121571)
- [Update `c_char` on AIX to use the correct type]
  (rust-lang/rust#122986)
- [`offset_of!` no longer returns a temporary]
  (rust-lang/rust#124484)
- [Handle sigma in `str.to_lowercase` correctly]
  (rust-lang/rust#124773)
- [Raise `DEFAULT_MIN_STACK_SIZE` to at least 64KiB]
  (rust-lang/rust#126059)

Stabilized APIs
---------------
- [`impl Default for Rc<CStr>`]
  (https://doc.rust-lang.org/beta/alloc/rc/struct.Rc.html#impl-Default-for-Rc%3CCStr%3E)
- [`impl Default for Rc<str>`]
  (https://doc.rust-lang.org/beta/alloc/rc/struct.Rc.html#impl-Default-for-Rc%3Cstr%3E)
- [`impl Default for Rc<[T]>`]
  (https://doc.rust-lang.org/beta/alloc/rc/struct.Rc.html#impl-Default-for-Rc%3C%5BT%5D%3E)
- [`impl Default for Arc<str>`]
  (https://doc.rust-lang.org/beta/alloc/sync/struct.Arc.html#impl-Default-for-Arc%3Cstr%3E)
- [`impl Default for Arc<CStr>`]
  (https://doc.rust-lang.org/beta/alloc/sync/struct.Arc.html#impl-Default-for-Arc%3CCStr%3E)
- [`impl Default for Arc<[T]>`]
  (https://doc.rust-lang.org/beta/alloc/sync/struct.Arc.html#impl-Default-for-Arc%3C%5BT%5D%3E)
- [`impl IntoIterator for Box<[T]>`]
  (https://doc.rust-lang.org/beta/alloc/boxed/struct.Box.html#impl-IntoIterator-for-Box%3C%5BI%5D,+A%3E)
- [`impl FromIterator<String> for Box<str>`]
  (https://doc.rust-lang.org/beta/alloc/boxed/struct.Box.html#impl-FromIterator%3CString%3E-for-Box%3Cstr%3E)
- [`impl FromIterator<char> for Box<str>`]
  (https://doc.rust-lang.org/beta/alloc/boxed/struct.Box.html#impl-FromIterator%3Cchar%3E-for-Box%3Cstr%3E)
- [`LazyCell`]
  (https://doc.rust-lang.org/beta/core/cell/struct.LazyCell.html)
- [`LazyLock`]
  (https://doc.rust-lang.org/beta/std/sync/struct.LazyLock.html)
- [`Duration::div_duration_f32`]
  (https://doc.rust-lang.org/beta/std/time/struct.Duration.html#method.div_duration_f32)
- [`Duration::div_duration_f64`]
  (https://doc.rust-lang.org/beta/std/time/struct.Duration.html#method.div_duration_f64)
- [`Option::take_if`]
  (https://doc.rust-lang.org/beta/std/option/enum.Option.html#method.take_if)
- [`Seek::seek_relative`]
  (https://doc.rust-lang.org/beta/std/io/trait.Seek.html#method.seek_relative)
- [`BinaryHeap::as_slice`]
  (https://doc.rust-lang.org/beta/std/collections/struct.BinaryHeap.html#method.as_slice)
- [`NonNull::offset`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.offset)
- [`NonNull::byte_offset`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_offset)
- [`NonNull::add`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.add)
- [`NonNull::byte_add`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_add)
- [`NonNull::sub`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.sub)
- [`NonNull::byte_sub`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_sub)
- [`NonNull::offset_from`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.offset_from)
- [`NonNull::byte_offset_from`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_offset_from)
- [`NonNull::read`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.read)
- [`NonNull::read_volatile`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.read_volatile)
- [`NonNull::read_unaligned`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.read_unaligned)
- [`NonNull::write`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write)
- [`NonNull::write_volatile`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write_volatile)
- [`NonNull::write_unaligned`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write_unaligned)
- [`NonNull::write_bytes`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write_bytes)
- [`NonNull::copy_to`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_to)
- [`NonNull::copy_to_nonoverlapping`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_to_nonoverlapping)
- [`NonNull::copy_from`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_from)
- [`NonNull::copy_from_nonoverlapping`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_from_nonoverlapping)
- [`NonNull::replace`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.replace)
- [`NonNull::swap`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.swap)
- [`NonNull::drop_in_place`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.drop_in_place)
- [`NonNull::align_offset`]
  (https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.align_offset)
- [`<[T]>::split_at_checked`]
  (https://doc.rust-lang.org/beta/std/primitive.slice.html#method.split_at_checked)
- [`<[T]>::split_at_mut_checked`]
  (https://doc.rust-lang.org/beta/std/primitive.slice.html#method.split_at_mut_checked)
- [`str::split_at_checked`]
  (https://doc.rust-lang.org/beta/std/primitive.str.html#method.split_at_checked)
- [`str::split_at_mut_checked`]
  (https://doc.rust-lang.org/beta/std/primitive.str.html#method.split_at_mut_checked)
- [`str::trim_ascii`]
  (https://doc.rust-lang.org/beta/std/primitive.str.html#method.trim_ascii)
- [`str::trim_ascii_start`]
  (https://doc.rust-lang.org/beta/std/primitive.str.html#method.trim_ascii_start)
- [`str::trim_ascii_end`]
  (https://doc.rust-lang.org/beta/std/primitive.str.html#method.trim_ascii_end)
- [`<[u8]>::trim_ascii`]
  (https://doc.rust-lang.org/beta/core/primitive.slice.html#method.trim_ascii)
- [`<[u8]>::trim_ascii_start`]
  (https://doc.rust-lang.org/beta/core/primitive.slice.html#method.trim_ascii_start)
- [`<[u8]>::trim_ascii_end`]
  (https://doc.rust-lang.org/beta/core/primitive.slice.html#method.trim_ascii_end)
- [`Ipv4Addr::BITS`]
  (https://doc.rust-lang.org/beta/core/net/struct.Ipv4Addr.html#associatedconstant.BITS)
- [`Ipv4Addr::to_bits`]
  (https://doc.rust-lang.org/beta/core/net/struct.Ipv4Addr.html#method.to_bits)
- [`Ipv4Addr::from_bits`]
  (https://doc.rust-lang.org/beta/core/net/struct.Ipv4Addr.html#method.from_bits)
- [`Ipv6Addr::BITS`]
  (https://doc.rust-lang.org/beta/core/net/struct.Ipv6Addr.html#associatedconstant.BITS)
- [`Ipv6Addr::to_bits`]
  (https://doc.rust-lang.org/beta/core/net/struct.Ipv6Addr.html#method.to_bits)
- [`Ipv6Addr::from_bits`]
  (https://doc.rust-lang.org/beta/core/net/struct.Ipv6Addr.html#method.from_bits)
- [`Vec::<[T; N]>::into_flattened`]
  (https://doc.rust-lang.org/beta/alloc/vec/struct.Vec.html#method.into_flattened)
- [`<[[T; N]]>::as_flattened`]
  (https://doc.rust-lang.org/beta/core/primitive.slice.html#method.as_flattened)
- [`<[[T; N]]>::as_flattened_mut`]
  (https://doc.rust-lang.org/beta/core/primitive.slice.html#method.as_flattened_mut)

These APIs are now stable in const contexts:

- [`<[T]>::last_chunk`]
  (https://doc.rust-lang.org/beta/core/primitive.slice.html#method.last_chunk)
- [`BinaryHeap::new`]
  (https://doc.rust-lang.org/beta/std/collections/struct.BinaryHeap.html#method.new)

Cargo
-----

- [Stabilize `-Zcheck-cfg` as always enabled]
  (rust-lang/cargo#13571)
- [Warn, rather than fail publish, if a target is excluded]
  (rust-lang/cargo#13713)
- [Add special `check-cfg` lint config for the `unexpected_cfgs` lint]
  (rust-lang/cargo#13913)
- [Stabilize `cargo update --precise <yanked>`]
  (rust-lang/cargo#13974)
- [Don't change file permissions on `Cargo.toml` when using `cargo add`]
  (rust-lang/cargo#13898)
- [Support using `cargo fix` on IPv6-only networks]
  (rust-lang/cargo#13907)

Rustdoc
-----

- [Allow searching for references]
  (rust-lang/rust#124148)
- [Stabilize `custom_code_classes_in_docs` feature]
  (rust-lang/rust#124577)
- [fix: In cross-crate scenarios show enum variants on type aliases of enums]
  (rust-lang/rust#125300)

Compatibility Notes
-------------------

- [rustfmt estimates line lengths differently when using non-ascii characters]
  (rust-lang/rustfmt#6203)
- [Type aliases are now handled correctly in orphan check]
  (rust-lang/rust#117164)
- [Allow instructing rustdoc to read from stdin via `-`]
  (rust-lang/rust#124611)
- [`std::env::{set_var, remove_var}` can no longer be converted to
  safe function pointers and no longer implement the `Fn` family of
  traits]
  (rust-lang/rust#124636)
- [Warn (or error) when `Self` constructor from outer item is
  referenced in inner nested item]
  (rust-lang/rust#124187)
- [Turn `indirect_structural_match` and `pointer_structural_match`
  lints into hard errors]
  (rust-lang/rust#124661)
- [Make `where_clause_object_safety` lint a regular object safety violation]
  (rust-lang/rust#125380)
- [Turn `proc_macro_back_compat` lint into a hard error.]
  (rust-lang/rust#125596)
- [Detect unused structs even when implementing private traits]
  (rust-lang/rust#122382)
- [`std::sync::ReentrantLockGuard<T>` is no longer `Sync` if `T: !Sync`]
  (rust-lang/rust#125527) which means
  [`std::io::StdoutLock` and `std::io::StderrLock` are no longer
  Sync] (rust-lang/rust#127340)

Internal Changes
----------------

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

- Misc improvements to size of generated html by rustdoc e.g. [#124738]
  (rust-lang/rust#124738) and [#123734]
  (rust-lang/rust#123734)
- [MSVC targets no longer depend on libc]
  (rust-lang/rust#124050)


Version 1.79.0 (2024-06-13)
==========================

Language
--------
- [Stabilize inline `const {}` expressions.]
  (rust-lang/rust#104087)
- [Prevent opaque types being instantiated twice with different
  regions within the same function.]
  (rust-lang/rust#116935)
- [Stabilize WebAssembly target features that are in phase 4 and 5.]
  (rust-lang/rust#117457)
- [Add the `redundant_lifetimes` lint to detect lifetimes which
  are semantically redundant.]
  (rust-lang/rust#118391)
- [Stabilize the `unnameable_types` lint for public types that can't be named.]
  (rust-lang/rust#120144)
- [Enable debuginfo in macros, and stabilize `-C collapse-macro-debuginfo`
  and `#[collapse_debuginfo]`.]
  (rust-lang/rust#120845)
- [Propagate temporary lifetime extension into `if` and `match` expressions.]
  (rust-lang/rust#121346)
- [Restrict promotion of `const fn` calls.]
  (rust-lang/rust#121557)
- [Warn against refining impls of crate-private traits with
  `refining_impl_trait` lint.]
  (rust-lang/rust#121720)
- [Stabilize associated type bounds (RFC 2289).]
  (rust-lang/rust#122055)
- [Stabilize importing `main` from other modules or crates.]
  (rust-lang/rust#122060)
- [Check return types of function types for well-formedness]
  (rust-lang/rust#115538)
- [Rework `impl Trait` lifetime inference]
  (rust-lang/rust#116891)
- [Change inductive trait solver cycles to be ambiguous]
  (rust-lang/rust#122791)

Compiler
--------
- [Define `-C strip` to only affect binaries, not artifacts like `.pdb`.]
  (rust-lang/rust#115120)
- [Stabilize `-Crelro-level` for controlling runtime link hardening.]
  (rust-lang/rust#121694)
- [Stabilize checking of `cfg` names and values at compile-time
  with `--check-cfg`.]
  (rust-lang/rust#123501)
  *Note that this only stabilizes the compiler part, the Cargo part
  is still unstable in this release.*
- [Add `aarch64-apple-visionos` and `aarch64-apple-visionos-sim`
  tier 3 targets.]
  (rust-lang/rust#121419)
- [Add `riscv32ima-unknown-none-elf` tier 3 target.]
  (rust-lang/rust#122696)
- [Promote several Windows targets to tier 2]
  (rust-lang/rust#121712):
  `aarch64-pc-windows-gnullvm`, `i686-pc-windows-gnullvm`, and
  `x86_64-pc-windows-gnullvm`.

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

Libraries
---------

- [Implement `FromIterator` for `(impl Default + Extend, impl
  Default + Extend)`.]
  (rust-lang/rust#107462)
- [Implement `{Div,Rem}Assign<NonZero<X>>` on `X`.]
  (rust-lang/rust#121952)
- [Document overrides of `clone_from()` in core/std.]
  (rust-lang/rust#122201)
- [Link MSVC default lib in core.]
  (rust-lang/rust#122268)
- [Caution against using `transmute` between pointers and integers.]
  (rust-lang/rust#122379)
- [Enable frame pointers for the standard library.]
  (rust-lang/rust#122646)

Stabilized APIs
---------------

- [`{integer}::unchecked_add`]
  (https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_add)
- [`{integer}::unchecked_mul`]
  (https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_mul)
- [`{integer}::unchecked_sub`]
  (https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_sub)
- [`<[T]>::split_at_unchecked`]
  (https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_unchecked)
- [`<[T]>::split_at_mut_unchecked`]
  (https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_mut_unchecked)
- [`<[u8]>::utf8_chunks`]
  (https://doc.rust-lang.org/stable/core/primitive.slice.html#method.utf8_chunks)
- [`str::Utf8Chunks`]
  (https://doc.rust-lang.org/stable/core/str/struct.Utf8Chunks.html)
- [`str::Utf8Chunk`]
  (https://doc.rust-lang.org/stable/core/str/struct.Utf8Chunk.html)
- [`<*const T>::is_aligned`]
  (https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_aligned)
- [`<*mut T>::is_aligned`]
  (https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_aligned-1)
- [`NonNull::is_aligned`]
  (https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.is_aligned)
- [`<*const [T]>::len`]
  (https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.len)
- [`<*mut [T]>::len`]
  (https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.len-1)
- [`<*const [T]>::is_empty`]
  (https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_empty)
- [`<*mut [T]>::is_empty`]
  (https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_empty-1)
- [`NonNull::<[T]>::is_empty`]
  (https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.is_empty)
- [`CStr::count_bytes`]
  (https://doc.rust-lang.org/stable/core/ffi/c_str/struct.CStr.html#method.count_bytes)
- [`io::Error::downcast`]
  (https://doc.rust-lang.org/stable/std/io/struct.Error.html#method.downcast)
- [`num::NonZero<T>`]
  (https://doc.rust-lang.org/stable/core/num/struct.NonZero.html)
- [`path::absolute`]
  (https://doc.rust-lang.org/stable/std/path/fn.absolute.html)
- [`proc_macro::Literal::byte_character`]
  (https://doc.rust-lang.org/stable/proc_macro/struct.Literal.html#method.byte_character)
- [`proc_macro::Literal::c_string`]
  (https://doc.rust-lang.org/stable/proc_macro/struct.Literal.html#method.c_string)

These APIs are now stable in const contexts:

- [`Atomic*::into_inner`]
  (https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicUsize.html#method.into_inner)
- [`io::Cursor::new`]
  (https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.new)
- [`io::Cursor::get_ref`]
  (https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.get_ref)
- [`io::Cursor::position`]
  (https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.position)
- [`io::empty`]
  (https://doc.rust-lang.org/stable/std/io/fn.empty.html)
- [`io::repeat`]
  (https://doc.rust-lang.org/stable/std/io/fn.repeat.html)
- [`io::sink`]
  (https://doc.rust-lang.org/stable/std/io/fn.sink.html)
- [`panic::Location::caller`]
  (https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.caller)
- [`panic::Location::file`]
  (https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.file)
- [`panic::Location::line`]
  (https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.line)
- [`panic::Location::column`]
  (https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.column)

Cargo
-----

- [Prevent dashes in `lib.name`, always normalizing to `_`.]
  (rust-lang/cargo#12783)
- [Stabilize MSRV-aware version requirement selection in `cargo add`.]
  (rust-lang/cargo#13608)
- [Switch to using `gitoxide` by default for listing files.]
  (rust-lang/cargo#13696)

Rustdoc
-----

- [Always display stability version even if it's the same as the
  containing item.]
  (rust-lang/rust#118441)
- [Show a single search result for items with multiple paths.]
  (rust-lang/rust#119912)
- [Support typing `/` in docs to begin a search.]
  (rust-lang/rust#123355)

Misc
----

Compatibility Notes
-------------------

- [Update the minimum external LLVM to 17.]
  (rust-lang/rust#122649)
- [`RustcEncodable` and `RustcDecodable` are soft-destabilized, to
  be removed from the prelude in next edition.]
  (rust-lang/rust#116016)
- [The `wasm_c_abi` future-incompatibility lint will warn about use of the
  non-spec-compliant C ABI.]
  (rust-lang/rust#117918)
  Use `wasm-bindgen v0.2.88` to generate forward-compatible bindings.
- [Check return types of function types for well-formedness]
  (rust-lang/rust#115538)

Version 1.78.0 (2024-05-02)
===========================

Language
--------
- [Stabilize `#[cfg(target_abi = ...)]`]
  (rust-lang/rust#119590)
- [Stabilize the `#[diagnostic]` namespace and
  `#[diagnostic::on_unimplemented]` attribute]
  (rust-lang/rust#119888)
- [Make async-fn-in-trait implementable with concrete signatures]
  (rust-lang/rust#120103)
- [Make matching on NaN a hard error, and remove the rest of
  `illegal_floating_point_literal_pattern`]
  (rust-lang/rust#116284)
- [static mut: allow mutable reference to arbitrary types, not just
  slices and arrays]
  (rust-lang/rust#117614)
- [Extend `invalid_reference_casting` to include references casting
  to bigger memory layout]
  (rust-lang/rust#118983)
- [Add `non_contiguous_range_endpoints` lint for singleton gaps
  after exclusive ranges]
  (rust-lang/rust#118879)
- [Add `wasm_c_abi` lint for use of older wasm-bindgen versions]
  (rust-lang/rust#117918)
  This lint currently only works when using Cargo.
- [Update `indirect_structural_match` and `pointer_structural_match`
  lints to match RFC]
  (rust-lang/rust#120423)
- [Make non-`PartialEq`-typed consts as patterns a hard error]
  (rust-lang/rust#120805)
- [Split `refining_impl_trait` lint into `_reachable`, `_internal` variants]
  (rust-lang/rust#121720)
- [Remove unnecessary type inference when using associated types
  inside of higher ranked `where`-bounds]
  (rust-lang/rust#119849)
- [Weaken eager detection of cyclic types during type inference]
  (rust-lang/rust#119989)
- [`trait Trait: Auto {}`: allow upcasting from `dyn Trait` to `dyn Auto`]
  (rust-lang/rust#119338)

Compiler
--------

- [Made `INVALID_DOC_ATTRIBUTES` lint deny by default]
  (rust-lang/rust#111505)
- [Increase accuracy of redundant `use` checking]
  (rust-lang/rust#117772)
- [Suggest moving definition if non-found macro_rules! is defined later]
  (rust-lang/rust#121130)
- [Lower transmutes from int to pointer type as gep on null]
  (rust-lang/rust#121282)

Target changes:

- [Windows tier 1 targets now require at least Windows 10]
  (rust-lang/rust#115141)
 - [Enable CMPXCHG16B, SSE3, SAHF/LAHF and 128-bit Atomics in tier 1 Windows]
  (rust-lang/rust#120820)
- [Add `wasm32-wasip1` tier 2 (without host tools) target]
  (rust-lang/rust#120468)
- [Add `wasm32-wasip2` tier 3 target]
  (rust-lang/rust#119616)
- [Rename `wasm32-wasi-preview1-threads` to `wasm32-wasip1-threads`]
  (rust-lang/rust#122170)
- [Add `arm64ec-pc-windows-msvc` tier 3 target]
  (rust-lang/rust#119199)
- [Add `armv8r-none-eabihf` tier 3 target for the Cortex-R52]
  (rust-lang/rust#110482)
- [Add `loongarch64-unknown-linux-musl` tier 3 target]
  (rust-lang/rust#121832)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

Libraries
---------

- [Bump Unicode to version 15.1.0, regenerate tables]
  (rust-lang/rust#120777)
- [Make align_offset, align_to well-behaved in all cases]
  (rust-lang/rust#121201)
- [PartialEq, PartialOrd: document expectations for transitive chains]
  (rust-lang/rust#115386)
- [Optimize away poison guards when std is built with panic=abort]
  (rust-lang/rust#100603)
- [Replace pthread `RwLock` with custom implementation]
  (rust-lang/rust#110211)
- [Implement unwind safety for Condvar on all platforms]
  (rust-lang/rust#121768)
- [Add ASCII fast-path for `char::is_grapheme_extended`]
  (rust-lang/rust#121138)

Stabilized APIs
---------------

- [`impl Read for &Stdin`]
  (https://doc.rust-lang.org/stable/std/io/struct.Stdin.html#impl-Read-for-%26Stdin)
- [Accept non `'static` lifetimes for several `std::error::Error`
  related implementations] (rust-lang/rust#113833)
- [Make `impl<Fd: AsFd>` impl take `?Sized`]
  (rust-lang/rust#114655)
- [`impl From<TryReserveError> for io::Error`]
  (https://doc.rust-lang.org/stable/std/io/struct.Error.html#impl-From%3CTryReserveError%3E-for-Error)

These APIs are now stable in const contexts:

- [`Barrier::new()`]
  (https://doc.rust-lang.org/stable/std/sync/struct.Barrier.html#method.new)

Cargo
-----

- [Stabilize lockfile v4](rust-lang/cargo#12852)
- [Respect `rust-version` when generating lockfile]
  (rust-lang/cargo#12861)
- [Control `--charset` via auto-detecting config value]
  (rust-lang/cargo#13337)
- [Support `target.<triple>.rustdocflags` officially]
  (rust-lang/cargo#13197)
- [Stabilize global cache data tracking]
  (rust-lang/cargo#13492)

Misc
----

- [rustdoc: add `--test-builder-wrapper` arg to support wrappers
  such as RUSTC_WRAPPER when building doctests]
  (rust-lang/rust#114651)

Compatibility Notes
-------------------

- [Many unsafe precondition checks now run for user code with debug
  assertions enabled] (rust-lang/rust#120594)
  This change helps users catch undefined behavior in their code,
  though the details of how much is checked are generally not
  stable.
- [riscv only supports split_debuginfo=off for now]
  (rust-lang/rust#120518)
- [Consistently check bounds on hidden types of `impl Trait`]
  (rust-lang/rust#121679)
- [Change equality of higher ranked types to not rely on subtyping]
  (rust-lang/rust#118247)
- [When called, additionally check bounds on normalized function return type]
  (rust-lang/rust#118882)
- [Expand coverage for `arithmetic_overflow` lint]
  (rust-lang/rust#119432)

Internal Changes
----------------

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

- [Update to LLVM 18](rust-lang/rust#120055)
- [Build `rustc` with 1CGU on `x86_64-pc-windows-msvc`]
  (rust-lang/rust#112267)
- [Build `rustc` with 1CGU on `x86_64-apple-darwin`]
  (rust-lang/rust#112268)
- [Introduce `run-make` V2 infrastructure, a `run_make_support`
  library and port over 2 tests as example]
  (rust-lang/rust#113026)
- [Windows: Implement condvar, mutex and rwlock using futex]
  (rust-lang/rust#121956)


Version 1.77.0 (2024-03-21)
==========================

- [Reveal opaque types within the defining body for exhaustiveness checking.]
  (rust-lang/rust#116821)
- [Stabilize C-string literals.]
  (rust-lang/rust#117472)
- [Stabilize THIR unsafeck.]
  (rust-lang/rust#117673)
- [Add lint `static_mut_refs` to warn on references to mutable statics.]
  (rust-lang/rust#117556)
- [Support async recursive calls (as long as they have indirection).]
  (rust-lang/rust#117703)
- [Undeprecate lint `unstable_features` and make use of it in the compiler.]
  (rust-lang/rust#118639)
- [Make inductive cycles in coherence ambiguous always.]
  (rust-lang/rust#118649)
- [Get rid of type-driven traversal in const-eval interning]
  (rust-lang/rust#119044),
  only as a [future compatiblity lint]
  (rust-lang/rust#122204) for now.
- [Deny braced macro invocations in let-else.]
  (rust-lang/rust#119062)

Compiler
--------

- [Include lint `soft_unstable` in future breakage reports.]
  (rust-lang/rust#116274)
- [Make `i128` and `u128` 16-byte aligned on x86-based targets.]
  (rust-lang/rust#116672)
- [Use `--verbose` in diagnostic output.]
  (rust-lang/rust#119129)
- [Improve spacing between printed tokens.]
  (rust-lang/rust#120227)
- [Merge the `unused_tuple_struct_fields` lint into `dead_code`.]
  (rust-lang/rust#118297)
- [Error on incorrect implied bounds in well-formedness check]
  (rust-lang/rust#118553),
  with a temporary exception for Bevy.
- [Fix coverage instrumentation/reports for non-ASCII source code.]
  (rust-lang/rust#119033)
- [Fix `fn`/`const` items implied bounds and well-formedness check.]
  (rust-lang/rust#120019)
- [Promote `riscv32{im|imafc}-unknown-none-elf` targets to tier 2.]
  (rust-lang/rust#118704)
- Add several new tier 3 targets:
  - [`aarch64-unknown-illumos`]
    (rust-lang/rust#112936)
  - [`hexagon-unknown-none-elf`]
    (rust-lang/rust#117601)
  - [`riscv32imafc-esp-espidf`]
    (rust-lang/rust#119738)
  - [`riscv32im-risc0-zkvm-elf`]
    (rust-lang/rust#117958)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

Libraries
---------

- [Implement `From<&[T; N]>` for `Cow<[T]>`.]
  (rust-lang/rust#113489)
- [Remove special-case handling of `vec.split_off
  (0)`.](rust-lang/rust#119917)

Stabilized APIs
---------------

- [`array::each_ref`]
  (https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_ref)
- [`array::each_mut`]
  (https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_mut)
- [`core::net`]
  (https://doc.rust-lang.org/stable/core/net/index.html)
- [`f32::round_ties_even`]
  (https://doc.rust-lang.org/stable/std/primitive.f32.html#method.round_ties_even)
- [`f64::round_ties_even`]
  (https://doc.rust-lang.org/stable/std/primitive.f64.html#method.round_ties_even)
- [`mem::offset_of!`]
  (https://doc.rust-lang.org/stable/std/mem/macro.offset_of.html)
- [`slice::first_chunk`]
  (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.first_chunk)
- [`slice::first_chunk_mut`]
  (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.first_chunk_mut)
- [`slice::split_first_chunk`]
  (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_first_chunk)
- [`slice::split_first_chunk_mut`]
  (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_first_chunk_mut)
- [`slice::last_chunk`]
  (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.last_chunk)
- [`slice::last_chunk_mut`]
  (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.last_chunk_mut)
- [`slice::split_last_chunk`]
  (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_last_chunk)
- [`slice::split_last_chunk_mut`]
  (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_last_chunk_mut)
- [`slice::chunk_by`]
  (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.chunk_by)
- [`slice::chunk_by_mut`]
  (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.chunk_by_mut)
- [`Bound::map`]
  (https://doc.rust-lang.org/stable/std/ops/enum.Bound.html#method.map)
- [`File::create_new`]
  (https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.create_new)
- [`Mutex::clear_poison`]
  (https://doc.rust-lang.org/stable/std/sync/struct.Mutex.html#method.clear_poison)
- [`RwLock::clear_poison`]
  (https://doc.rust-lang.org/stable/std/sync/struct.RwLock.html#method.clear_poison)

Cargo
-----

- [Extend the build directive syntax with `cargo::`.]
  (rust-lang/cargo#12201)
- [Stabilize metadata `id` format as `PackageIDSpec`.]
  (rust-lang/cargo#12914)
- [Pull out as `cargo-util-schemas` as a crate.]
  (rust-lang/cargo#13178)
- [Strip all debuginfo when debuginfo is not requested.]
  (rust-lang/cargo#13257)
- [Inherit jobserver from env for all kinds of runners.]
  (rust-lang/cargo#12776)
- [Deprecate rustc plugin support in cargo.]
  (rust-lang/cargo#13248)

Rustdoc
-----

- [Allows links in markdown headings.]
  (rust-lang/rust#117662)
- [Search for tuples and unit by type with `()`.]
  (rust-lang/rust#118194)
- [Clean up the source sidebar's hide button.]
  (rust-lang/rust#119066)
- [Prevent JS injection from `localStorage`.]
  (rust-lang/rust#120250)

Misc
----

- [Recommend version-sorting for all sorting in style guide.]
  (rust-lang/rust#115046)

Internal Changes
----------------

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

- [Add more weirdness to `weird-exprs.rs`.]
  (rust-lang/rust#119028)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.