mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
9454be304f
`rustc_error_messages` currently depends on `rustc_ast`/`rustc_ast_pretty`. This is odd, because `rustc_error_messages` feels like a very low-level module but `rustc_ast`/`rustc_ast_pretty` do not. The reason is that a few AST types impl `IntoDiagArg` via pretty-printing. `rustc_error_messages` can define `IntoDiagArg` and then impl it for the AST types. But if we invert the dependency we hit a problem with the orphan rule: `rustc_ast` must impl `IntoDiagArg` for the AST types, but that requires calling pretty-printing code which is in `rustc_ast_pretty`, a downstream crate. This commit avoids this problem by just removing the `IntoDiagArg` impls for these AST types. There aren't that many of them, and we can just use `String` in the relevant error structs and use the pretty printer in the downstream crates that construct the error structs. There are plenty of existing examples where `String` is used in error structs. There is now no dependency between `rustc_ast*` and `rustc_error_messages`.
19 lines
641 B
TOML
19 lines
641 B
TOML
[package]
|
|
name = "rustc_error_messages"
|
|
version = "0.0.0"
|
|
edition = "2024"
|
|
|
|
[dependencies]
|
|
# tidy-alphabetical-start
|
|
fluent-bundle = "0.16"
|
|
icu_list = { version = "2.0", default-features = false, features = ["alloc"] }
|
|
icu_locale = { version = "2.0", default-features = false }
|
|
intl-memoizer = "0.5.1"
|
|
rustc_baked_icu_data = { path = "../rustc_baked_icu_data" }
|
|
rustc_data_structures = { path = "../rustc_data_structures" }
|
|
rustc_macros = { path = "../rustc_macros" }
|
|
rustc_serialize = { path = "../rustc_serialize" }
|
|
rustc_span = { path = "../rustc_span" }
|
|
unic-langid = { version = "0.9.0", features = ["macros"] }
|
|
# tidy-alphabetical-end
|