Skip to content

Commit 1089f2d

Browse files
committed
Highlight the nightly version needed to compile the examples
Signed-off-by: Yuki Okushi <[email protected]>
1 parent 5c65222 commit 1089f2d

6 files changed

+16
-6
lines changed

examples/rustc-driver-example.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// NOTE: For the example to compile, you will need to first run the following:
44
// rustup component add rustc-dev llvm-tools-preview
55

6+
// You need the below nightly version to compile:
67
// version: rustc 1.68.0-nightly (935dc0721 2022-12-19)
78

89
extern crate rustc_error_codes;

examples/rustc-driver-getting-diagnostics.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// NOTE: For the example to compile, you will need to first run the following:
44
// rustup component add rustc-dev llvm-tools-preview
55

6+
// You need the below nightly version to compile:
67
// version: rustc 1.68.0-nightly (935dc0721 2022-12-19)
78

89
extern crate rustc_error_codes;

examples/rustc-driver-interacting-with-the-ast.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// NOTE: For the example to compile, you will need to first run the following:
44
// rustup component add rustc-dev llvm-tools-preview
55

6+
// You need the below nightly version to compile:
67
// version: rustc 1.68.0-nightly (935dc0721 2022-12-19)
78

89
extern crate rustc_ast_pretty;

src/rustc-driver-getting-diagnostics.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66

77
To get diagnostics from the compiler,
88
configure `rustc_interface::Config` to output diagnostic to a buffer,
9-
and run `TyCtxt.analysis`. The following was tested
10-
with <!-- date-check: Jan 2023 --> `nightly-2022-12-19` (See [here][example]
11-
for the complete example):
9+
and run `TyCtxt.analysis`.
10+
11+
> **Note**: We expect you to compile the example
12+
> with <!-- date-check: Jan 2023 --> `nightly-2022-12-19` (See [here][example]
13+
> for the complete example)
1214
1315
[example]: https://github.com/rust-lang/rustc-dev-guide/blob/master/examples/rustc-driver-getting-diagnostics.rs
1416

@@ -24,7 +26,7 @@ let config = rustc_interface::Config {
2426
),
2527
},
2628
/* other config */
27-
},
29+
},
2830
/* other config */
2931
};
3032
rustc_interface::run_compiler(config, |compiler| {

src/rustc-driver-interacting-with-the-ast.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
## Getting the type of an expression
66

77
To get the type of an expression, use the `global_ctxt` to get a `TyCtxt`.
8-
The following was tested with <!-- date-check: Jan 2023 --> `nightly-2022-12-19`
9-
(see [here][example] for the complete example):
8+
9+
> **Note**: We expect you to compile the example
10+
> with <!-- date-check: Jan 2023 --> `nightly-2022-12-19`
11+
> (see [here][example] for the complete example)
1012
1113
[example]: https://github.com/rust-lang/rustc-dev-guide/blob/master/examples/rustc-driver-interacting-with-the-ast.rs
1214

src/rustc-driver.md

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ configuration and passes it to the closure. Inside the closure, you can use the
1616
to drive queries to compile a crate and get the results. This is what the `rustc_driver` does too.
1717
You can see a minimal example of how to use `rustc_interface` [here][example].
1818

19+
> **Note**: As changes can be made to the rustc internal APIs at any time,
20+
> we expect you to compile the example with <!-- date-check: Jan 2023 --> `nightly-2022-12-19`.
21+
1922
You can see what queries are currently available through the rustdocs for [`Compiler`].
2023
You can see an example of how to use them by looking at the `rustc_driver` implementation,
2124
specifically the [`rustc_driver::run_compiler` function][rd_rc] (not to be confused with

0 commit comments

Comments
 (0)