2016-06-21 17:08:13 -05:00
|
|
|
[package]
|
|
|
|
name = "rustc_errors"
|
|
|
|
version = "0.0.0"
|
2021-09-19 11:49:55 -05:00
|
|
|
edition = "2021"
|
2016-06-21 17:08:13 -05:00
|
|
|
|
|
|
|
[dependencies]
|
2023-10-19 21:37:29 -05:00
|
|
|
# tidy-alphabetical-start
|
2023-12-30 09:11:41 -06:00
|
|
|
annotate-snippets = "0.10"
|
2023-10-19 21:37:29 -05:00
|
|
|
derive_setters = "0.1.6"
|
2022-09-14 12:22:20 -05:00
|
|
|
rustc_ast = { path = "../rustc_ast" }
|
|
|
|
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
|
2023-10-19 21:37:29 -05:00
|
|
|
rustc_data_structures = { path = "../rustc_data_structures" }
|
Stop using `String` for error codes.
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-13 17:57:07 -06:00
|
|
|
rustc_error_codes = { path = "../rustc_error_codes" }
|
2022-03-23 21:03:04 -05:00
|
|
|
rustc_error_messages = { path = "../rustc_error_messages" }
|
2023-04-16 07:33:00 -05:00
|
|
|
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
|
2023-10-19 21:37:29 -05:00
|
|
|
rustc_hir = { path = "../rustc_hir" }
|
Stop using `String` for error codes.
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-13 17:57:07 -06:00
|
|
|
rustc_index = { path = "../rustc_index" }
|
2023-10-19 21:37:29 -05:00
|
|
|
rustc_lint_defs = { path = "../rustc_lint_defs" }
|
|
|
|
rustc_macros = { path = "../rustc_macros" }
|
2020-08-27 22:58:48 -05:00
|
|
|
rustc_serialize = { path = "../rustc_serialize" }
|
|
|
|
rustc_span = { path = "../rustc_span" }
|
2022-09-01 01:03:47 -05:00
|
|
|
rustc_target = { path = "../rustc_target" }
|
2022-11-17 07:53:14 -06:00
|
|
|
rustc_type_ir = { path = "../rustc_type_ir" }
|
2022-08-26 15:39:59 -05:00
|
|
|
serde = { version = "1.0.125", features = [ "derive" ] }
|
2021-06-03 14:14:15 -05:00
|
|
|
serde_json = "1.0.59"
|
2023-10-19 21:37:29 -05:00
|
|
|
termcolor = "1.2.0"
|
|
|
|
termize = "0.1.1"
|
|
|
|
tracing = "0.1"
|
|
|
|
unicode-width = "0.1.4"
|
|
|
|
# tidy-alphabetical-end
|
2020-01-04 15:46:47 -06:00
|
|
|
|
2023-01-15 12:43:15 -06:00
|
|
|
[target.'cfg(windows)'.dependencies.windows]
|
2024-02-18 07:02:16 -06:00
|
|
|
version = "0.52.0"
|
2023-01-15 12:43:15 -06:00
|
|
|
features = [
|
|
|
|
"Win32_Foundation",
|
|
|
|
"Win32_Security",
|
|
|
|
"Win32_System_Threading",
|
|
|
|
]
|
2022-11-06 11:25:48 -06:00
|
|
|
|
|
|
|
[features]
|
2023-10-19 21:37:29 -05:00
|
|
|
# tidy-alphabetical-start
|
2022-11-06 11:25:48 -06:00
|
|
|
rustc_use_parallel_compiler = ['rustc_error_messages/rustc_use_parallel_compiler']
|
2023-10-19 21:37:29 -05:00
|
|
|
# tidy-alphabetical-end
|