Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1ac6be7

Browse files
Merge pull request #2582 from rust-lang/rustc-pull
Rustc pull update
2 parents c188f7b + eefc967 commit 1ac6be7

File tree

7 files changed

+42
-36
lines changed

7 files changed

+42
-36
lines changed

‎rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a1dbb443527bd126452875eb5d5860c1d001d761
1+
2f3f27bf79ec147fec9d2e7980605307a74067f4

‎src/building/bootstrapping/writing-tools-in-bootstrap.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ There are three types of tools you can write in bootstrap:
1111
Use this for tools that rely on the locally built std. The output goes into the "stageN-tools" directory.
1212
This mode is rarely used, mainly for `compiletest` which requires `libtest`.
1313

14-
- **`Mode::ToolRustc`**
15-
Use this for tools that depend on both the locally built `rustc` and the target `std`. This is more complex than
16-
the other modes because the tool must be built with the same compiler used for `rustc` and placed in the "stageN-tools"
17-
directory. When you choose `Mode::ToolRustc`, `ToolBuild` implementation takes care of this automatically.
18-
If you need to use the builder’s compiler for something specific, you can get it from `ToolBuildResult`, which is
14+
- **`Mode::ToolRustcPrivate`**
15+
Use this for tools that use the `rustc_private` mechanism, and thus depend on the locally built `rustc` and its rlib artifacts. This is more complex than the other modes because the tool must be built with the same compiler used for `rustc` and placed in the "stageN-tools" directory. When you choose `Mode::ToolRustcPrivate`, `ToolBuild` implementation takes care of this automatically. If you need to use the builder’s compiler for something specific, you can get it from `ToolBuildResult`, which is
1916
returned by the tool's [`Step`].
2017

2118
Regardless of the tool type you must return `ToolBuildResult` from the tool’s [`Step`] implementation and use `ToolBuild` inside it.

‎src/tests/adding.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ guidelines:
2929
suites.
3030
- Need to inspect the resulting binary in some way? Or if all the other test
3131
suites are too limited for your purposes? Then use `run-make`.
32+
- Use `run-make-cargo` if you need to exercise in-tree `cargo` in conjunction
33+
with in-tree `rustc`.
3234
- Check out the [compiletest] chapter for more specialized test suites.
3335

3436
After deciding on which kind of test to add, see [best

‎src/tests/best-practices.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ related tests.
8383
- E.g. for an implementation of RFC 2093 specifically, we can group a
8484
collection of tests under `tests/ui/rfc-2093-infer-outlives/`. For the
8585
directory name, include what the RFC is about.
86-
- For the [`run-make`] test suite, each `rmake.rs` must be contained within an
87-
immediate subdirectory under `tests/run-make/`. Further nesting is not
88-
presently supported. Avoid including issue number in the directory name too,
89-
include that info in a comment inside `rmake.rs`.
86+
- For the [`run-make`]/`run-make-support` test suites, each `rmake.rs` must
87+
be contained within an immediate subdirectory under `tests/run-make/` or
88+
`tests/run-make-cargo/` respectively. Further nesting is not presently
89+
supported. Avoid using _only_ an issue number for the test name as well.
9090
9191
## Test descriptions
9292

‎src/tests/compiletest.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,13 +397,19 @@ your test, causing separate files to be generated for 32bit and 64bit systems.
397397

398398
### `run-make` tests
399399

400-
The tests in [`tests/run-make`] are general-purpose tests using Rust *recipes*,
401-
which are small programs (`rmake.rs`) allowing arbitrary Rust code such as
402-
`rustc` invocations, and is supported by a [`run_make_support`] library. Using
403-
Rust recipes provide the ultimate in flexibility.
400+
The tests in [`tests/run-make`] and [`tests/run-make-cargo`] are general-purpose
401+
tests using Rust *recipes*, which are small programs (`rmake.rs`) allowing
402+
arbitrary Rust code such as `rustc` invocations, and is supported by a
403+
[`run_make_support`] library. Using Rust recipes provide the ultimate in
404+
flexibility.
404405

405406
`run-make` tests should be used if no other test suites better suit your needs.
406407

408+
The `run-make-cargo` test suite additionally builds an in-tree `cargo` to support
409+
use cases that require testing in-tree `cargo` in conjunction with in-tree `rustc`.
410+
The `run-make` test suite does not have access to in-tree `cargo` (so it can be the
411+
faster-to-iterate test suite).
412+
407413
#### Using Rust recipes
408414

409415
Each test should be in a separate directory with a `rmake.rs` Rust program,
@@ -476,6 +482,7 @@ Then add a corresponding entry to `"rust-analyzer.linkedProjects"`
476482
```
477483

478484
[`tests/run-make`]: https://github.com/rust-lang/rust/tree/master/tests/run-make
485+
[`tests/run-make-cargo`]: https://github.com/rust-lang/rust/tree/master/tests/run-make-cargo
479486
[`run_make_support`]: https://github.com/rust-lang/rust/tree/master/src/tools/run-make-support
480487

481488
### Coverage tests

‎src/tests/directives.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ not be exhaustive. Directives can generally be found by browsing the
5252

5353
See [Building auxiliary crates](compiletest.html#building-auxiliary-crates)
5454

55-
| Directive | Explanation | Supported test suites | Possible values |
56-
|-----------------------|-------------------------------------------------------------------------------------------------------|-----------------------|-----------------------------------------------|
57-
| `aux-bin` | Build a aux binary, made available in `auxiliary/bin` relative to test directory | All except `run-make` | Path to auxiliary `.rs` file |
58-
| `aux-build` | Build a separate crate from the named source file | All except `run-make` | Path to auxiliary `.rs` file |
59-
| `aux-crate` | Like `aux-build` but makes available as extern prelude | All except `run-make` | `<extern_prelude_name>=<path/to/aux/file.rs>` |
60-
| `aux-codegen-backend` | Similar to `aux-build` but pass the compiled dylib to `-Zcodegen-backend` when building the main file | `ui-fulldeps` | Path to codegen backend file |
61-
| `proc-macro` | Similar to `aux-build`, but for aux forces host and don't use `-Cprefer-dynamic`[^pm]. | All except `run-make` | Path to auxiliary proc-macro `.rs` file |
62-
| `build-aux-docs` | Build docs for auxiliaries as well. Note that this only works with `aux-build`, not `aux-crate`. | All except `run-make` | N/A |
55+
| Directive | Explanation | Supported test suites | Possible values |
56+
|-----------------------|-------------------------------------------------------------------------------------------------------|----------------------------------------|-----------------------------------------------|
57+
| `aux-bin` | Build a aux binary, made available in `auxiliary/bin` relative to test directory | All except `run-make`/`run-make-cargo` | Path to auxiliary `.rs` file |
58+
| `aux-build` | Build a separate crate from the named source file | All except `run-make`/`run-make-cargo` | Path to auxiliary `.rs` file |
59+
| `aux-crate` | Like `aux-build` but makes available as extern prelude | All except `run-make`/`run-make-cargo` | `<extern_prelude_name>=<path/to/aux/file.rs>` |
60+
| `aux-codegen-backend` | Similar to `aux-build` but pass the compiled dylib to `-Zcodegen-backend` when building the main file | `ui-fulldeps` | Path to codegen backend file |
61+
| `proc-macro` | Similar to `aux-build`, but for aux forces host and don't use `-Cprefer-dynamic`[^pm]. | All except `run-make`/`run-make-cargo` | Path to auxiliary proc-macro `.rs` file |
62+
| `build-aux-docs` | Build docs for auxiliaries as well. Note that this only works with `aux-build`, not `aux-crate`. | All except `run-make`/`run-make-cargo` | N/A |
6363

6464
[^pm]: please see the [Auxiliary proc-macro section](compiletest.html#auxiliary-proc-macro) in the compiletest chapter for specifics.
6565

@@ -243,18 +243,18 @@ ignoring debuggers.
243243

244244
### Affecting how tests are built
245245

246-
| Directive | Explanation | Supported test suites | Possible values |
247-
|---------------------|----------------------------------------------------------------------------------------------|---------------------------|--------------------------------------------------------------------------------------------|
248-
| `compile-flags` | Flags passed to `rustc` when building the test or aux file | All except for `run-make` | Any valid `rustc` flags, e.g. `-Awarnings -Dfoo`. Cannot be `-Cincremental` or `--edition` |
249-
| `edition` | The edition used to build the test | All except for `run-make` | Any valid `--edition` value |
250-
| `rustc-env` | Env var to set when running `rustc` | All except for `run-make` | `<KEY>=<VALUE>` |
251-
| `unset-rustc-env` | Env var to unset when running `rustc` | All except for `run-make` | Any env var name |
252-
| `incremental` | Proper incremental support for tests outside of incremental test suite | `ui`, `crashes` | N/A |
253-
| `no-prefer-dynamic` | Don't use `-C prefer-dynamic`, don't build as a dylib via a `--crate-type=dylib` preset flag | `ui`, `crashes` | N/A |
246+
| Directive | Explanation | Supported test suites | Possible values |
247+
|---------------------|----------------------------------------------------------------------------------------------|--------------------------------------------|--------------------------------------------------------------------------------------------|
248+
| `compile-flags` | Flags passed to `rustc` when building the test or aux file | All except for `run-make`/`run-make-cargo` | Any valid `rustc` flags, e.g. `-Awarnings -Dfoo`. Cannot be `-Cincremental` or `--edition` |
249+
| `edition` | The edition used to build the test | All except for `run-make`/`run-make-cargo` | Any valid `--edition` value |
250+
| `rustc-env` | Env var to set when running `rustc` | All except for `run-make`/`run-make-cargo` | `<KEY>=<VALUE>` |
251+
| `unset-rustc-env` | Env var to unset when running `rustc` | All except for `run-make`/`run-make-cargo` | Any env var name |
252+
| `incremental` | Proper incremental support for tests outside of incremental test suite | `ui`, `crashes` | N/A |
253+
| `no-prefer-dynamic` | Don't use `-C prefer-dynamic`, don't build as a dylib via a `--crate-type=dylib` preset flag | `ui`, `crashes` | N/A |
254254

255255
<div class="warning">
256256

257-
Tests (outside of `run-make`) that want to use incremental tests not in the
257+
Tests (outside of `run-make`/`run-make-cargo`) that want to use incremental tests not in the
258258
incremental test-suite must not pass `-C incremental` via `compile-flags`, and
259259
must instead use the `//@ incremental` directive.
260260

@@ -264,9 +264,9 @@ Consider writing the test as a proper incremental test instead.
264264

265265
### Rustdoc
266266

267-
| Directive | Explanation | Supported test suites | Possible values |
268-
|-------------|--------------------------------------------------------------|------------------------------------------|---------------------------|
269-
| `doc-flags` | Flags passed to `rustdoc` when building the test or aux file | `rustdoc`, `rustdoc-js`, `rustdoc-json` | Any valid `rustdoc` flags |
267+
| Directive | Explanation | Supported test suites | Possible values |
268+
|-------------|--------------------------------------------------------------|-----------------------------------------|---------------------------|
269+
| `doc-flags` | Flags passed to `rustdoc` when building the test or aux file | `rustdoc`, `rustdoc-js`, `rustdoc-json` | Any valid `rustdoc` flags |
270270

271271
<!--
272272
**FIXME(rustdoc)**: what does `check-test-line-numbers-match` do?

‎src/tests/misc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ In `ui` tests and other test suites that support `//@ rustc-env`, you can specif
2424
//@ rustc-env:RUSTC_BOOTSTRAP=-1
2525
```
2626

27-
For `run-make` tests, `//@ rustc-env` is not supported. You can do something
28-
like the following for individual `rustc` invocations.
27+
For `run-make`/`run-make-cargo` tests, `//@ rustc-env` is not supported. You can do
28+
something like the following for individual `rustc` invocations.
2929

3030
```rust,ignore
3131
use run_make_support::rustc;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /