about summary refs log tree commit diff
path: root/compiler/rustc_errors/Cargo.toml
AgeCommit message (Collapse)AuthorLines
2025-07-04bump termize depklensy-1/+1
2025-05-17compiler & tools: bump windows crate to dedupe versionsklensy-1/+1
2025-03-10Revert "Use workspace lints for crates in `compiler/` #138084"许杰友 Jieyou Xu (Joe)-3/+0
Revert <https://github.com/rust-lang/rust/pull/138084> to buy time to consider options that avoids breaking downstream usages of cargo on distributed `rustc-src` artifacts, where such cargo invocations fail due to inability to inherit `lints` from workspace root manifest's `workspace.lints` (this is only valid for the source rust-lang/rust workspace, but not really the distributed `rustc-src` artifacts). This breakage was reported in <https://github.com/rust-lang/rust/issues/138304>. This reverts commit 48caf81484b50dca5a5cebb614899a3df81ca898, reversing changes made to c6662879b27f5161e95f39395e3c9513a7b97028.
2025-03-08Specify rust lints for `compiler/` crates via Cargo.Nicholas Nethercote-0/+3
By naming them in `[workspace.lints.rust]` in the top-level `Cargo.toml`, and then making all `compiler/` crates inherit them with `[lints] workspace = true`. (I omitted `rustc_codegen_{cranelift,gcc}`, because they're a bit different.) The advantages of this over the current approach: - It uses a standard Cargo feature, rather than special handling in bootstrap. So, easier to understand, and less likely to get accidentally broken in the future. - It works for proc macro crates. It's a shame it doesn't work for rustc-specific lints, as the comments explain.
2025-02-24Introduce new-style attribute parsers for several attributesJana Dönszelmann-0/+1
note: compiler compiles but librustdoc and clippy don't
2025-02-22Upgrade the compiler to edition 2024Michael Goulet-1/+1
2025-02-16Move hashes from rustc_data_structure to rustc_hashes so they can be shared ↵Ben Kimock-0/+1
with rust-analyzer
2025-01-21bumpt compiler and tools to windows 0.59klensy-1/+1
2024-12-16Fix logical error with what text is considered whitespace.Harrison Kaiser-0/+1
There is a logical issue around what counts as leading white-space. There is code which does a subtraction assuming that no errors will be reported inside the leading whitespace. However we compute the length of that whitespace with std::char::is_whitespace and not rustc_lexer::is_whitespace. The former will include a no-break space while later will excluded it. We can only safely make the assumption that no errors will be reported in whitespace if it is all "Rust Standard" whitespace. Indeed an error does occur in unicode whitespace if it contains a no-break space.
2024-11-12Delete the `cfg(not(parallel))` serial compilerNoratrieb-5/+0
Since it's inception a long time ago, the parallel compiler and its cfgs have been a maintenance burden. This was a necessary evil the allow iteration while not degrading performance because of synchronization overhead. But this time is over. Thanks to the amazing work by the parallel working group (and the dyn sync crimes), the parallel compiler has now been fast enough to be shipped by default in nightly for quite a while now. Stable and beta have still been on the serial compiler, because they can't use `-Zthreads` anyways. But this is quite suboptimal: - the maintenance burden still sucks - we're not testing the serial compiler in nightly Because of these reasons, it's time to end it. The serial compiler has served us well in the years since it was split from the parallel one, but it's over now. Let the knight slay one head of the two-headed dragon!
2024-10-27compiler: Add rustc_abi dependence to the compilerJubilee Young-0/+1
Depend on rustc_abi in compiler crates that use it indirectly but have not yet taken on that dependency, and are not entangled in my other PRs. This leaves an "excise rustc_target" step after the dust settles.
2024-09-27bump few depsklensy-1/+1
cargo_metadata, thorin-dwp, windows
2024-08-19Update annotate-snippets to 0.11Xiretza-1/+1
2024-07-18Be more accurate about calculating `display_col` from a `BytePos`Esteban Küber-1/+0
No longer track "zero-width" chars in `SourceMap`, read directly from the line when calculating the `display_col` of a `BytePos`. Move `char_width` to `rustc_span` and use it from the emitter. This change allows the following to properly align in terminals (depending on the font, the replaced control codepoints are rendered as 1 or 2 width, on my terminal they are rendered as 1, on VSCode text they are rendered as 2): ``` error: this file contains an unclosed delimiter --> $DIR/issue-68629.rs:5:17 | LL | ␜␟ts␀![{i | -- unclosed delimiter | | | unclosed delimiter LL | ␀␀ fn rݻoa>rݻm | ^ ```
2024-02-18windows bump to 0.52klensy-1/+1
2024-01-29Stop using `String` for error codes.Nicholas Nethercote-0/+2
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.
2024-01-07annotate-snippets: update to 0.10klensy-1/+1
2023-10-30Clean up `rustc_*/Cargo.toml`.Nicholas Nethercote-12/+14
- Sort dependencies and features sections. - Add `tidy` markers to the sorted sections so they stay sorted. - Remove empty `[lib`] sections. - Remove "See more keys..." comments. Excluded files: - rustc_codegen_{cranelift,gcc}, because they're external. - rustc_lexer, because it has external use. - stable_mir, because it has external use.
2023-07-31Replace the many arguments of `EmitterWriter::stderr` with builder methodsOli Scherer-0/+1
2023-07-03Add a simple markdown parser for formatting `rustc --explain`Trevor Gross-1/+1
Currently, the output of `rustc --explain foo` displays the raw markdown in a pager. This is acceptable, but using actual formatting makes it easier to understand. This patch consists of three major components: 1. A markdown parser. This is an extremely simple non-backtracking recursive implementation that requires normalization of the final token stream 2. A utility to write the token stream to an output buffer 3. Configuration within rustc_driver_impl to invoke this combination for `--explain`. Like the current implementation, it first attempts to print to a pager with a fallback colorized terminal, and standard print as a last resort. If color is disabled, or if the output does not support it, or if printing with color fails, it will write the raw markdown (which matches current behavior). Pagers known to support color are: `less` (with `-r`), `bat` (aka `catbat`), and `delta`. The markdown parser does not support the entire markdown specification, but should support the following with reasonable accuracy: - Headings, including formatting - Comments - Code, inline and fenced block (no indented block) - Strong, emphasis, and strikethrough formatted text - Links, anchor, inline, and reference-style - Horizontal rules - Unordered and ordered list items, including formatting This parser and writer should be reusable by other systems if ever needed.
2023-05-09bump windows crate 0.46 -> 0.48 in workspaceklensy-2/+1
2023-04-18Add `rustc_fluent_macro` to decouple fluent from `rustc_macros`Nilstrieb-0/+1
Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
2023-03-20migrate compiler, bootstrap, and compiletest to windows-rsAndy Russell-2/+8
2022-12-27UPDATE - migrate fn simd_simple_float_intrinsic error messagesJhonny Bill Mena-0/+1
2022-11-19Rollup merge of #103117 - joshtriplett:use-is-terminal, r=eholkMatthias Krüger-1/+0
Use `IsTerminal` in place of `atty` In any crate that can use nightly features, use `IsTerminal` rather than `atty`: - Use `IsTerminal` in `rustc_errors` - Use `IsTerminal` in `rustc_driver` - Use `IsTerminal` in `rustc_log` - Use `IsTerminal` in `librustdoc`
2022-11-18Enable icu sync feature for parallel compilerCharles Lew-0/+3
2022-10-16Use IsTerminal in rustc_errorsJosh Triplett-1/+0
2022-09-29Remove from compiler/ cratesreez12g-1/+0
2022-09-27Implement IntoDiagnosticArg for rustc_ast::PathXiretza-0/+2
2022-09-10translations(rustc_session): migrate output.rsLuis Cardoso-1/+1
2022-08-31respond to review feedback: mainly eliminate as many conversions as possible...Nathan Stocks-2/+3
- ... when creating diagnostics in rustc_metadata - use the error_code! macro - pass macro output to diag.code() - use fluent from within manual implementation of SessionDiagnostic - emit the untested errors in case they occur in the wild - stop panicking in the probably-not-dead code, add fixme to write test
2022-08-02dedupe 'annotate-snippets' crate versionsklensy-1/+1
2022-07-08Implement IntoDiagnosticArg for hir::ConstContextMichael Goulet-0/+1
2022-06-03Use serde_json for json error messagesbjorn3-0/+2
2022-04-05span: move `MultiSpan`David Wood-0/+1
`MultiSpan` contains labels, which are more complicated with the introduction of diagnostic translation and will use types from `rustc_errors` - however, `rustc_errors` depends on `rustc_span` so `rustc_span` cannot use types like `DiagnosticMessage` without dependency cycles. Introduce a new `rustc_error_messages` crate that can contain `DiagnosticMessage` and `MultiSpan`. Signed-off-by: David Wood <david.wood@huawei.com>
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.
2020-10-30Implement rustc side of report-future-incompatAaron Hill-0/+1
2020-08-30mv compiler to compiler/mark-0/+23