Skip to content

Rustc pull update #2381

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

Closed
wants to merge 23 commits into from
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1492fcb
Auto merge of #140732 - onur-ozkan:use-in-tree-rustfmt, r=Kobzol
bors May 8, 2025
ff2b6fd
Mention fast try builds in the rustc-dev-guide
Kobzol May 8, 2025
7403775
Auto merge of #140786 - Kobzol:try-builds-no-deny-warnings, r=jieyouxu
bors May 8, 2025
a4e581a
Rollup merge of #140095 - nnethercote:rm-word_or_empty, r=jdonszelmann
matthiaskrgr May 8, 2025
c494714
Rollup merge of #140341 - saethlin:black-box-qoi, r=Mark-Simulacrum
matthiaskrgr May 8, 2025
ab9644d
Rollup merge of #140684 - compiler-errors:unnecessary-assoc, r=lcnr
matthiaskrgr May 8, 2025
b7f61ea
Auto merge of #140818 - matthiaskrgr:rollup-5eaotr2, r=matthiaskrgr
bors May 8, 2025
52f9761
Auto merge of #140176 - dpaoliello:arm64ecdec, r=wesleywiser
bors May 9, 2025
b82a852
Remove mono item collection strategy override from -Zprint-mono-items
tmiasko May 9, 2025
af315f1
Auto merge of #140705 - LegNeato:backtracelock, r=Mark-Simulacrum
bors May 10, 2025
4fffc99
Auto merge of #140854 - oli-obk:merge-queries, r=nnethercote
bors May 10, 2025
85730ef
Auto merge of #140842 - tmiasko:print-mono-items, r=saethlin
bors May 11, 2025
d5a97f1
Auto merge of #140923 - Zalathar:operand-bundle, r=lcnr
bors May 12, 2025
33ca0c9
Auto merge of #140925 - the8472:test-140207, r=compiler-errors
bors May 12, 2025
5a04183
Fix typos
omahs May 12, 2025
9fa6e47
Auto merge of #140914 - Zalathar:asm-bindings, r=compiler-errors
bors May 12, 2025
bf57a65
Auto merge of #140927 - mejrs:test5, r=jieyouxu
bors May 13, 2025
d8dec87
Auto merge of #140935 - omahs:patch-5, r=jieyouxu
bors May 13, 2025
4464689
Auto merge of #140951 - compiler-errors:super-fmt, r=ytmimi
bors May 13, 2025
9561999
Auto merge of #140887 - pietroalbini:pa-bootstrap-update, r=compiler-…
bors May 13, 2025
f521fd2
Auto merge of #140921 - Berrysoft:update-rustc-lock, r=jieyouxu
bors May 13, 2025
c6d2118
Preparing for merge from rustc
invalid-email-address May 15, 2025
1f919d1
Merge from rustc
invalid-email-address May 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7e552b46af72df390ed233b58a7f51650515b2a8
414482f6a0d4e7290f614300581a0b55442552a3
8 changes: 4 additions & 4 deletions src/rustdoc-internals/rustdoc-test-suite.md
Original file line number Diff line number Diff line change
@@ -16,10 +16,10 @@ In addition to the directives listed here,
`rustdoc` tests also support most
[compiletest directives](../tests/directives.html).

All `PATH`s in directives are relative to the the rustdoc output directory (`build/TARGET/test/rustdoc/TESTNAME`),
All `PATH`s in directives are relative to the rustdoc output directory (`build/TARGET/test/rustdoc/TESTNAME`),
so it is conventional to use a `#![crate_name = "foo"]` attribute to avoid
having to write a long crate name multiple times.
To avoid repetion, `-` can be used in any `PATH` argument to re-use the previous `PATH` argument.
To avoid repetition, `-` can be used in any `PATH` argument to re-use the previous `PATH` argument.

All arguments take the form of quoted strings
(both single and double quotes are supported),
@@ -87,7 +87,7 @@ compiletest's `--bless` flag is forwarded to htmldocck.

Usage: `//@ has-dir PATH`

Checks for the existance of directory `PATH`.
Checks for the existence of directory `PATH`.

### `files`

@@ -106,7 +106,7 @@ Example: `//@ files "foo/bar" '["index.html", "sidebar-items.js"]'`
## Limitations
`htmldocck.py` uses the xpath implementation from the standard library.
This leads to several limitations:
* All `XPATH` arguments must start with `//` due to a flaw in the implemention.
* All `XPATH` arguments must start with `//` due to a flaw in the implementation.
* Many XPath features (functions, axies, etc.) are not supported.
* Only well-formed HTML can be parsed (hopefully rustdoc doesn't output mismatched tags).

16 changes: 10 additions & 6 deletions src/tests/ci.md
Original file line number Diff line number Diff line change
@@ -135,12 +135,16 @@ There are several use-cases for try builds:
- Run a specific CI job (e.g. Windows tests) on a PR, to quickly test if it
passes the test suite executed by that job.

You can select which CI jobs will
be executed in the try build by adding lines containing `try-job:
<job pattern>` to the PR description. All such specified jobs will be executed
in the try build once the `@bors try` command is used on the PR. If no try
jobs are specified in this way, the jobs defined in the `try` section of
[`jobs.yml`] will be executed by default.
By default, if you send a comment with `@bors try`, the jobs defined in the `try` section of
[`jobs.yml`] will be executed. We call this mode a "fast try build". Such a try build
will not execute any tests, and it will allow compilation warnings. It is useful when you want to
get an optimized toolchain as fast as possible, for a crater run or performance benchmarks,
even if it might not be working fully correctly.

If you want to run a custom CI job in a try build and make sure that it passes all tests and does
not produce any compilation warnings, you can select CI jobs to be executed by adding lines
containing `try-job: <job pattern>` to the PR description. All such specified jobs will be executed
in the try build once the `@bors try` command is used on the PR.

Each pattern can either be an exact name of a job or a glob pattern that matches multiple jobs,
for example `*msvc*` or `*-alt`. You can start at most 20 jobs in a single try build. When using
8 changes: 2 additions & 6 deletions src/tests/compiletest.md
Original file line number Diff line number Diff line change
@@ -325,12 +325,8 @@ The tests in [`tests/codegen-units`] test the
[monomorphization](../backend/monomorph.md) collector and CGU partitioning.

These tests work by running `rustc` with a flag to print the result of the
monomorphization collection pass, and then special annotations in the file are
used to compare against that.

Each test should be annotated with the `//@
compile-flags:-Zprint-mono-items=VAL` directive with the appropriate `VAL` to
instruct `rustc` to print the monomorphization information.
monomorphization collection pass, i.e., `-Zprint-mono-items`, and then special
annotations in the file are used to compare against that.

Then, the test should be annotated with comments of the form `//~ MONO_ITEM
name` where `name` is the monomorphized string printed by rustc like `fn <u32 as
2 changes: 1 addition & 1 deletion src/type-checking.md
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ Type "collection" is the process of converting the types found in the HIR
**internal representation** used by the compiler (`Ty<'tcx>`) – we also do
similar conversions for where-clauses and other bits of the function signature.

To try and get a sense for the difference, consider this function:
To try and get a sense of the difference, consider this function:

```rust,ignore
struct Foo { }
2 changes: 1 addition & 1 deletion src/type-inference.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ Here, the type of `things` is *inferred* to be `Vec<&str>` because of the value
we push into `things`.

The type inference is based on the standard Hindley-Milner (HM) type inference
algorithm, but extended in various way to accommodate subtyping, region
algorithm, but extended in various ways to accommodate subtyping, region
inference, and higher-ranked types.

## A note on terminology
8 changes: 4 additions & 4 deletions src/typing_parameter_envs.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

## Typing Environments

When interacting with the type system there are a few variables to consider that can affect the results of trait solving. The the set of in-scope where clauses, and what phase of the compiler type system operations are being performed in (the [`ParamEnv`][penv] and [`TypingMode`][tmode] structs respectively).
When interacting with the type system there are a few variables to consider that can affect the results of trait solving. The set of in-scope where clauses, and what phase of the compiler type system operations are being performed in (the [`ParamEnv`][penv] and [`TypingMode`][tmode] structs respectively).

When an environment to perform type system operations in has not yet been created, the [`TypingEnv`][tenv] can be used to bundle all of the external context required into a single type.

@@ -13,11 +13,11 @@ Once a context to perform type system operations in has been created (e.g. an [`
[ocx]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/traits/struct.ObligationCtxt.html
[fnctxt]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/fn_ctxt/struct.FnCtxt.html

## Parameter Environemnts
## Parameter Environments

### What is a `ParamEnv`

The [`ParamEnv`][penv] is a list of in-scope where-clauses, it typically corresponds to a specific item's where clauses. Some clauses are not explicitly written but are instead are implicitly added in the [`predicates_of`][predicates_of] query, such as `ConstArgHasType` or (some) implied bounds.
The [`ParamEnv`][penv] is a list of in-scope where-clauses, it typically corresponds to a specific item's where clauses. Some clauses are not explicitly written but are instead implicitly added in the [`predicates_of`][predicates_of] query, such as `ConstArgHasType` or (some) implied bounds.

In most cases `ParamEnv`s are initially created via the [`param_env` query][query] which returns a `ParamEnv` derived from the provided item's where clauses. A `ParamEnv` can also be created with arbitrary sets of clauses that are not derived from a specific item, such as in [`compare_method_predicate_entailment`][method_pred_entailment] where we create a hybrid `ParamEnv` consisting of the impl's where clauses and the trait definition's function's where clauses.

@@ -73,7 +73,7 @@ fn foo2<T>(a: T) {

### Acquiring a `ParamEnv`

Using the wrong [`ParamEnv`][penv] when interacting with the type system can lead to ICEs, illformed programs compiling, or erroing when we shouldn't. See [#82159](https://github.com/rust-lang/rust/pull/82159) and [#82067](https://github.com/rust-lang/rust/pull/82067) as examples of PRs that modified the compiler to use the correct param env and in the process fixed ICEs.
Using the wrong [`ParamEnv`][penv] when interacting with the type system can lead to ICEs, illformed programs compiling, or erroring when we shouldn't. See [#82159](https://github.com/rust-lang/rust/pull/82159) and [#82067](https://github.com/rust-lang/rust/pull/82067) as examples of PRs that modified the compiler to use the correct param env and in the process fixed ICEs.

In the large majority of cases, when a `ParamEnv` is required it either already exists somewhere in scope, or above in the call stack and should be passed down. A non exhaustive list of places where you might find an existing `ParamEnv`:
- During typeck `FnCtxt` has a [`param_env` field][fnctxt_param_env]