Skip to content

Commit 9874533

Browse files
Michael-F-Bryanmark-i-m
authored andcommitted
Added links back to nrc's stupid-stats
1 parent 7467531 commit 9874533

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/appendix-stupid-stats.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Appendix A: A tutorial on creating a drop-in replacement for rustc
22

3+
> **Note:** This is a copy of `@nrc`'s amazing [stupid-stats]. You should find
4+
> a copy of the code on the GitHub repository although due to the compiler's
5+
> constantly evolving nature, there is no guarantee it'll compile on the first
6+
> go.
7+
38
Many tools benefit from being a drop-in replacement for a compiler. By this, I
49
mean that any user of the tool can use `mytool` in all the ways they would
510
normally use `rustc` - whether manually compiling a single file or as part of a
@@ -395,4 +400,6 @@ It'd be great to see Rustdoc converted to using these APIs, if that is possible
395400
analysis, rather than doing its own analysis). Other parts of the compiler
396401
(e.g., pretty printing, testing) could be refactored to use these APIs
397402
internally (I already changed save-analysis to use `CompilerController`). I've
398-
been experimenting with a prototype rustfmt which also uses these APIs.
403+
been experimenting with a prototype rustfmt which also uses these APIs.
404+
405+
[stupid-stats]: https://github.com/nrc/stupid-stats

src/rustc-driver.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ compilation process
3939
The `CompileState`'s various `state_after_*()` constructors can be inspected to
4040
determine what bits of information are available to which callback.
4141

42+
For a more detailed explanation on using `rustc_driver`, check out the
43+
[stupid-stats] guide by `@nrc` (attached as [Appendix A]).
44+
4245
> **Warning:** By its very nature, the internal compiler APIs are always going
4346
> to be unstable. That said, we do try not to break things unnecessarily.
4447
@@ -68,4 +71,6 @@ thread-locals, although you should rarely need to touch it.
6871
[`CompileState`]: https://github.com/rust-lang/rust/blob/master/src/librustc_driver/driver.rs
6972
[`Session`]: https://github.com/rust-lang/rust/blob/master/src/librustc/session/mod.rs
7073
[`TyCtxt`]: https://github.com/rust-lang/rust/blob/master/src/librustc/ty/context.rs
71-
[`CodeMap`]: https://github.com/rust-lang/rust/blob/master/src/libsyntax/codemap.rs
74+
[`CodeMap`]: https://github.com/rust-lang/rust/blob/master/src/libsyntax/codemap.rs
75+
[stupid-stats]: https://github.com/nrc/stupid-stats
76+
[Appendix A]: appendix-stupid-stats.html

0 commit comments

Comments
 (0)