Move attribute lints to rustc_lint

This commit is contained in:
Jonathan Brouwer 2025-12-04 20:59:53 +01:00
parent 864339abf9
commit 8f59eb0177
No known key found for this signature in database
GPG key ID: 13619B051B673C52
27 changed files with 284 additions and 344 deletions

View file

@ -64,8 +64,8 @@ pub use rustc_error_messages::{
fallback_fluent_bundle, fluent_bundle, into_diag_arg_using_display,
};
use rustc_hashes::Hash128;
use rustc_lint_defs::LintExpectationId;
pub use rustc_lint_defs::{Applicability, listify, pluralize};
use rustc_lint_defs::{Lint, LintExpectationId};
use rustc_macros::{Decodable, Encodable};
pub use rustc_span::ErrorGuaranteed;
pub use rustc_span::fatal_error::{FatalError, FatalErrorMarker};
@ -106,20 +106,6 @@ rustc_data_structures::static_assert_size!(PResult<'_, ()>, 24);
#[cfg(target_pointer_width = "64")]
rustc_data_structures::static_assert_size!(PResult<'_, bool>, 24);
/// Used to avoid depending on `rustc_middle` in `rustc_attr_parsing`.
/// Always the `TyCtxt`.
pub trait LintEmitter: Copy {
type Id: Copy;
#[track_caller]
fn emit_node_span_lint(
self,
lint: &'static Lint,
hir_id: Self::Id,
span: impl Into<MultiSpan>,
decorator: impl for<'a> LintDiagnostic<'a, ()> + DynSend + 'static,
);
}
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash, Encodable, Decodable)]
pub enum SuggestionStyle {
/// Hide the suggested code when displaying this suggestion inline.