Skip to content

rustc pull #2228

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

Merged
merged 81 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
1cd70aa
rustc-dev-guide: add note about not adding rustc_allowed_through_unst…
RalfJung Jan 14, 2025
52aa7f5
Auto merge of #135224 - wyfo:tls-panic-outline, r=cuviper
bors Jan 21, 2025
eef6733
Auto merge of #135632 - marcoieni:split-x86_64-msvc-2025, r=Kobzol
bors Jan 21, 2025
3543f80
Add test for checking used glibc symbols
Kobzol Jan 6, 2025
aae0e1e
Auto merge of #133830 - compiler-errors:span-key, r=lcnr
bors Jan 21, 2025
e738979
Auto merge of #134299 - RalfJung:remove-start, r=compiler-errors
bors Jan 21, 2025
ad0c0fc
Auto merge of #135674 - scottmcm:assume-better, r=estebank
bors Jan 22, 2025
023a2a4
Auto merge of #135164 - Kobzol:run-make-test-glibc-symbols, r=jieyouxu
bors Jan 23, 2025
3fc111c
Merge from rustc
Jan 23, 2025
ec80adf
Auto merge of #135461 - jieyouxu:migrate-jobserver-errors, r=Noratrieb
bors Jan 23, 2025
676206c
Merge pull request #4145 from rust-lang/rustup-2025-01-23
saethlin Jan 23, 2025
306b695
Auto merge of #135494 - yotamofek:rustdoc-fmt-from_fn, r=fmease
bors Jan 23, 2025
851d9a5
Remove set_make_codegen_backend and set_file_loader
bjorn3 Jan 22, 2025
76f7584
Remove RunCompiler
bjorn3 Jan 22, 2025
0f17594
rustc-dev-guide: document `needs-subprocess` directive
jieyouxu Jan 23, 2025
af6a9b4
Rollup merge of #135073 - joshtriplett:bstr, r=BurntSushi
matthiaskrgr Jan 23, 2025
127ae37
Rollup merge of #135492 - metamuffin:bug-invalid-await-suggest, r=com…
matthiaskrgr Jan 23, 2025
a5ea057
Rollup merge of #135766 - lcnr:candidate-assembly-3, r=compiler-errors
matthiaskrgr Jan 23, 2025
520ca6b
Rollup merge of #135880 - bjorn3:misc_driver_refactors, r=oli-obk
matthiaskrgr Jan 23, 2025
bd1e52d
Rollup merge of #135908 - ken-matsui:remove-asm-to-obj-comment, r=com…
matthiaskrgr Jan 23, 2025
769b478
Rollup merge of #135911 - Zalathar:arena-cache-option, r=compiler-errors
matthiaskrgr Jan 23, 2025
93de058
Rollup merge of #135920 - hkBst:patch-16, r=SparrowLii
matthiaskrgr Jan 23, 2025
9e5bf3f
Rollup merge of #135366 - Urgau:unreach_pub-std-2, r=cuviper
matthiaskrgr Jan 23, 2025
1a805ab
Rollup merge of #135638 - Kobzol:gcc-ci, r=onur-ozkan
matthiaskrgr Jan 23, 2025
b821f71
Rollup merge of #135648 - folkertdev:naked-asm-wasm, r=bjorn3
matthiaskrgr Jan 23, 2025
df71b5d
Rollup merge of #135827 - marcoieni:free-space-script, r=Kobzol
matthiaskrgr Jan 23, 2025
fe02a4d
Rollup merge of #135855 - cuviper:parser-size, r=wesleywiser
matthiaskrgr Jan 23, 2025
2b8bf04
Rollup merge of #135878 - marcoieni:dist-aarch64-linux-8c, r=Kobzol
matthiaskrgr Jan 23, 2025
b72e5e5
Rollup merge of #135905 - workingjubilee:softly-sanitize-aarch64-floa…
matthiaskrgr Jan 23, 2025
aa3bd1a
Auto merge of #135947 - matthiaskrgr:rollup-k9jpfls, r=matthiaskrgr
bors Jan 24, 2025
a3ec96f
Auto merge of #135959 - matthiaskrgr:rollup-0jenyfw, r=matthiaskrgr
bors Jan 24, 2025
d7e8dda
Merge from rustc
Jan 24, 2025
855ad31
Merge pull request #4147 from rust-lang/rustup-2025-01-24
saethlin Jan 24, 2025
ee3e688
Rollup merge of #133605 - traviscross:TC/add-2024-drop-order-tests, r…
matthiaskrgr Jan 24, 2025
7496260
Rollup merge of #135489 - RalfJung:TryFromSliceError, r=tgross35
matthiaskrgr Jan 24, 2025
993f5b5
Rollup merge of #135757 - no1wudi:master, r=compiler-errors
matthiaskrgr Jan 24, 2025
8adc633
Rollup merge of #135799 - aDotInTheVoid:skrrt-skrrt-revrrt, r=Guillau…
matthiaskrgr Jan 24, 2025
1166555
Rollup merge of #135865 - zachs18:maybe_report_similar_assoc_fn_more,…
matthiaskrgr Jan 24, 2025
6e2f3c5
Rollup merge of #135890 - GrigorenkoPV:deque-pop-if, r=thomcc
matthiaskrgr Jan 24, 2025
6f975ce
Rollup merge of #135914 - compiler-errors:vanquish-query-norm, r=jack…
matthiaskrgr Jan 24, 2025
cc38d7d
Rollup merge of #135936 - RalfJung:reify-intrinsic, r=oli-obk
matthiaskrgr Jan 24, 2025
0eb5c8a
Auto merge of #135978 - matthiaskrgr:rollup-ni16gqr, r=matthiaskrgr
bors Jan 24, 2025
80aac13
Document Python formatting and linting in the rustc-dev-guide
Kobzol Jan 23, 2025
fb2f5df
Auto merge of #135272 - BoxyUwU:generic_arg_infer_reliability_2, r=co…
bors Jan 24, 2025
adc5f71
Rollup merge of #135873 - Zalathar:be-prepared, r=oli-obk
matthiaskrgr Jan 24, 2025
2b37fbe
Rollup merge of #135926 - jieyouxu:needs-subprocess-thread, r=oli-obk
matthiaskrgr Jan 24, 2025
3dcb2ad
Rollup merge of #135950 - Kobzol:tidy-python-improvements, r=onur-ozkan
matthiaskrgr Jan 24, 2025
f48c717
Rollup merge of #135956 - GrigorenkoPV:vec_pop_off, r=dtolnay
matthiaskrgr Jan 24, 2025
b582827
Rollup merge of #135966 - mustartt:fix-ppc-abi-test, r=workingjubilee
matthiaskrgr Jan 24, 2025
6bf536d
Rollup merge of #135983 - hkBst:patch-13, r=jhpratt
matthiaskrgr Jan 24, 2025
6442054
Auto merge of #136000 - matthiaskrgr:rollup-j6ge32r, r=matthiaskrgr
bors Jan 24, 2025
b23d6da
Rollup merge of #135415 - Harshit933:hard-link-error, r=ChrisDenton
matthiaskrgr Jan 24, 2025
ace7a22
Rollup merge of #135581 - EnzymeAD:refactor-codgencx, r=oli-obk
matthiaskrgr Jan 24, 2025
ffb466d
Rollup merge of #135728 - hkBst:patch-8, r=joboet
matthiaskrgr Jan 24, 2025
c3b2773
Rollup merge of #135749 - compiler-errors:param-ordering, r=davidtwco
matthiaskrgr Jan 24, 2025
eda1e03
Rollup merge of #135829 - Kobzol:rustc-push, r=jieyouxu
matthiaskrgr Jan 24, 2025
b4188c8
Rollup merge of #135938 - carlsverre:master, r=joboet
matthiaskrgr Jan 24, 2025
951c4ae
Rollup merge of #135949 - estebank:shorten-ty, r=davidtwco
matthiaskrgr Jan 24, 2025
45396b0
Rollup merge of #135976 - WaffleLapkin:tailcall-nodrop, r=oli-obk
matthiaskrgr Jan 24, 2025
f4889aa
Rollup merge of #135998 - GuillaumeGomez:fix-trait-items-mobile-inden…
matthiaskrgr Jan 24, 2025
0a39579
Auto merge of #136030 - matthiaskrgr:rollup-cbue0ng, r=matthiaskrgr
bors Jan 24, 2025
f5d48e9
Auto merge of #136023 - weihanglo:update-cargo, r=weihanglo
bors Jan 25, 2025
cf664f4
Merge from rustc
Jan 25, 2025
ecce576
Auto merge of #128657 - clubby789:optimize-none, r=fee1-dead,WaffleLa…
bors Jan 25, 2025
84b49ff
Merge pull request #4150 from rust-lang/rustup-2025-01-25
saethlin Jan 25, 2025
a15bd2c
Auto merge of #133154 - estebank:issue-133137, r=wesleywiser
bors Jan 25, 2025
1fe9353
Auto merge of #119286 - jyn514:linker-output, r=bjorn3
bors Jan 25, 2025
ab7fd87
Auto merge of #135753 - compiler-errors:from-ty-const, r=oli-obk
bors Jan 26, 2025
5d6f825
Auto merge of #135764 - nikic:llvm-20-test-fixes, r=wesleywiser
bors Jan 26, 2025
a86a368
rustc-dev-guide: update bootstrap tracing docs
jieyouxu Jan 25, 2025
566a82e
Rollup merge of #136079 - RalfJung:compiler-fence-example, r=jhpratt
fmease Jan 27, 2025
9c99bdd
Rollup merge of #136091 - jieyouxu:core-tracing, r=clubby789
fmease Jan 27, 2025
1d56295
Rollup merge of #136097 - yotamofek:check-len-and-index, r=petrochenkov
fmease Jan 27, 2025
4d92ac8
Rollup merge of #136101 - jieyouxu:away, r=jieyouxu
fmease Jan 27, 2025
80a7bad
Auto merge of #136116 - fmease:rollup-c8pk3mj, r=fmease
bors Jan 27, 2025
c031382
Auto merge of #136024 - GuillaumeGomez:cg_gcc-subtree, r=GuillaumeGomez
bors Jan 27, 2025
1b2a8e2
Auto merge of #136098 - jyn514:linker-output, r=saethlin
bors Jan 27, 2025
0dd8c60
Auto merge of #136110 - RalfJung:miri-sync, r=RalfJung
bors Jan 27, 2025
e0f0073
Auto merge of #134290 - tgross35:windows-i128-callconv, r=bjorn3,wesl…
bors Jan 28, 2025
b06461f
Preparing for merge from rustc
BoxyUwU Jan 28, 2025
b98da0d
Merge from rustc
BoxyUwU Jan 28, 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
15 changes: 7 additions & 8 deletions examples/rustc-driver-example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ use std::path::Path;

use rustc_ast_pretty::pprust::item_to_string;
use rustc_data_structures::sync::Lrc;
use rustc_driver::{Compilation, RunCompiler};
use rustc_interface::interface::Compiler;
use rustc_driver::{Compilation, run_compiler};
use rustc_interface::interface::{Compiler, Config};
use rustc_middle::ty::TyCtxt;

struct MyFileLoader;
Expand Down Expand Up @@ -51,6 +51,10 @@ fn main() {
struct MyCallbacks;

impl rustc_driver::Callbacks for MyCallbacks {
fn config(&mut self, config: &mut Config) {
config.file_loader = Some(Box::new(MyFileLoader));
}

fn after_crate_root_parsing(
&mut self,
_compiler: &Compiler,
Expand Down Expand Up @@ -83,10 +87,5 @@ impl rustc_driver::Callbacks for MyCallbacks {
}

fn main() {
match RunCompiler::new(&["main.rs".to_string()], &mut MyCallbacks) {
mut compiler => {
compiler.set_file_loader(Some(Box::new(MyFileLoader)));
compiler.run();
}
}
run_compiler(&["main.rs".to_string()], &mut MyCallbacks);
}
15 changes: 7 additions & 8 deletions examples/rustc-driver-interacting-with-the-ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ use std::path::Path;

use rustc_ast_pretty::pprust::item_to_string;
use rustc_data_structures::sync::Lrc;
use rustc_driver::{Compilation, RunCompiler};
use rustc_interface::interface::Compiler;
use rustc_driver::{Compilation, run_compiler};
use rustc_interface::interface::{Compiler, Config};
use rustc_middle::ty::TyCtxt;

struct MyFileLoader;
Expand Down Expand Up @@ -51,6 +51,10 @@ fn main() {
struct MyCallbacks;

impl rustc_driver::Callbacks for MyCallbacks {
fn config(&mut self, config: &mut Config) {
config.file_loader = Some(Box::new(MyFileLoader));
}

fn after_crate_root_parsing(
&mut self,
_compiler: &Compiler,
Expand Down Expand Up @@ -90,10 +94,5 @@ impl rustc_driver::Callbacks for MyCallbacks {
}

fn main() {
match RunCompiler::new(&["main.rs".to_string()], &mut MyCallbacks) {
mut compiler => {
compiler.set_file_loader(Some(Box::new(MyFileLoader)));
compiler.run();
}
}
run_compiler(&["main.rs".to_string()], &mut MyCallbacks);
}
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ecda83b30f0f68cf5692855dddc0bc38ee8863fc
66d6064f9eb888018775e08f84747ee6f39ba28e
90 changes: 58 additions & 32 deletions src/building/bootstrapping/debugging-bootstrap.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Debugging bootstrap

> FIXME: this page could be expanded
> FIXME: this section should be expanded

## `tracing` in bootstrap

Expand All @@ -10,21 +10,69 @@ Bootstrap has conditional [`tracing`][tracing] setup to provide structured loggi

### Enabling `tracing` output

Bootstrap will conditionally enable `tracing` output if the `BOOTSTRAP_TRACING` env var is set.
Bootstrap will conditionally build `tracing` support and enable `tracing` output if the `BOOTSTRAP_TRACING` env var is set.

Example usage:
#### Basic usage

Example basic usage[^just-trace]:

[^just-trace]: It is not recommend to use *just* `BOOTSTRAP_TRACING=TRACE` because that will dump *everything* at `TRACE` level, including logs intentionally gated behind custom targets as they are too verbose even for `TRACE` level by default.

```bash
$ BOOTSTRAP_TRACING=TRACE ./x build library --stage 1
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x build library --stage 1
```

Example output[^unstable]:

```
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
Building bootstrap
Compiling bootstrap v0.0.0 (/home/joe/repos/rust/src/bootstrap)
Finished `dev` profile [unoptimized] target(s) in 2.74s
DEBUG bootstrap parsing flags
bootstrap::core::config::flags::Flags::parse args=["check", "src/bootstrap/"]
DEBUG bootstrap parsing config based on flags
DEBUG bootstrap creating new build based on config
bootstrap::Build::build
TRACE bootstrap setting up job management
TRACE bootstrap downloading rustfmt early
bootstrap::handling hardcoded subcommands (Format, Suggest, Perf)
DEBUG bootstrap not a hardcoded subcommand; returning to normal handling, cmd=Check { all_targets: false }
DEBUG bootstrap handling subcommand normally
bootstrap::executing real run
bootstrap::(1) executing dry-run sanity-check
bootstrap::(2) executing actual run
Checking stage0 library artifacts (x86_64-unknown-linux-gnu)
Finished `release` profile [optimized + debuginfo] target(s) in 0.04s
Checking stage0 compiler artifacts {rustc-main, rustc_abi, rustc_arena, rustc_ast, rustc_ast_ir, rustc_ast_lowering, rustc_ast_passes, rustc_ast_pretty, rustc_attr_data_structures, rustc_attr_parsing, rustc_baked_icu_data, rustc_borrowck, rustc_builtin_macros, rustc_codegen_llvm, rustc_codegen_ssa, rustc_const_eval, rustc_data_structures, rustc_driver, rustc_driver_impl, rustc_error_codes, rustc_error_messages, rustc_errors, rustc_expand, rustc_feature, rustc_fluent_macro, rustc_fs_util, rustc_graphviz, rustc_hir, rustc_hir_analysis, rustc_hir_pretty, rustc_hir_typeck, rustc_incremental, rustc_index, rustc_index_macros, rustc_infer, rustc_interface, rustc_lexer, rustc_lint, rustc_lint_defs, rustc_llvm, rustc_log, rustc_macros, rustc_metadata, rustc_middle, rustc_mir_build, rustc_mir_dataflow, rustc_mir_transform, rustc_monomorphize, rustc_next_trait_solver, rustc_parse, rustc_parse_format, rustc_passes, rustc_pattern_analysis, rustc_privacy, rustc_query_impl, rustc_query_system, rustc_resolve, rustc_sanitizers, rustc_serialize, rustc_session, rustc_smir, rustc_span, rustc_symbol_mangling, rustc_target, rustc_trait_selection, rustc_traits, rustc_transmute, rustc_ty_utils, rustc_type_ir, rustc_type_ir_macros, stable_mir} (x86_64-unknown-linux-gnu)
Finished `release` profile [optimized + debuginfo] target(s) in 0.23s
Checking stage0 bootstrap artifacts (x86_64-unknown-linux-gnu)
Checking bootstrap v0.0.0 (/home/joe/repos/rust/src/bootstrap)
Finished `release` profile [optimized + debuginfo] target(s) in 0.64s
DEBUG bootstrap checking for postponed test failures from `test --no-fail-fast`
Build completed successfully in 0:00:08
```

Example output[^experimental]:
#### Controlling log output

The env var `BOOTSTRAP_TRACING` accepts a [`tracing` env-filter][tracing-env-filter].

There are two orthogonal ways to control which kind of logs you want:

![Example bootstrap tracing output](./debugging-bootstrap/tracing-output-example.png)
1. You can specify the log **level**, e.g. `DEBUG` or `TRACE`.
2. You can also control the log **target**, e.g. `bootstrap` or `bootstrap::core::config` vs custom targets like `CONFIG_HANDLING`.
- Custom targets are used to limit what is output when `BOOTSTRAP_TRACING=bootstrap=TRACE` is used, as they can be too verbose even for `TRACE` level by default. Currently used custom targets:
- `CONFIG_HANDLING`

[^experimental]: This shows what's *possible* with the infra in an experimental implementation.
The `TRACE` filter will enable *all* `trace` level or less verbose level tracing output.

The env var `BOOTSTRAP_TRACING` accepts a [`tracing` env-filter][tracing-env-filter]. The `TRACE` filter will enable *all* `trace` level or less verbose level tracing output.
You can of course combine them (custom target logs are typically gated behind `TRACE` log level additionally):

```bash
$ BOOTSTRAP_TRACING=CONFIG_HANDLING=TRACE ./x build library --stage 1
```

[^unstable]: This output is always subject to further changes.

[tracing-env-filter]: https://docs.rs/tracing-subscriber/0.3.19/tracing_subscriber/filter/struct.EnvFilter.html

Expand Down Expand Up @@ -73,28 +121,6 @@ For `#[instrument]`, it's recommended to:
- Explicitly pick an instrumentation name via `name = ".."` to distinguish between e.g. `run` of different steps.
- Take care to not cause diverging behavior via tracing, e.g. building extra things only when tracing infra is enabled.

### Enabling `tracing` bootstrap feature in rust-analyzer
### rust-analyzer integration?

You can adjust your `settings.json`'s `rust-analyzer.check.overrideCommand` and `rust-analyzer.cargo.buildScripts.overrideCommand` if you want to also enable `logging` cargo feature by default in your editor. This is mostly useful if you want proper r-a completions and such when working on bootstrap itself.

```json
"rust-analyzer.check.overrideCommand": [
"BOOTSTRAP_TRACING=1", // <- BOOTSTRAP_TRACING=1 won't enable tracing filter, but it will activate bootstrap's `tracing` feature
"python3",
"x.py",
"check",
"--json-output",
"--build-dir=build-rust-analyzer"
],
```

```json
"rust-analyzer.cargo.buildScripts.overrideCommand": [
"BOOTSTRAP_TRACING=1", // <- note this
"python3",
"x.py",
"check",
"--json-output",
"--build-dir=build-rust-analyzer"
],
```
Unfortunately, because bootstrap is a `rust-analyzer.linkedProjects`, you can't ask r-a to check/build bootstrap itself with `tracing` feature enabled to get relevant completions, due to lack of support as described in <https://github.com/rust-lang/rust-analyzer/issues/8521>.
Binary file not shown.
28 changes: 25 additions & 3 deletions src/conventions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This file offers some tips on the coding conventions for rustc. This
This file offers some tips on the coding conventions for rustc. This
chapter covers [formatting](#formatting), [coding for correctness](#cc),
[using crates from crates.io](#cio), and some tips on
[structuring your PR for easy review](#er).
Expand All @@ -25,6 +25,7 @@ pass the <!-- date-check: nov 2022 --> `--edition=2021` argument yourself when c
`rustfmt` directly.

[fmt]: https://github.com/rust-dev-tools/fmt-rfcs

[`rustfmt`]:https://github.com/rust-lang/rustfmt

## Formatting C++ code
Expand All @@ -40,6 +41,26 @@ When modifying that code, use this command to format it:
This uses a pinned version of `clang-format`, to avoid relying on the local
environment.

## Formatting and linting Python code

The Rust repository contains quite a lof of Python code. We try to keep
it both linted and formatted by the [ruff][ruff] tool.

When modifying Python code, use this command to format it:
```sh
./x test tidy --extra-checks=py:fmt --bless
```

and the following command to run lints:
```sh
./x test tidy --extra-checks=py:lint
```

This uses a pinned version of `ruff`, to avoid relying on the local
environment.

[ruff]: https://github.com/astral-sh/ruff

<a id="copyright"></a>

<!-- REUSE-IgnoreStart -->
Expand Down Expand Up @@ -84,7 +105,7 @@ Using `_` in a match is convenient, but it means that when new
variants are added to the enum, they may not get handled correctly.
Ask yourself: if a new variant were added to this enum, what's the
chance that it would want to use the `_` code, versus having some
other treatment? Unless the answer is "low", then prefer an
other treatment? Unless the answer is "low", then prefer an
exhaustive match. (The same advice applies to `if let` and `while
let`, which are effectively tests for a single variant.)

Expand Down Expand Up @@ -124,7 +145,7 @@ See the [crates.io dependencies][crates] section.
# How to structure your PR

How you prepare the commits in your PR can make a big difference for the
reviewer. Here are some tips.
reviewer. Here are some tips.

**Isolate "pure refactorings" into their own commit.** For example, if
you rename a method, then put that rename into its own commit, along
Expand Down Expand Up @@ -165,4 +186,5 @@ to the compiler.
crate-related, often the spelling is changed to `krate`.

[tcx]: ./ty.md

[crates]: ./crates-io.md
4 changes: 2 additions & 2 deletions src/rustc-driver/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The [`rustc_driver`] is essentially `rustc`'s `main` function.
It acts as the glue for running the various phases of the compiler in the correct order,
using the interface defined in the [`rustc_interface`] crate. Where possible, using [`rustc_driver`] rather than [`rustc_interface`] is recommended.

The main entry point of [`rustc_driver`] is [`rustc_driver::RunCompiler`][rd_rc].
The main entry point of [`rustc_driver`] is [`rustc_driver::run_compiler`][rd_rc].
This builder accepts the same command-line args as rustc as well as an implementation of [`Callbacks`][cb] and a couple of other optional options.
[`Callbacks`][cb] is a `trait` that allows for custom compiler configuration,
as well as allowing custom code to run after different phases of the compilation.
Expand Down Expand Up @@ -40,7 +40,7 @@ specifically [`rustc_driver_impl::run_compiler`][rdi_rc]
[cb]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/trait.Callbacks.html
[example]: https://github.com/rust-lang/rustc-dev-guide/blob/master/examples/rustc-interface-example.rs
[i_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/interface/fn.run_compiler.html
[rd_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/struct.RunCompiler.html
[rd_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/fn.run_compiler.html
[rdi_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver_impl/fn.run_compiler.html
[stupid-stats]: https://github.com/nrc/stupid-stats
[`nightly-rustc`]: https://doc.rust-lang.org/nightly/nightly-rustc/
3 changes: 2 additions & 1 deletion src/stability.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ Previously, due to a [rustc bug], stable items inside unstable modules were
available to stable code in that location.
As of <!-- date-check --> September 2024, items with [accidentally stabilized
paths] are marked with the `#[rustc_allowed_through_unstable_modules]` attribute
to prevent code dependent on those paths from breaking.
to prevent code dependent on those paths from breaking. Do *not* add this attribute
to any more items unless that is needed to avoid breaking changes.

The `unstable` attribute may also have the `soft` value, which makes it a
future-incompatible deny-by-default lint instead of a hard error. This is used
Expand Down
5 changes: 4 additions & 1 deletion src/tests/directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ for more details.
| Directive | Explanation | Supported test suites | Possible values |
|-----------------------------------|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|-----------------------------------------------------------------------------------------|
| `check-run-results` | Check run test binary `run-{pass,fail}` output snapshot | `ui`, `crashes`, `incremental` if `run-pass` | N/A |
| `error-pattern` | Check that output contains a specific string | `ui`, `crashes`, `incremental` if `run-pass` | String |
| `error-pattern` | Check that output contains a specific string | `ui`, `crashes`, `incremental` if `run-pass` | String |
| `regex-error-pattern` | Check that output contains a regex pattern | `ui`, `crashes`, `incremental` if `run-pass` | Regex |
| `check-stdout` | Check `stdout` against `error-pattern`s from running test binary[^check_stdout] | `ui`, `crashes`, `incremental` | N/A |
| `normalize-stderr-32bit` | Normalize actual stderr (for 32-bit platforms) with a rule `"<raw>" -> "<normalized>"` before comparing against snapshot | `ui`, `incremental` | `"<RAW>" -> "<NORMALIZED>"`, `<RAW>`/`<NORMALIZED>` is regex capture and replace syntax |
Expand Down Expand Up @@ -152,6 +152,8 @@ Some examples of `X` in `ignore-X` or `only-X`:
`compare-mode-split-dwarf`, `compare-mode-split-dwarf-single`
- The two different test modes used by coverage tests:
`ignore-coverage-map`, `ignore-coverage-run`
- When testing a dist toolchain: `dist`
- This needs to be enabled with `COMPILETEST_ENABLE_DIST_TESTS=1`

The following directives will check rustc build settings and target
settings:
Expand All @@ -174,6 +176,7 @@ settings:
- `needs-rust-lld` — ignores if the rust lld support is not enabled (`rust.lld =
true` in `config.toml`)
- `needs-threads` — ignores if the target does not have threading support
- `needs-subprocess` — ignores if the target does not have subprocess support
- `needs-symlink` — ignores if the target does not support symlinks. This can be
the case on Windows if the developer did not enable privileged symlink
permissions.
Expand Down
Loading