Skip to content

Commit 425962c

Browse files
author
The rustc-josh-sync Cronjob Bot
committed
Merge ref '0e95a0f4c677' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@0e95a0f Filtered ref: rust-lang/compiler-builtins@84dcb0e Upstream diff: rust-lang/rust@db3e99b...0e95a0f This merge was created using https://github.com/rust-lang/josh-sync.
2 parents bf3e3de + 711fc9a commit 425962c

59 files changed

Lines changed: 2035 additions & 1637 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ci/date-check/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ fn main() {
163163
}
164164
}
165165
println!();
166+
167+
println!("@rustbot label +C-date-reference-triage +E-easy +E-help-wanted");
168+
println!();
166169
}
167170
}
168171

ci/sembr/src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct Cli {
1515
/// Modify files that do not comply
1616
overwrite: bool,
1717
/// Applies to lines that are to be split
18-
#[arg(long, default_value_t = 100)]
18+
#[arg(long, default_value_t = 80)]
1919
line_length_limit: usize,
2020
}
2121

@@ -159,6 +159,9 @@ fn lengthen_lines(content: &str, limit: usize) -> String {
159159
if in_html_div {
160160
continue;
161161
}
162+
if line.trim_end().ends_with("<br>") {
163+
continue;
164+
}
162165
if ignore(line, in_code_block) || REGEX_SPLIT.is_match(line) {
163166
continue;
164167
}

examples/rustc-interface-example.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44

55
extern crate rustc_driver;
66
extern crate rustc_error_codes;
7-
extern crate rustc_errors;
87
extern crate rustc_hash;
98
extern crate rustc_hir;
109
extern crate rustc_interface;
1110
extern crate rustc_session;
1211
extern crate rustc_span;
1312

14-
use rustc_errors::registry;
1513
use rustc_hash::FxHashMap;
1614
use rustc_session::config;
1715

@@ -30,12 +28,11 @@ fn main() {
3028
println!("{HELLO}");
3129
}
3230
"#
33-
.into(),
31+
.into(),
3432
},
35-
output_dir: None, // Option<PathBuf>
36-
output_file: None, // Option<PathBuf>
37-
file_loader: None, // Option<Box<dyn FileLoader + Send + Sync>>
38-
locale_resources: rustc_driver::DEFAULT_LOCALE_RESOURCES.to_owned(),
33+
output_dir: None, // Option<PathBuf>
34+
output_file: None, // Option<PathBuf>
35+
file_loader: None, // Option<Box<dyn FileLoader + Send + Sync>>
3936
lint_caps: FxHashMap::default(), // FxHashMap<lint::LintId, lint::Level>
4037
// This is a callback from the driver that is called when [`ParseSess`] is created.
4138
psess_created: None, //Option<Box<dyn FnOnce(&mut ParseSess) + Send>>
@@ -50,8 +47,6 @@ fn main() {
5047
//
5148
// The second parameter is local providers and the third parameter is external providers.
5249
override_queries: None, // Option<fn(&Session, &mut ty::query::Providers<'_>, &mut ty::query::Providers<'_>)>
53-
// Registry of diagnostics codes.
54-
registry: registry::Registry::new(rustc_errors::codes::DIAGNOSTICS),
5550
make_codegen_backend: None,
5651
expanded_args: Vec::new(),
5752
ice_file: None,
@@ -77,4 +72,4 @@ fn main() {
7772
}
7873
});
7974
});
80-
}
75+
}

examples/rustc-interface-getting-diagnostics.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extern crate rustc_span;
1515
use std::sync::{Arc, Mutex};
1616

1717
use rustc_errors::emitter::Emitter;
18-
use rustc_errors::registry::{self, Registry};
18+
use rustc_errors::registry::Registry;
1919
use rustc_errors::translation::Translate;
2020
use rustc_errors::{DiagInner, FluentBundle};
2121
use rustc_session::config;
@@ -59,14 +59,13 @@ fn main() {
5959
let x: &str = 1;
6060
}
6161
"
62-
.into(),
62+
.into(),
6363
},
6464
crate_cfg: Vec::new(),
6565
crate_check_cfg: Vec::new(),
6666
output_dir: None,
6767
output_file: None,
6868
file_loader: None,
69-
locale_resources: rustc_driver::DEFAULT_LOCALE_RESOURCES.to_owned(),
7069
lint_caps: rustc_hash::FxHashMap::default(),
7170
psess_created: Some(Box::new(|parse_sess| {
7271
parse_sess.dcx().set_emitter(Box::new(DebugEmitter {
@@ -76,7 +75,6 @@ fn main() {
7675
})),
7776
register_lints: None,
7877
override_queries: None,
79-
registry: registry::Registry::new(rustc_errors::codes::DIAGNOSTICS),
8078
make_codegen_backend: None,
8179
expanded_args: Vec::new(),
8280
ice_file: None,
@@ -99,4 +97,4 @@ fn main() {
9997
buffer.lock().unwrap().iter().for_each(|diagnostic| {
10098
println!("{diagnostic:#?}");
10199
});
102-
}
100+
}

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
44e34e1ac6d7e69b40856cf1403d3da145319c30
1+
562dee4820c458d823175268e41601d4c060588a

src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
- [`#[test]` implementation](./test-implementation.md)
125125
- [Panic implementation](./panic-implementation.md)
126126
- [AST validation](./ast-validation.md)
127-
- [Feature gate checking](./feature-gate-ck.md)
127+
- [Feature gate checking](./feature-gate-check.md)
128128
- [Lang Items](./lang-items.md)
129129
- [The HIR (High-level IR)](./hir.md)
130130
- [Lowering AST to HIR](./hir/lowering.md)

src/about-this-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ There are several parts to this guide:
1010
about building, debugging, profiling, etc.
1111
1. [Contributing to Rust][p2]:
1212
Contains information that should be useful no matter how you are contributing,
13-
about procedures for contribution, using git and Github, stabilizing features, etc.
13+
about procedures for contribution, using git and GitHub, stabilizing features, etc.
1414
1. [Bootstrapping][p3]:
1515
Describes how the Rust compiler builds itself using previous versions, including
1616
an introduction to the bootstrap process and debugging methods.

src/autodiff/installation.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,50 @@
11
# Installation
22

3-
In the near future, `std::autodiff` should become available in nightly builds for users. As a contributor however, you will still need to build rustc from source. Please be aware that the msvc target is not supported at the moment, all other tier 1 targets should work. Please open an issue if you encounter any problems on a supported tier 1 target, or if you successfully build this project on a tier2/tier3 target.
3+
In the near future, `std::autodiff` should become available for users via rustup. As a rustc/enzyme/autodiff contributor however, you will still need to build rustc from source.
4+
For the meantime, you can download up-to-date builds to enable `std::autodiff` on your latest nightly toolchain, if you are using either of:
5+
**Linux**, with `x86_64-unknown-linux-gnu` or `aarch64-unknown-linux-gnu`
6+
**Windows**, with `x86_64-llvm-mingw` or `aarch64-llvm-mingw`
7+
8+
You can also download slightly outdated builds for **Apple** (aarch64-apple), which should generally work for now.
9+
10+
If you need any other platform, you can build rustc including autodiff from source. Please open an issue if you want to help enabling automatic builds for your prefered target.
11+
12+
## Installation guide
13+
14+
If you want to use `std::autodiff` and don't plan to contribute PR's to the project, then we recommend to just use your existing nightly installation and download the missing component. In the future, rustup will be able to do it for you.
15+
For now, you'll have to manually download and copy it.
16+
17+
1) On our github repository, find the last merged PR: [`Repo`]
18+
2) Scroll down to the lower end of the PR, where you'll find a rust-bors message saying `Test successful` with a `CI` link.
19+
3) Click on the `CI` link, and grep for your target. E.g. `dist-x86_64-linux` or `dist-aarch64-llvm-mingw` and click `Load summary`.
20+
4) Under the `CI artifacts` section, find the `enzyme-nightly` artifact, download, and unpack it.
21+
5) Copy the artifact (libEnzyme-22.so for linux, libEnzyme-22.dylib for apple, etc.), which should be in a folder named `enzyme-preview`, to your rust toolchain directory. E.g. for linux: `cp ~/Downloads/enzyme-nightly-x86_64-unknown-linux-gnu/enzyme-preview/lib/rustlib/x86_64-unknown-linux-gnu/lib/libEnzyme-22.so ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib`
22+
23+
Apple support was temporarily reverted, due to downstream breakages. If you want to download autodiff for apple, please look at the artifacts from this [`run`].
24+
25+
## Installation guide for Nix user.
26+
27+
This setup was recommended by a nix and autodiff user. It uses [`Overlay`]. Please verify for yourself if you are comfortable using that repository.
28+
In that case you might use the following nix configuration to get a rustc that supports `std::autodiff`.
29+
```nix
30+
{
31+
enzymeLib = pkgs.fetchzip {
32+
url = "https://ci-artifacts.rust-lang.org/rustc-builds/ec818fda361ca216eb186f5cf45131bd9c776bb4/enzyme-nightly-x86_64-unknown-linux-gnu.tar.xz";
33+
sha256 = "sha256-Rnrop44vzS+qmYNaRoMNNMFyAc3YsMnwdNGYMXpZ5VY=";
34+
};
35+
36+
rustToolchain = pkgs.symlinkJoin {
37+
name = "rust-with-enzyme";
38+
paths = [pkgs.rust-bin.nightly.latest.default];
39+
nativeBuildInputs = [pkgs.makeWrapper];
40+
postBuild = ''
41+
libdir=$out/lib/rustlib/x86_64-unknown-linux-gnu/lib
42+
cp ${enzymeLib}/enzyme-preview/lib/rustlib/x86_64-unknown-linux-gnu/lib/libEnzyme-22.so $libdir/
43+
wrapProgram $out/bin/rustc --add-flags "--sysroot $out"
44+
'';
45+
};
46+
}
47+
```
448

549
## Build instructions
650

@@ -87,3 +131,6 @@ ninja
87131
```
88132
This will build Enzyme, and you can find it in `Enzyme/enzyme/build/lib/<LLD/Clang/LLVM/lib>Enzyme.so`. (Endings might differ based on your OS).
89133

134+
[`Repo`]: https://github.com/rust-lang/rust/
135+
[`run`]: https://github.com/rust-lang/rust/pull/153026#issuecomment-3950046599
136+
[`Overlay`]: https://github.com/oxalica/rust-overlay

src/backend/updating-llvm.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# Updating LLVM
22

3-
<!-- date-check: Aug 2024 -->
43
Rust supports building against multiple LLVM versions:
54

65
* Tip-of-tree for the current LLVM development branch is usually supported within a few days.
76
PRs for such fixes are tagged with `llvm-main`.
87
* The latest released major version is always supported.
9-
* The one or two preceding major versions are usually supported.
8+
* The one or two preceding major versions are usually supported in the sense that they are expected
9+
to build successfully and pass most tests.
10+
However, fixes for miscompilations often do not get
11+
backported to past LLVM versions, so using rustc with older versions of LLVM comes with an
12+
increased risk of soundness bugs.
13+
We strongly recommend using the latest version of LLVM.
1014

1115
By default, Rust uses its own fork in the [rust-lang/llvm-project repository].
1216
This fork is based on a `release/$N.x` branch of the upstream project, where
@@ -86,7 +90,6 @@ An example PR: [#59089](https://github.com/rust-lang/rust/pull/59089)
8690

8791
## New LLVM Release Updates
8892

89-
<!-- date-check: Jul 2023 -->
9093

9194
Unlike bugfixes,
9295
updating to a new release of LLVM typically requires a lot more work.
@@ -167,12 +170,14 @@ so let's go through each in detail.
167170
You'll change at least
168171
`src/llvm-project` and will likely also change [`llvm-wrapper`] as well.
169172

170-
<!-- date-check: mar 2025 -->
173+
<!-- date-check: March 2026 -->
171174
> For prior art, here are some previous LLVM updates:
172175
> - [LLVM 17](https://github.com/rust-lang/rust/pull/115959)
173176
> - [LLVM 18](https://github.com/rust-lang/rust/pull/120055)
174177
> - [LLVM 19](https://github.com/rust-lang/rust/pull/127513)
175178
> - [LLVM 20](https://github.com/rust-lang/rust/pull/135763)
179+
> - [LLVM 21](https://github.com/rust-lang/rust/pull/143684)
180+
> - [LLVM 22](https://github.com/rust-lang/rust/pull/150722)
176181
177182
Note that sometimes it's easiest to land [`llvm-wrapper`] compatibility as a PR
178183
before actually updating `src/llvm-project`.

0 commit comments

Comments
 (0)