Skip to content

Commit 640a177

Browse files
committed
Fix indenting
1 parent 11d7b4b commit 640a177

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

posts/inside-rust/2021-01-15-rustdoc-performance-improvements.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,28 @@ There were actually only two PRs explicitly meant to improve the performance of
1717

1818
1. Rustdoc: Cache resolved links [#77700](https://github.com/rust-lang/rust/pull/77700)
1919

20-
This does what it says in the title. In particular, this sped up the time to generate intra-doc
21-
links for `stm32h7xx` by a whopping [90,000%]. [**@bugadani**](https://github.com/bugadani) did an
22-
excellent job on this, congratulations!
20+
This does what it says in the title. In particular, this sped up the time to generate intra-doc
21+
links for `stm32h7xx` by a whopping [90,000%]. [**@bugadani**](https://github.com/bugadani) did an
22+
excellent job on this, congratulations!
2323

2424
[90,000%]: https://github.com/rust-lang/rust/pull/77700#issuecomment-735995025
2525

2626
2. Don't look for blanket impls in intra-doc links [#79682](https://github.com/rust-lang/rust/pull/79682)
2727

28-
This PR was very disappointing to write. The gist is that if you had
28+
This PR was very disappointing to write. The gist is that if you had
2929

30-
```rust
31-
trait Trait {
32-
fn f() {}
33-
}
30+
```rust
31+
trait Trait {
32+
fn f() {}
33+
}
3434

35-
impl<T> Trait for T {}
36-
```
35+
impl<T> Trait for T {}
36+
```
3737

38-
then linking to `usize::f` would not only not work, but would take longer to run than the rest of
39-
intra-doc links to run. This temporarily disabled blanket impls until the bug is fixed and the performance can be improved, for a similar [90x] speedup on `stm32h7xx`.
38+
then linking to `usize::f` would not only not work, but would take longer to run than the rest of
39+
intra-doc links to run. This temporarily disabled blanket impls until the bug is fixed and the performance can be improved, for a similar [90x] speedup on `stm32h7xx`.
4040

41-
You may be wondering why `stm32h7xx` was so slow before; see the end of the post for details.
41+
You may be wondering why `stm32h7xx` was so slow before; see the end of the post for details.
4242

4343
[90x]: https://github.com/rust-lang/rust/pull/79682#issuecomment-738505531
4444

@@ -130,17 +130,17 @@ This is the "useful work" (as opposed to unnecessary complexity) that `doctree`
130130
- Inlining items that are only reachable from an export. 'Inlining' is showing the full documentation for an item at a re-export (`pub use std::process::Command`) instead of just showing the `use` statement. It's used pervasively by the standard library and facade crates like `futures` to show the relevant documentation in one place, instead of spread out across many crates. **@jyn514** hopes this could be done in `clean` instead, but has no idea yet how to do it.
131131
- Moving macros from always being at the root of the crate to the module where they're accessible. For example, this macro:
132132

133-
```rust
134-
#![crate_name="my_crate"]
135-
#![feature(decl_macro)]
136-
mod inner {
137-
pub macro m() {}
138-
}
139-
```
133+
```rust
134+
#![crate_name="my_crate"]
135+
#![feature(decl_macro)]
136+
mod inner {
137+
pub macro m() {}
138+
}
139+
```
140140

141-
should be documented at `my_crate::inner::m`, but the compiler shows it at `my_crate::m` instead. The fix for this is an awful hack that goes through every module Rustdoc knows about to see if the name of the module matches the name of the macro's parent module. At some point in the future, it would be great to fix the compiler APIs so this is no longer necessary.
141+
should be documented at `my_crate::inner::m`, but the compiler shows it at `my_crate::m` instead. The fix for this is an awful hack that goes through every module Rustdoc knows about to see if the name of the module matches the name of the macro's parent module. At some point in the future, it would be great to fix the compiler APIs so this is no longer necessary.
142142

143-
Giant thank you to [**@danielhenrymantilla**](https://github.com/danielhenrymantilla) both for writing up the fix, and discovering and fixing several other macro-related bugs along the way!
143+
Giant thank you to [**@danielhenrymantilla**](https://github.com/danielhenrymantilla) both for writing up the fix, and discovering and fixing several other macro-related bugs along the way!
144144

145145
If all these issues could be fixed, that would be an even bigger speedup - there would be no need to walk the tree in the first place!
146146

0 commit comments

Comments
 (0)