File tree 3 files changed +45
-0
lines changed
3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 32
32
- [ Rust for Linux] ( ./tests/rust-for-linux.md )
33
33
- [ Performance testing] ( ./tests/perf.md )
34
34
- [ Suggest tests tool] ( ./tests/suggest-tests.md )
35
+ - [ Misc info] ( ./tests/misc.md )
35
36
- [ Debugging the compiler] ( ./compiler-debugging.md )
36
37
- [ Using the tracing/logging instrumentation] ( ./tracing.md )
37
38
- [ 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.
155
155
A separate infrastructure is used for testing and tracking performance of the
156
156
compiler. See the [ Performance testing chapter] ( perf.md ) for more details.
157
157
158
+ ## Miscellaneous information
159
+
160
+ There are some other useful testing-related info at [ Misc info] ( misc.md ) .
161
+
158
162
## Further reading
159
163
160
164
The 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