diff options
| author | Romain Perier <romain.perier@gmail.com> | 2025-05-25 15:15:49 +0200 |
|---|---|---|
| committer | Romain Perier <romain.perier@gmail.com> | 2025-06-18 16:01:41 +0200 |
| commit | a1a3bef6f0d5f5f45f0296133d7af745dc89d7bb (patch) | |
| tree | ec68e7afb6fc2ba1b3353835ecdc205fd82e1449 /compiler/rustc_lint/src/lib.rs | |
| parent | 6f935a044d1ddeb6160494a6320d008d7c311aef (diff) | |
| download | rust-a1a3bef6f0d5f5f45f0296133d7af745dc89d7bb.tar.gz rust-a1a3bef6f0d5f5f45f0296133d7af745dc89d7bb.zip | |
Implement lint against direct uses of rustc_type_ir in compiler crates
This commit adds a lint to prevent the use of rustc_type_ir in random compiler crates, except for type system internals traits, which are explicitly allowed. Moreover, this fixes diagnostic_items() to include the CRATE_OWNER_ID, otherwise rustc_diagnostic_item attribute is ignored on the crate root.
Diffstat (limited to 'compiler/rustc_lint/src/lib.rs')
| -rw-r--r-- | compiler/rustc_lint/src/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index 9a1490d3eea..20568f35a47 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -668,6 +668,7 @@ fn register_internals(store: &mut LintStore) { LintId::of(USAGE_OF_TYPE_IR_TRAITS), LintId::of(BAD_OPT_ACCESS), LintId::of(SPAN_USE_EQ_CTXT), + LintId::of(DIRECT_USE_OF_RUSTC_TYPE_IR), ], ); } |
