Skip to content

Commit

Permalink
Rollup merge of #100922 - GuillaumeGomez:rewrite-error-index, r=notri…
Browse files Browse the repository at this point in the history
…ddle

Rewrite error index generator to greatly reduce the size of the pages

Fixes rust-lang/rust#100736.

Instead of having all error codes in a same page (making the DOM way too big), I split the output into multiple files and generated a list of links (if there is an explanation) to the error codes' explanation into the already existing file.

I also used this opportunity to greatly simplify the code. Instead of needing a `build.rs`, I simply imported the file we want and wrote the macro which generates a function containing everything we need. We just need to call it to get the error codes and their explanation (if any). Also, considering the implementations between markdown and HTML formats differed even further, the `Formatter` trait was becoming too problematic so I removed it too.

You can test it [here](https://rustdoc.crud.net/imperio/rewrite-error-index/error-index.html).

cc ``@jsha``
r? ``@notriddle``
  • Loading branch information
matthiaskrgr committed Aug 24, 2022
2 parents 72b42ef + 5200214 commit 99cd6f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ pub trait StructuralEq {
/// If you try to implement `Copy` on a struct or enum containing non-`Copy` data, you will get
/// the error [E0204].
///
/// [E0204]: ../../error-index.html#E0204
/// [E0204]: ../../error_codes/E0204.html
///
/// ## When *should* my type be `Copy`?
///
Expand Down
2 changes: 1 addition & 1 deletion core/src/ops/drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ pub trait Drop {
/// handled by the compiler, but when using unsafe code, can sometimes occur
/// unintentionally, particularly when using [`ptr::drop_in_place`].
///
/// [E0040]: ../../error-index.html#E0040
/// [E0040]: ../../error_codes/E0040.html
/// [`panic!`]: crate::panic!
/// [`mem::drop`]: drop
/// [`ptr::drop_in_place`]: crate::ptr::drop_in_place
Expand Down

0 comments on commit 99cd6f4

Please sign in to comment.