Rename DiagnosticMessage
as DiagMessage
.
This commit is contained in:
parent
d849f5c225
commit
18715c98c6
49 changed files with 253 additions and 261 deletions
|
@ -3,8 +3,8 @@ use std::num::NonZero;
|
|||
use rustc_ast::token;
|
||||
use rustc_ast::util::literal::LitError;
|
||||
use rustc_errors::{
|
||||
codes::*, Diag, DiagCtxt, DiagnosticMessage, EmissionGuarantee, ErrorGuaranteed,
|
||||
IntoDiagnostic, Level, MultiSpan,
|
||||
codes::*, Diag, DiagCtxt, DiagMessage, EmissionGuarantee, ErrorGuaranteed, IntoDiagnostic,
|
||||
Level, MultiSpan,
|
||||
};
|
||||
use rustc_macros::Diagnostic;
|
||||
use rustc_span::{Span, Symbol};
|
||||
|
@ -14,7 +14,7 @@ use crate::parse::ParseSess;
|
|||
|
||||
pub struct FeatureGateError {
|
||||
pub span: MultiSpan,
|
||||
pub explain: DiagnosticMessage,
|
||||
pub explain: DiagMessage,
|
||||
}
|
||||
|
||||
impl<'a, G: EmissionGuarantee> IntoDiagnostic<'a, G> for FeatureGateError {
|
||||
|
|
|
@ -15,8 +15,8 @@ use rustc_data_structures::fx::{FxHashMap, FxIndexMap, FxIndexSet};
|
|||
use rustc_data_structures::sync::{AppendOnlyVec, Lock, Lrc};
|
||||
use rustc_errors::emitter::{stderr_destination, HumanEmitter, SilentEmitter};
|
||||
use rustc_errors::{
|
||||
fallback_fluent_bundle, ColorConfig, Diag, DiagCtxt, DiagnosticMessage, EmissionGuarantee,
|
||||
MultiSpan, StashKey,
|
||||
fallback_fluent_bundle, ColorConfig, Diag, DiagCtxt, DiagMessage, EmissionGuarantee, MultiSpan,
|
||||
StashKey,
|
||||
};
|
||||
use rustc_feature::{find_feature_issue, GateIssue, UnstableFeatures};
|
||||
use rustc_span::edition::Edition;
|
||||
|
@ -85,7 +85,7 @@ pub fn feature_err(
|
|||
sess: &Session,
|
||||
feature: Symbol,
|
||||
span: impl Into<MultiSpan>,
|
||||
explain: impl Into<DiagnosticMessage>,
|
||||
explain: impl Into<DiagMessage>,
|
||||
) -> Diag<'_> {
|
||||
feature_err_issue(sess, feature, span, GateIssue::Language, explain)
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ pub fn feature_err_issue(
|
|||
feature: Symbol,
|
||||
span: impl Into<MultiSpan>,
|
||||
issue: GateIssue,
|
||||
explain: impl Into<DiagnosticMessage>,
|
||||
explain: impl Into<DiagMessage>,
|
||||
) -> Diag<'_> {
|
||||
let span = span.into();
|
||||
|
||||
|
@ -290,7 +290,7 @@ impl ParseSess {
|
|||
lint: &'static Lint,
|
||||
span: impl Into<MultiSpan>,
|
||||
node_id: NodeId,
|
||||
msg: impl Into<DiagnosticMessage>,
|
||||
msg: impl Into<DiagMessage>,
|
||||
) {
|
||||
self.buffered_lints.with_lock(|buffered_lints| {
|
||||
buffered_lints.push(BufferedEarlyLint {
|
||||
|
@ -308,7 +308,7 @@ impl ParseSess {
|
|||
lint: &'static Lint,
|
||||
span: impl Into<MultiSpan>,
|
||||
node_id: NodeId,
|
||||
msg: impl Into<DiagnosticMessage>,
|
||||
msg: impl Into<DiagMessage>,
|
||||
diagnostic: BuiltinLintDiagnostics,
|
||||
) {
|
||||
self.buffered_lints.with_lock(|buffered_lints| {
|
||||
|
|
|
@ -22,8 +22,8 @@ use rustc_errors::emitter::{stderr_destination, DynEmitter, HumanEmitter, HumanR
|
|||
use rustc_errors::json::JsonEmitter;
|
||||
use rustc_errors::registry::Registry;
|
||||
use rustc_errors::{
|
||||
codes::*, fallback_fluent_bundle, Diag, DiagCtxt, DiagnosticMessage, ErrorGuaranteed,
|
||||
FatalAbort, FluentBundle, IntoDiagnostic, LazyFallbackBundle, TerminalUrl,
|
||||
codes::*, fallback_fluent_bundle, Diag, DiagCtxt, DiagMessage, ErrorGuaranteed, FatalAbort,
|
||||
FluentBundle, IntoDiagnostic, LazyFallbackBundle, TerminalUrl,
|
||||
};
|
||||
use rustc_macros::HashStable_Generic;
|
||||
pub use rustc_span::def_id::StableCrateId;
|
||||
|
@ -1419,38 +1419,38 @@ impl EarlyDiagCtxt {
|
|||
|
||||
#[allow(rustc::untranslatable_diagnostic)]
|
||||
#[allow(rustc::diagnostic_outside_of_impl)]
|
||||
pub fn early_note(&self, msg: impl Into<DiagnosticMessage>) {
|
||||
pub fn early_note(&self, msg: impl Into<DiagMessage>) {
|
||||
self.dcx.note(msg)
|
||||
}
|
||||
|
||||
#[allow(rustc::untranslatable_diagnostic)]
|
||||
#[allow(rustc::diagnostic_outside_of_impl)]
|
||||
pub fn early_help(&self, msg: impl Into<DiagnosticMessage>) {
|
||||
pub fn early_help(&self, msg: impl Into<DiagMessage>) {
|
||||
self.dcx.struct_help(msg).emit()
|
||||
}
|
||||
|
||||
#[allow(rustc::untranslatable_diagnostic)]
|
||||
#[allow(rustc::diagnostic_outside_of_impl)]
|
||||
#[must_use = "ErrorGuaranteed must be returned from `run_compiler` in order to exit with a non-zero status code"]
|
||||
pub fn early_err(&self, msg: impl Into<DiagnosticMessage>) -> ErrorGuaranteed {
|
||||
pub fn early_err(&self, msg: impl Into<DiagMessage>) -> ErrorGuaranteed {
|
||||
self.dcx.err(msg)
|
||||
}
|
||||
|
||||
#[allow(rustc::untranslatable_diagnostic)]
|
||||
#[allow(rustc::diagnostic_outside_of_impl)]
|
||||
pub fn early_fatal(&self, msg: impl Into<DiagnosticMessage>) -> ! {
|
||||
pub fn early_fatal(&self, msg: impl Into<DiagMessage>) -> ! {
|
||||
self.dcx.fatal(msg)
|
||||
}
|
||||
|
||||
#[allow(rustc::untranslatable_diagnostic)]
|
||||
#[allow(rustc::diagnostic_outside_of_impl)]
|
||||
pub fn early_struct_fatal(&self, msg: impl Into<DiagnosticMessage>) -> Diag<'_, FatalAbort> {
|
||||
pub fn early_struct_fatal(&self, msg: impl Into<DiagMessage>) -> Diag<'_, FatalAbort> {
|
||||
self.dcx.struct_fatal(msg)
|
||||
}
|
||||
|
||||
#[allow(rustc::untranslatable_diagnostic)]
|
||||
#[allow(rustc::diagnostic_outside_of_impl)]
|
||||
pub fn early_warn(&self, msg: impl Into<DiagnosticMessage>) {
|
||||
pub fn early_warn(&self, msg: impl Into<DiagMessage>) {
|
||||
self.dcx.warn(msg)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue