diff options
| author | Laurențiu Nicola <lnicola@users.noreply.github.com> | 2025-06-18 07:06:44 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-18 07:06:44 +0000 |
| commit | e7971e4a9b815968139b977ece9a76b62bf4fb10 (patch) | |
| tree | cffff70f378cd396603c7bf3054cbf6a02bb4735 /compiler/rustc_errors/src | |
| parent | 20a62ab2a112fa973b4e891afd2358a23c5aef78 (diff) | |
| parent | 96e1d731ee0b8e6ba8520bf694e79953fffc5b98 (diff) | |
| download | rust-e7971e4a9b815968139b977ece9a76b62bf4fb10.tar.gz rust-e7971e4a9b815968139b977ece9a76b62bf4fb10.zip | |
Merge pull request #20032 from lnicola/sync-from-rust
minor: Sync from downstream
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 133bd361ee7..9f72fc4705a 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -60,8 +60,9 @@ pub use rustc_error_messages::{ SubdiagMessage, fallback_fluent_bundle, fluent_bundle, }; use rustc_hashes::Hash128; -use rustc_lint_defs::LintExpectationId; +use rustc_hir::HirId; 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}; @@ -101,6 +102,19 @@ 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 { + #[track_caller] + fn emit_node_span_lint( + self, + lint: &'static Lint, + hir_id: HirId, + span: impl Into<MultiSpan>, + decorator: impl for<'a> LintDiagnostic<'a, ()>, + ); +} + #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash, Encodable, Decodable)] pub enum SuggestionStyle { /// Hide the suggested code when displaying this suggestion inline. |
