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