Rollup merge of #157700 - GuillaumeGomez:rename-err-to-diag-2, r=JonathanBrouwer

Rename `errors.rs` file to `diagnostics.rs` (5/N)

Follow-up of https://github.com/rust-lang/rust/pull/157485.

r? @JonathanBrouwer
This commit is contained in:
Jacob Pratt
2026-06-11 00:34:18 -04:00
committed by GitHub
13 changed files with 13 additions and 13 deletions

View File

@@ -18,7 +18,7 @@ use crate::builder::expr::category::{Category, RvalueFunc};
use crate::builder::matches::{DeclareLetBindings, Exhaustive, HasMatchGuard};
use crate::builder::scope::LintLevel;
use crate::builder::{BlockAnd, BlockAndExtension, BlockFrame, Builder, NeedsTemporary};
use crate::errors::{LoopMatchArmWithGuard, LoopMatchUnsupportedType};
use crate::diagnostics::{LoopMatchArmWithGuard, LoopMatchUnsupportedType};
impl<'a, 'tcx> Builder<'a, 'tcx> {
/// Compile `expr`, storing the result into `destination`, which

View File

@@ -44,7 +44,7 @@ use rustc_span::{Span, Symbol};
use crate::builder::expr::as_place::PlaceBuilder;
use crate::builder::scope::{DropKind, LintLevel};
use crate::errors;
use crate::diagnostics;
pub(crate) fn closure_saved_names_of_captured_variables<'tcx>(
tcx: TyCtxt<'tcx>,
@@ -931,7 +931,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
lint::builtin::UNREACHABLE_CODE,
lint_root,
target_loc.span,
errors::UnreachableDueToUninhabited {
diagnostics::UnreachableDueToUninhabited {
expr: target_loc.span,
orig: orig_span,
descr,

View File

@@ -99,7 +99,7 @@ use tracing::{debug, instrument};
use super::matches::BuiltMatchTree;
use crate::builder::{BlockAnd, BlockAndExtension, BlockFrame, Builder, CFG};
use crate::errors::{
use crate::diagnostics::{
ConstContinueBadConst, ConstContinueNotMonomorphicConst, ConstContinueUnknownJumpTarget,
};
@@ -924,7 +924,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
| ExprKind::NamedConst { .. } => self.as_constant(&self.thir[value]),
other => {
use crate::errors::ConstContinueNotMonomorphicConstReason as Reason;
use crate::diagnostics::ConstContinueNotMonomorphicConstReason as Reason;
let span = expr.span;
let reason = match other {

View File

@@ -16,7 +16,7 @@ use rustc_session::lint::builtin::{DEPRECATED_SAFE_2024, UNSAFE_OP_IN_UNSAFE_FN,
use rustc_span::def_id::{DefId, LocalDefId};
use rustc_span::{Span, Symbol};
use crate::errors::*;
use crate::diagnostics::*;
struct UnsafetyVisitor<'a, 'tcx> {
tcx: TyCtxt<'tcx>,

View File

@@ -11,7 +11,7 @@
mod builder;
mod check_tail_calls;
mod check_unsafety;
mod errors;
mod diagnostics;
pub mod thir;
use rustc_middle::util::Providers;

View File

@@ -22,7 +22,7 @@ use rustc_middle::{bug, span_bug};
use rustc_span::Span;
use tracing::{debug, info, instrument, trace};
use crate::errors::*;
use crate::diagnostics::*;
use crate::thir::cx::ThirBuildCx;
impl<'tcx> ThirBuildCx<'tcx> {

View File

@@ -27,7 +27,7 @@ use rustc_span::{Ident, Span};
use rustc_trait_selection::infer::InferCtxtExt;
use tracing::instrument;
use crate::errors::*;
use crate::diagnostics::*;
pub(crate) fn check_match(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(), ErrorGuaranteed> {
let typeck_results = tcx.typeck(def_id);

View File

@@ -20,7 +20,7 @@ use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt;
use tracing::{debug, instrument, trace};
use super::PatCtxt;
use crate::errors::{
use crate::diagnostics::{
ConstPatternDependsOnGenericParameter, CouldNotEvalConstPattern, InvalidPattern, NaNPattern,
PointerPattern, SuggestEq, TypeNotPartialEq, TypeNotStructural, UnionPattern, UnsizedPattern,
};

View File

@@ -29,7 +29,7 @@ use tracing::{debug, instrument};
pub(crate) use self::check_match::check_match;
use self::migration::PatMigration;
use crate::errors::*;
use crate::diagnostics::*;
use crate::thir::cx::ThirBuildCx;
/// Context for lowering HIR patterns to THIR patterns.

View File

@@ -23,8 +23,8 @@ pub use self::framework::{
use self::move_paths::MoveData;
pub mod debuginfo;
mod diagnostics;
mod drop_flag_effects;
mod errors;
mod framework;
pub mod impls;
pub mod move_paths;

View File

@@ -5,7 +5,7 @@ use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_span::{Span, sym};
use tracing::{debug, info};
use crate::errors::{
use crate::diagnostics::{
PeekArgumentNotALocal, PeekArgumentUntracked, PeekBitNotSet, PeekMustBeNotTemporary,
PeekMustBePlaceOrRefPlace, StopAfterDataFlowEndedCompilation,
};