Skip to content

Commit bbd0e83

Browse files
Rename rustc_mir_transform/src/errors.rs into rustc_mir_transform/src/diagnostics.rs
1 parent 93d56ce commit bbd0e83

14 files changed

Lines changed: 41 additions & 41 deletions

compiler/rustc_mir_transform/src/check_call_recursion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_middle::ty::{self, GenericArg, GenericArgs, Instance, Ty, TyCtxt, Unno
1010
use rustc_session::lint::builtin::UNCONDITIONAL_RECURSION;
1111
use rustc_span::Span;
1212

13-
use crate::errors::UnconditionalRecursion;
13+
use crate::diagnostics::UnconditionalRecursion;
1414
use crate::pass_manager::MirLint;
1515

1616
pub(super) struct CheckCallRecursion;

compiler/rustc_mir_transform/src/check_const_item_mutation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc_session::lint::builtin::CONST_ITEM_MUTATION;
66
use rustc_span::Span;
77
use rustc_span::def_id::DefId;
88

9-
use crate::errors;
9+
use crate::diagnostics;
1010

1111
pub(super) struct CheckConstItemMutation;
1212

@@ -108,7 +108,7 @@ impl<'tcx> Visitor<'tcx> for ConstMutationChecker<'_, 'tcx> {
108108
CONST_ITEM_MUTATION,
109109
lint_root,
110110
span,
111-
errors::ConstMutate::Modify { konst: item },
111+
diagnostics::ConstMutate::Modify { konst: item },
112112
);
113113
}
114114

@@ -154,7 +154,7 @@ impl<'tcx> Visitor<'tcx> for ConstMutationChecker<'_, 'tcx> {
154154
CONST_ITEM_MUTATION,
155155
lint_root,
156156
span,
157-
errors::ConstMutate::MutBorrow { method_call, konst: item },
157+
diagnostics::ConstMutate::MutBorrow { method_call, konst: item },
158158
);
159159
}
160160
}

compiler/rustc_mir_transform/src/check_inline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl<'tcx> MirLint<'tcx> for CheckForceInline {
2626
if let Err(reason) =
2727
is_inline_valid_on_fn(tcx, def_id).and_then(|_| is_inline_valid_on_body(tcx, body))
2828
{
29-
tcx.dcx().emit_err(crate::errors::InvalidForceInline {
29+
tcx.dcx().emit_err(crate::diagnostics::InvalidForceInline {
3030
attr_span,
3131
callee_span: tcx.def_span(def_id),
3232
callee: tcx.def_path_str(def_id),

compiler/rustc_mir_transform/src/check_packed_ref.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc_middle::mir::*;
33
use rustc_middle::span_bug;
44
use rustc_middle::ty::{self, TyCtxt};
55

6-
use crate::{errors, util};
6+
use crate::{diagnostics, util};
77

88
pub(super) struct CheckPackedRef;
99

@@ -50,7 +50,7 @@ impl<'tcx> Visitor<'tcx> for PackedRefChecker<'_, 'tcx> {
5050
// shouldn't do.
5151
span_bug!(self.source_info.span, "builtin derive created an unaligned reference");
5252
} else {
53-
self.tcx.dcx().emit_err(errors::UnalignedPackedRef {
53+
self.tcx.dcx().emit_err(diagnostics::UnalignedPackedRef {
5454
span: self.source_info.span,
5555
ty_descr: adt.descr(),
5656
align: pack.bytes(),

compiler/rustc_mir_transform/src/coroutine/layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use rustc_trait_selection::infer::TyCtxtInferExt as _;
4646
use rustc_trait_selection::traits::{ObligationCause, ObligationCauseCode, ObligationCtxt};
4747
use tracing::{debug, instrument, trace};
4848

49-
use crate::errors::{MustNotSupend, MustNotSuspendReason};
49+
use crate::diagnostics::{MustNotSupend, MustNotSuspendReason};
5050

5151
const SELF_ARG: Local = Local::arg(0);
5252

File renamed without changes.

compiler/rustc_mir_transform/src/ffi_unwind_calls.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_session::lint::builtin::FFI_UNWIND_CALLS;
99
use rustc_target::spec::PanicStrategy;
1010
use tracing::debug;
1111

12-
use crate::errors;
12+
use crate::diagnostics;
1313

1414
// Check if the body of this def_id can possibly leak a foreign unwind into Rust code.
1515
fn has_ffi_unwind_calls(tcx: TyCtxt<'_>, local_def_id: LocalDefId) -> bool {
@@ -67,7 +67,7 @@ fn has_ffi_unwind_calls(tcx: TyCtxt<'_>, local_def_id: LocalDefId) -> bool {
6767
FFI_UNWIND_CALLS,
6868
lint_root,
6969
span,
70-
errors::AsmUnwindCall { span },
70+
diagnostics::AsmUnwindCall { span },
7171
);
7272

7373
tainted = true;
@@ -119,7 +119,7 @@ fn has_ffi_unwind_calls(tcx: TyCtxt<'_>, local_def_id: LocalDefId) -> bool {
119119
FFI_UNWIND_CALLS,
120120
lint_root,
121121
span,
122-
errors::FfiUnwindCall { span, foreign },
122+
diagnostics::FfiUnwindCall { span, foreign },
123123
);
124124

125125
tainted = true;

compiler/rustc_mir_transform/src/function_item_references.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_middle::ty::{self, EarlyBinder, GenericArgsRef, Ty, TyCtxt};
77
use rustc_session::lint::builtin::FUNCTION_ITEM_REFERENCES;
88
use rustc_span::{Span, Spanned, sym};
99

10-
use crate::errors;
10+
use crate::diagnostics;
1111

1212
pub(super) struct FunctionItemReferences;
1313

@@ -179,7 +179,7 @@ impl<'tcx> FunctionItemRefChecker<'_, 'tcx> {
179179
FUNCTION_ITEM_REFERENCES,
180180
lint_root,
181181
span,
182-
errors::FnItemRef { span, sugg, ident },
182+
diagnostics::FnItemRef { span, sugg, ident },
183183
);
184184
}
185185
}

compiler/rustc_mir_transform/src/inline.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl<'tcx> Inliner<'tcx> for ForceInliner<'tcx> {
253253

254254
let call_span = callsite.source_info.span;
255255
let callee = tcx.def_path_str(callsite.callee.def_id());
256-
tcx.dcx().emit_err(crate::errors::ForceInlineFailure {
256+
tcx.dcx().emit_err(crate::diagnostics::ForceInlineFailure {
257257
call_span,
258258
attr_span,
259259
caller_span: tcx.def_span(self.def_id),
@@ -262,7 +262,7 @@ impl<'tcx> Inliner<'tcx> for ForceInliner<'tcx> {
262262
callee: callee.clone(),
263263
reason,
264264
justification: justification
265-
.map(|sym| crate::errors::ForceInlineJustification { sym, callee }),
265+
.map(|sym| crate::diagnostics::ForceInlineJustification { sym, callee }),
266266
});
267267
}
268268
}

compiler/rustc_mir_transform/src/known_panics_lint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use rustc_middle::ty::{self, ConstInt, ScalarInt, Ty, TyCtxt, TypeVisitableExt,
2222
use rustc_span::Span;
2323
use tracing::{debug, instrument, trace};
2424

25-
use crate::errors::{AssertLint, AssertLintKind};
25+
use crate::diagnostics::{AssertLint, AssertLintKind};
2626

2727
pub(super) struct KnownPanicsLint;
2828

0 commit comments

Comments
 (0)