File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 3232 - [ Rust for Linux] ( ./tests/rust-for-linux.md )
3333 - [ Performance testing] ( ./tests/perf.md )
3434 - [ Suggest tests tool] ( ./tests/suggest-tests.md )
35+ - [ Misc info] ( ./tests/misc.md )
3536- [ Debugging the compiler] ( ./compiler-debugging.md )
3637 - [ Using the tracing/logging instrumentation] ( ./tracing.md )
3738- [ Profiling the compiler] ( ./profiling.md )
Original file line number Diff line number Diff line change @@ -155,6 +155,10 @@ chapter](ecosystem.md) for more details.
155155A separate infrastructure is used for testing and tracking performance of the
156156compiler. See the [ Performance testing chapter] ( perf.md ) for more details.
157157
158+ ## Miscellaneous information
159+
160+ There are some other useful testing-related info at [ Misc info] ( misc.md ) .
161+
158162## Further reading
159163
160164The following blog posts may also be of interest:
Original file line number Diff line number Diff line change 1+ # Miscellaneous testing-related info
2+
3+ ## ` RUSTC_BOOTSTRAP ` and stability
4+
5+ <!-- date-check: Nov 2024 -->
6+
7+ This is a bootstrap/compiler implementation detail, but it can also be useful
8+ for testing:
9+
10+ - ` RUSTC_BOOTSTRAP=1 ` will "cheat" and bypass usual stability checking, allowing
11+ you to use unstable features and cli flags on a stable ` rustc ` .
12+ - ` RUSTC_BOOTSTRAP=-1 ` will force a given ` rustc ` to pretend that is a stable
13+ compiler, even if it's actually a nightly ` rustc ` . This is useful because some
14+ behaviors of the compiler (e.g. diagnostics) can differ depending on whether
15+ the compiler is nightly or not.
16+
17+ In ` ui ` tests and other test suites that support ` //@ rustc-env ` , you can specify
18+
19+ ``` rust,ignore
20+ // Force unstable features to be usable on stable rustc
21+ //@ rustc-env:RUSTC_BOOTSTRAP=1
22+
23+ // Or force nightly rustc to pretend it is a stable rustc
24+ //@ rustc-env:RUSTC_BOOTSTRAP=-1
25+ ```
26+
27+ For ` run-make ` tests, ` //@ rustc-env ` is not supported. You can do something
28+ like the following for individual ` rustc ` invocations.
29+
30+ ``` rust,ignore
31+ use run_make_support::rustc;
32+
33+ fn main() {
34+ rustc()
35+ // Pretend that I am very stable
36+ .env("RUSTC_BOOTSTRAP", "-1")
37+ //...
38+ .run();
39+ }
40+ ```
You can’t perform that action at this time.
0 commit comments