From a1a3bef6f0d5f5f45f0296133d7af745dc89d7bb Mon Sep 17 00:00:00 2001 From: Romain Perier Date: Sun, 25 May 2025 15:15:49 +0200 Subject: 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. --- compiler/rustc_errors/src/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'compiler/rustc_errors') diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 9f72fc4705a..08e4f61e629 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -7,6 +7,7 @@ #![allow(internal_features)] #![allow(rustc::diagnostic_outside_of_impl)] #![allow(rustc::untranslatable_diagnostic)] +#![cfg_attr(not(bootstrap), allow(rustc::direct_use_of_rustc_type_ir))] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![doc(rust_logo)] #![feature(array_windows)] -- cgit 1.4.1-3-g733a5