about summary refs log tree commit diff
path: root/src/tools/error_index_generator
AgeCommit message (Collapse)AuthorLines
2025-02-17Move error_index_generator to the rustbook workspaceEric Huss-0/+1
I had forgotten that error_index_generator is using mdbook. This moves it to be part of the rustbook workspace so that it can share the dependency with rustbook.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-4/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-01-29Stop using `String` for error codes.Nicholas Nethercote-4/+5
Error codes are integers, but `String` is used everywhere to represent them. Gross! This commit introduces `ErrCode`, an integral newtype for error codes, replacing `String`. It also introduces a constant for every error code, e.g. `E0123`, and removes the `error_code!` macro. The constants are imported wherever used with `use rustc_errors::codes::*`. With the old code, we have three different ways to specify an error code at a use point: ``` error_code!(E0123) // macro call struct_span_code_err!(dcx, span, E0123, "msg"); // bare ident arg to macro call \#[diag(name, code = "E0123")] // string struct Diag; ``` With the new code, they all use the `E0123` constant. ``` E0123 // constant struct_span_code_err!(dcx, span, E0123, "msg"); // constant \#[diag(name, code = E0123)] // constant struct Diag; ``` The commit also changes the structure of the error code definitions: - `rustc_error_codes` now just defines a higher-order macro listing the used error codes and nothing else. - Because that's now the only thing in the `rustc_error_codes` crate, I moved it into the `lib.rs` file and removed the `error_codes.rs` file. - `rustc_errors` uses that macro to define everything, e.g. the error code constants and the `DIAGNOSTIC_TABLES`. This is in its new `codes.rs` file.
2023-12-18Rename `EarlyErrorHandler` as `EarlyDiagCtxt`.Nicholas Nethercote-1/+1
2023-11-11rustc_log: provide a way to init logging based on the values, not names, of ↵Ralf Jung-1/+2
the env vars
2023-06-27Provide more context for `rustc +nightly -Zunstable-options` on stable许杰友 Jieyou Xu (Joe)-1/+4
2023-02-26refactor: improve `error-index-generator` dependencyEzra Shaw-20/+2
2023-02-26refactor: statically guarantee that current error codes are documentedEzra Shaw-22/+15
2023-02-25fix: fix issue in macroEzra Shaw-1/+1
2023-01-05error-index: Don't generate 404 instead of removing it.Eric Huss-3/+1
2023-01-05Fix error-index redirect to work with back button.Eric Huss-11/+10
2022-09-18Fix tooltip display for error codesGuillaume Gomez-1/+2
2022-09-01Move error code book into a sub folderGuillaume Gomez-59/+40
2022-08-31Generate error index with mdbook instead of raw HTML pagesGuillaume Gomez-139/+212
2022-08-26Remove unused build dependencyGuillaume Gomez-3/+0
2022-08-23Handle error code hash by redirecting to the correct error code pageGuillaume Gomez-7/+27
2022-08-23Rewrite error index generator to greatly reduce the size of the pagesGuillaume Gomez-222/+106
2022-05-05Allow unused rules in some places in the compiler, library and toolsest31-4/+0
2022-03-27[error index] Move some logic from build.rs to main.rsJoshua Nelson-33/+23
2021-10-06Rollup merge of #89506 - yaymukund:docblock-headings, r=GuillaumeGomezManish Goregaokar-9/+10
librustdoc: Use correct heading levels. Closes #89309 This fixes the `<h#>` header tags throughout the docs to reflect a semantic hierarchy. - I ran a script to manually check that we don't have any files with multiple `<h1>` tags. - Also checked that we never incorrectly nest e.g. a `<h2>` under an `<h3>`. - I also spot-checked a bunch of pages (`trait.Read`, `enum.Ordering`, `primitive.isize`, `trait.Iterator`).
2021-10-06Revert the rustc_error_codes changes.Mukund Lakshman-1/+1
2021-10-04heading_level: u32 -> heading_offset: HeadingOffsetMukund Lakshman-2/+2
2021-10-04No need to default offset since we always override it.Mukund Lakshman-1/+1
2021-10-04Change `Markdown(...)` to `Markdown { ... }`Mukund Lakshman-9/+9
2021-10-04fix busted JavaScript in error index generatorMichael Howell-34/+19
The old JavaScript didn't work. It filled the browser console with "e.previousElementSibling not defined" errors, because it didn't account for the example-wrap div that a newer version of rustdoc added. Additionally, it had copied versions of utility functions that had been optimized in rustdoc main.js. This version updates those.
2021-10-04librustdoc: Use correct heading levels.Mukund Lakshman-1/+2
- Avoid multiple <h1>s on a page. - The <h#> tags should follow a semantic hierarchy. - Cap at h6 (no h7)
2021-09-20Migrate to 2021Mark Rousskov-1/+1
2021-07-29rfc3052: Remove authors field from Cargo manifestsJade-1/+0
Since RFC 3052 soft deprecated the authors field anyway, hiding it from crates.io, docs.rs, and making Cargo not add it by default, and it is not generally up to date/useful information, we should remove it from crates in this repo.
2021-07-08Rework SESSION_GLOBALS API to prevent overwriting itGuillaume Gomez-1/+2
2021-06-27Use rustdoc.css for error indexDeadbeef-0/+1
2020-08-30mv compiler to compiler/mark-2/+2
2020-08-08Eliminate the `SessionGlobals` from `librustc_ast`.Nicholas Nethercote-2/+1
By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This means they are accessed via the `Session`, rather than via TLS. A few `Attr` methods and `librustc_ast` functions are now methods of `Session`. All of this required passing a `Session` to lots of functions that didn't already have one. Some of these functions also had arguments removed, because those arguments could be accessed directly via the `Session` argument. `contains_feature_attr()` was dead, and is removed. Some functions were moved from `librustc_ast` elsewhere because they now need to access `Session`, which isn't available in that crate. - `entry_point_type()` --> `librustc_builtin_macros` - `global_allocator_spans()` --> `librustc_metadata` - `is_proc_macro_attr()` --> `Session`
2020-07-31Update error index generator to tracingOliver Scherer-2/+2
2020-07-22build: Remove unnecessary `build = "build.rs"` annotationsVadim Petrochenkov-1/+0
2020-07-15rustdoc: Rename internal API fns to `into_string`Lzu Tao-1/+1
to avoid surprising listed in API guidelines.
2020-07-09Eliminate confusing "globals" terminology.Nicholas Nethercote-1/+1
There are some structures that are called "globals", but are they global to a compilation session, and not truly global. I have always found this highly confusing, so this commit renames them as "session globals" and adds a comment explaining things. Also, the commit fixes an unnecessary nesting of `set()` calls `src/librustc_errors/json/tests.rs`
2020-06-25Support configurable deny-warnings for all in-tree crates.Eric Huss-1/+0
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-2/+2
2020-01-02Normalize `syntax::edition` imports.Mazdak Farrokhzad-1/+2
2019-12-24Deprecate Error::description for realDavid Tolnay-1/+1
`description` has been documented as soft-deprecated since 1.27.0 (17 months ago). There is no longer any reason to call it or implement it. This commit: - adds #[rustc_deprecated(since = "1.41.0")] to Error::description; - moves description (and cause, which is also deprecated) below the source and backtrace methods in the Error trait; - reduces documentation of description and cause to take up much less vertical real estate in rustdocs, while preserving the example that shows how to render errors without needing to call description; - removes the description function of all *currently unstable* Error impls in the standard library; - marks #[allow(deprecated)] the description function of all *stable* Error impls in the standard library; - replaces miscellaneous uses of description in example code and the compiler.
2019-12-22Format the worldMark Rousskov-45/+79
2019-11-23Remove useless line for error index generationGuillaume Gomez-1/+0
2019-11-14Adapt error index generator to the new formatGuillaume Gomez-16/+18
2019-11-14Fix error codes index generationGuillaume Gomez-1/+3
2019-10-07Warn if include macro fails to include entire fileMark Rousskov-1/+1
2019-09-23Add `#![deny(warnings)]` to internal toolsAlex Crichton-0/+1
2019-09-13Remove raw string literal quotes from error index descriptionsOliver Middleton-1/+1
2019-09-05Fix error index generator for new register_diagnostics APIMark Rousskov-29/+22
2019-08-20Remove serialization of diagnostics to filesMark Rousskov-4/+7
This is no longer used by the index generator and was always an unstable compiler detail, so strip it out. This also leaves in RUSTC_ERROR_METADATA_DST since the stage0 compiler still needs it to be set.