Skip to content

Commit 90df431

Browse files
authored
Merge pull request #20960 from rust-lang/rustc-pull
minor: Rustc pull update
2 parents bf56027 + 0071969 commit 90df431

Some content is hidden

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

63 files changed

+315
-248
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4fa824bb78318a3cba8c7339d5754b4909922547
1+
b1b464d6f61ec8c4e609c1328106378c066a9729

src/appendix/code-index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Item | Kind | Short description | Chapter |
1212
`rustc_hir::Crate` | struct | A more abstract, compiler-friendly form of a crate's AST | [The Hir] | [compiler/rustc_hir/src/hir.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.Crate.html)
1313
`DefId` | struct | One of four types of HIR node identifiers | [Identifiers in the HIR] | [compiler/rustc_hir/src/def_id.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/def_id/struct.DefId.html)
1414
`Diag` | struct | A struct for a compiler diagnostic, such as an error or lint | [Emitting Diagnostics] | [compiler/rustc_errors/src/diagnostic.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/struct.Diag.html)
15-
`DocContext` | struct | A state container used by rustdoc when crawling through a crate to gather its documentation | [Rustdoc] | [src/librustdoc/core.rs](https://github.com/rust-lang/rust/blob/master/src/librustdoc/core.rs)
15+
`DocContext` | struct | A state container used by rustdoc when crawling through a crate to gather its documentation | [Rustdoc] | [src/librustdoc/core.rs](https://github.com/rust-lang/rust/blob/HEAD/src/librustdoc/core.rs)
1616
`HirId` | struct | One of four types of HIR node identifiers | [Identifiers in the HIR] | [compiler/rustc_hir_id/src/lib.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.HirId.html)
1717
`Lexer` | struct | This is the lexer used during parsing. It consumes characters from the raw source code being compiled and produces a series of tokens for use by the rest of the parser | [The parser] | [compiler/rustc_parse/src/lexer/mod.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/lexer/struct.Lexer.html)
1818
`NodeId` | struct | One of four types of HIR node identifiers. Being phased out | [Identifiers in the HIR] | [compiler/rustc_ast/src/ast.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/node_id/struct.NodeId.html)

src/appendix/humorust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
What's a project without a sense of humor? And frankly some of these are
44
enlightening?
55

6-
- [Weird exprs test](https://github.com/rust-lang/rust/blob/master/tests/ui/expr/weird-exprs.rs)
6+
- [Weird exprs test](https://github.com/rust-lang/rust/blob/HEAD/tests/ui/expr/weird-exprs.rs)
77
- [Ferris Rap](https://fitzgen.com/2018/12/13/rust-raps.html)
88
- [The Genesis of Generic Germination](https://github.com/rust-lang/rust/pull/53645#issue-210543221)
99
- [The Bastion of the Turbofish test](https://github.com/rust-lang/rust/blob/79d8a0fcefa5134db2a94739b1d18daa01fc6e9f/src/test/ui/bastion-of-the-turbofish.rs)

src/attributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Definitions of non-builtin attributes take two forms:
3535
2. AST-based attributes, defined in the standard library. These attributes have special 'stub'
3636
macros defined in places like [`library/core/src/macros/mod.rs`][core_macros].
3737

38-
[core_macros]: https://github.com/rust-lang/rust/blob/master/library/core/src/macros/mod.rs
38+
[core_macros]: https://github.com/rust-lang/rust/blob/HEAD/library/core/src/macros/mod.rs
3939

4040
These definitions exist to allow the macros to participate in typical path-based resolution - they
4141
can be imported, re-exported, and renamed just like any other item definition. However, the body of

src/autodiff/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The actual numbers will depend on your code.
2525

2626
## 2) Check your llvm-ir reproducer
2727

28-
To confirm that your previous step worked, we will use llvm's `opt` tool. find your path to the opt binary, with a path similar to `<some_dir>/rust/build/<x86/arm/...-target-triple>/build/bin/opt`. also find `llvmenzyme-19.<so/dll/dylib>` path, similar to `/rust/build/target-triple/enzyme/build/enzyme/llvmenzyme-19`. Please keep in mind that llvm frequently updates it's llvm backend, so the version number might be higher (20, 21, ...). Once you have both, run the following command:
28+
To confirm that your previous step worked, we will use llvm's `opt` tool. Find your path to the opt binary, with a path similar to `<some_dir>/rust/build/<x86/arm/...-target-triple>/ci-llvm/bin/opt`. If you build LLVM from source, you'll likely need to replace `ci-llvm` with `build`. Also find `llvmenzyme-21.<so/dll/dylib>` path, similar to `/rust/build/target-triple/enzyme/build/enzyme/llvmenzyme-21`. Please keep in mind that llvm frequently updates it's llvm backend, so the version number might be higher (20, 21, ...). Once you have both, run the following command:
2929

3030
```sh
3131
<path/to/opt> out.ll -load-pass-plugin=/path/to/build/<target-triple>/stage1/lib/libEnzyme-21.so -passes="enzyme" -enzyme-strict-aliasing=0 -s

src/autodiff/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ First you need to clone and configure the Rust repository:
88
```bash
99
git clone [email protected]:rust-lang/rust
1010
cd rust
11-
./configure --enable-llvm-link-shared --enable-llvm-plugins --enable-llvm-enzyme --release-channel=nightly --enable-llvm-assertions --enable-clang --enable-lld --enable-option-checking --enable-ninja --disable-docs
11+
./configure --release-channel=nightly --enable-llvm-enzyme --enable-llvm-assertions --enable-option-checking --disable-docs --set llvm.download-ci-llvm=true
1212
```
1313

1414
Afterwards you can build rustc using:
@@ -47,7 +47,7 @@ Then build rustc in a slightly altered way:
4747
```bash
4848
git clone https://github.com/rust-lang/rust
4949
cd rust
50-
./configure --enable-llvm-link-shared --enable-llvm-plugins --enable-llvm-enzyme --release-channel=nightly --enable-llvm-assertions --enable-clang --enable-lld --enable-option-checking --enable-ninja --disable-docs
50+
./configure --release-channel=nightly --enable-llvm-enzyme --enable-llvm-assertions --enable-option-checking --disable-docs --set llvm.download-ci-llvm=true
5151
./x dist
5252
```
5353
We then copy the tarball to our host. The dockerid is the newest entry under `docker ps -a`.
@@ -84,5 +84,5 @@ cd build
8484
cmake .. -G Ninja -DLLVM_DIR=<YourLocalPath>/llvm-project/build/lib/cmake/llvm/ -DLLVM_EXTERNAL_LIT=<YourLocalPath>/llvm-project/llvm/utils/lit/lit.py -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=YES -DBUILD_SHARED_LIBS=ON
8585
ninja
8686
```
87-
This will build Enzyme, and you can find it in `Enzyme/enzyme/build/lib/<LLD/Clang/LLVM>Enzyme.so`. (Endings might differ based on your OS).
87+
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).
8888

src/backend/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ llvm-ir`). `--build-type=debug` emits code for debug builds. There are also
7777
other useful options. Also, debug info in LLVM IR can clutter the output a lot:
7878
`RUSTFLAGS="-C debuginfo=0"` is really useful.
7979

80-
`RUSTFLAGS="-C save-temps"` outputs LLVM bitcode (not the same as IR) at
80+
`RUSTFLAGS="-C save-temps"` outputs LLVM bitcode at
8181
different stages during compilation, which is sometimes useful. The output LLVM
8282
bitcode will be in `.bc` files in the compiler's output directory, set via the
8383
`--out-dir DIR` argument to `rustc`.

src/backend/updating-llvm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ keep in mind while going through them:
224224

225225
[rust-lang/llvm-project repository]: https://github.com/rust-lang/llvm-project
226226
[llvm/llvm-project repository]: https://github.com/llvm/llvm-project
227-
[`llvm-wrapper`]: https://github.com/rust-lang/rust/tree/master/compiler/rustc_llvm/llvm-wrapper
227+
[`llvm-wrapper`]: https://github.com/rust-lang/rust/tree/HEAD/compiler/rustc_llvm/llvm-wrapper
228228
[wg-llvm]: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm
229229
[Dev Desktops]: https://forge.rust-lang.org/infra/docs/dev-desktop.html
230230
[backport process]: https://llvm.org/docs/GitHub.html#backporting-fixes-to-the-release-branches

src/borrow_check/moves_and_initialization/move_paths.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ We don't actually create a move-path for **every** [`Place`] that gets
6767
used. In particular, if it is illegal to move from a [`Place`], then
6868
there is no need for a [`MovePathIndex`]. Some examples:
6969

70-
- You cannot move from a static variable, so we do not create a [`MovePathIndex`]
71-
for static variables.
7270
- You cannot move an individual element of an array, so if we have e.g. `foo: [String; 3]`,
7371
there would be no move-path for `foo[1]`.
7472
- You cannot move from inside of a borrowed reference, so if we have e.g. `foo: &String`,
@@ -82,6 +80,18 @@ initialized (which lowers overhead).
8280

8381
[`move_path_for`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_dataflow/move_paths/builder/struct.MoveDataBuilder.html#method.move_path_for
8482

83+
## Projections
84+
85+
Instead of using [`PlaceElem`], projections in move paths are stored as [`MoveSubPath`]s.
86+
Projections that can't be moved out of and projections that can be skipped are not represented.
87+
88+
Subslice projections of arrays (produced by slice patterns) are special; they're turned into
89+
multiple [`ConstantIndex`] subpaths, one for each element in the subslice.
90+
91+
[`PlaceElem`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/type.PlaceElem.html
92+
[`MoveSubPath`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_dataflow/move_paths/enum.MoveSubPath.html
93+
[`ConstantIndex`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_dataflow/move_paths/enum.MoveSubPath.html#variant.ConstantIndex
94+
8595
## Looking up a move-path
8696

8797
If you have a [`Place`] and you would like to convert it to a [`MovePathIndex`], you

src/borrow_check/region_inference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ For each region we maintain a set storing what elements are present in its value
8181
efficient, we give each kind of element an index, the `RegionElementIndex`, and
8282
use sparse bitsets).
8383

84-
[ri]: https://github.com/rust-lang/rust/tree/master/compiler/rustc_borrowck/src/region_infer
84+
[ri]: https://github.com/rust-lang/rust/tree/HEAD/compiler/rustc_borrowck/src/region_infer
8585

8686
The kinds of region elements are as follows:
8787

0 commit comments

Comments
 (0)