Skip to content

Commit a2d5819

Browse files
committed
Auto merge of rust-lang#127493 - compiler-errors:crate-level-import, r=lcnr
Move trait selection error reporting to its own top-level module This effectively moves `rustc_trait_selection::traits::error_reporting` to `rustc_trait_selection::error_reporting::traits`. There are only a couple of actual changes to the code, like moving the `pretty_impl_header` fn out of the specialization module for privacy reasons. This is quite pointless on its own, but having `error_reporting` as a top-level module in `rustc_trait_selection` is very important to make sure we have a meaningful file structure for when we move **type** error reporting (and region error reporting, with which it's incredibly entangled currently) into `rustc_trait_selection`. I've opened a tracking issue here: rust-lang#127492 r? lcnr
2 parents 8672b2b + fe4c995 commit a2d5819

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+127
-123
lines changed

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ use rustc_span::def_id::LocalDefId;
3434
use rustc_span::hygiene::DesugaringKind;
3535
use rustc_span::symbol::{kw, sym, Ident};
3636
use rustc_span::{BytePos, Span, Symbol};
37+
use rustc_trait_selection::error_reporting::traits::suggestions::TypeErrCtxtExt;
38+
use rustc_trait_selection::error_reporting::traits::FindExprBySpan;
3739
use rustc_trait_selection::infer::InferCtxtExt;
38-
use rustc_trait_selection::traits::error_reporting::suggestions::TypeErrCtxtExt;
39-
use rustc_trait_selection::traits::error_reporting::FindExprBySpan;
4040
use rustc_trait_selection::traits::{Obligation, ObligationCause, ObligationCtxt};
4141
use std::iter;
4242
use std::ops::ControlFlow;

compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rustc_middle::ty::adjustment::PointerCoercion;
1717
use rustc_middle::ty::{self, RegionVid, Ty, TyCtxt};
1818
use rustc_span::symbol::{kw, Symbol};
1919
use rustc_span::{sym, DesugaringKind, Span};
20-
use rustc_trait_selection::traits::error_reporting::FindExprBySpan;
20+
use rustc_trait_selection::error_reporting::traits::FindExprBySpan;
2121

2222
use crate::region_infer::{BlameConstraint, ExtraConstraintInfo};
2323
use crate::{

compiler/rustc_borrowck/src/diagnostics/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ use rustc_span::def_id::LocalDefId;
2727
use rustc_span::source_map::Spanned;
2828
use rustc_span::{symbol::sym, Span, Symbol, DUMMY_SP};
2929
use rustc_target::abi::{FieldIdx, VariantIdx};
30+
use rustc_trait_selection::error_reporting::traits::suggestions::TypeErrCtxtExt as _;
3031
use rustc_trait_selection::infer::InferCtxtExt;
31-
use rustc_trait_selection::traits::error_reporting::suggestions::TypeErrCtxtExt as _;
3232
use rustc_trait_selection::traits::{
3333
type_known_to_meet_bound_modulo_regions, FulfillmentErrorCode,
3434
};

compiler/rustc_borrowck/src/diagnostics/move_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_middle::mir::*;
99
use rustc_middle::ty::{self, Ty};
1010
use rustc_mir_dataflow::move_paths::{LookupResult, MovePathIndex};
1111
use rustc_span::{BytePos, ExpnKind, MacroKind, Span};
12-
use rustc_trait_selection::traits::error_reporting::FindExprBySpan;
12+
use rustc_trait_selection::error_reporting::traits::FindExprBySpan;
1313

1414
use crate::diagnostics::CapturedMessageOpt;
1515
use crate::diagnostics::{DescribePlaceOpt, UseSpans};

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ use rustc_middle::{
1616
use rustc_span::symbol::{kw, Symbol};
1717
use rustc_span::{sym, BytePos, DesugaringKind, Span};
1818
use rustc_target::abi::FieldIdx;
19+
use rustc_trait_selection::error_reporting::traits::suggestions::TypeErrCtxtExt;
1920
use rustc_trait_selection::infer::InferCtxtExt;
2021
use rustc_trait_selection::traits;
21-
use rustc_trait_selection::traits::error_reporting::suggestions::TypeErrCtxtExt;
2222

2323
use crate::diagnostics::BorrowedContentSource;
2424
use crate::util::FindAssignments;

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_middle::ty::visit::TypeVisitableExt;
1111
use rustc_middle::ty::{self, OpaqueHiddenType, OpaqueTypeKey, Ty, TyCtxt, TypeFoldable};
1212
use rustc_middle::ty::{GenericArgKind, GenericArgs};
1313
use rustc_span::Span;
14-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt as _;
14+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt as _;
1515
use rustc_trait_selection::traits::ObligationCtxt;
1616

1717
use crate::session_diagnostics::LifetimeMismatchOpaqueParam;

compiler/rustc_borrowck/src/type_check/free_region_relations.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use rustc_middle::traits::query::OutlivesBound;
1111
use rustc_middle::traits::ObligationCause;
1212
use rustc_middle::ty::{self, RegionVid, Ty, TypeVisitableExt};
1313
use rustc_span::{ErrorGuaranteed, Span};
14+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt;
1415
use rustc_trait_selection::solve::deeply_normalize;
15-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt;
1616
use rustc_trait_selection::traits::query::type_op::{self, TypeOp};
1717
use std::rc::Rc;
1818
use type_op::TypeOpOutput;

compiler/rustc_const_eval/src/check_consts/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_middle::ty::{self, adjustment::PointerCoercion, Ty, TyCtxt};
1313
use rustc_middle::ty::{Instance, InstanceKind, TypeVisitableExt};
1414
use rustc_mir_dataflow::Analysis;
1515
use rustc_span::{sym, Span, Symbol, DUMMY_SP};
16-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt as _;
16+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt as _;
1717
use rustc_trait_selection::traits::{self, ObligationCauseCode, ObligationCtxt};
1818
use rustc_type_ir::visit::{TypeSuperVisitable, TypeVisitor};
1919

compiler/rustc_hir_analysis/src/check/check.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ use rustc_middle::ty::{
2525
};
2626
use rustc_session::lint::builtin::{UNINHABITED_STATIC, UNSUPPORTED_CALLING_CONVENTIONS};
2727
use rustc_target::abi::FieldIdx;
28+
use rustc_trait_selection::error_reporting::traits::on_unimplemented::OnUnimplementedDirective;
29+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt as _;
2830
use rustc_trait_selection::traits;
29-
use rustc_trait_selection::traits::error_reporting::on_unimplemented::OnUnimplementedDirective;
30-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt as _;
3131
use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt as _;
3232
use rustc_type_ir::fold::TypeFoldable;
3333

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ use rustc_middle::ty::{
2121
use rustc_middle::ty::{GenericParamDefKind, TyCtxt};
2222
use rustc_middle::{bug, span_bug};
2323
use rustc_span::Span;
24+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt;
2425
use rustc_trait_selection::infer::InferCtxtExt;
2526
use rustc_trait_selection::regions::InferCtxtRegionExt;
26-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt;
2727
use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt as _;
2828
use rustc_trait_selection::traits::{
2929
self, FulfillmentError, ObligationCause, ObligationCauseCode, ObligationCtxt, Reveal,

compiler/rustc_hir_analysis/src/check/entry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_session::config::EntryFnType;
77
use rustc_span::def_id::{DefId, LocalDefId, CRATE_DEF_ID};
88
use rustc_span::{symbol::sym, Span};
99
use rustc_target::spec::abi::Abi;
10-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt as _;
10+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt as _;
1111
use rustc_trait_selection::traits::{self, ObligationCause, ObligationCauseCode};
1212

1313
use std::ops::Not;

compiler/rustc_hir_analysis/src/check/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ use rustc_span::symbol::{kw, sym, Ident};
9696
use rustc_span::{def_id::CRATE_DEF_ID, BytePos, Span, Symbol, DUMMY_SP};
9797
use rustc_target::abi::VariantIdx;
9898
use rustc_target::spec::abi::Abi;
99-
use rustc_trait_selection::traits::error_reporting::suggestions::{
99+
use rustc_trait_selection::error_reporting::traits::suggestions::{
100100
ReturnsVisitor, TypeErrCtxtExt as _,
101101
};
102-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt as _;
102+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt as _;
103103
use rustc_trait_selection::traits::ObligationCtxt;
104104

105105
use crate::errors;

compiler/rustc_hir_analysis/src/check/wfcheck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ use rustc_session::parse::feature_err;
2929
use rustc_span::symbol::{sym, Ident};
3030
use rustc_span::{Span, DUMMY_SP};
3131
use rustc_target::spec::abi::Abi;
32+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt;
3233
use rustc_trait_selection::regions::InferCtxtRegionExt;
33-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt;
3434
use rustc_trait_selection::traits::misc::{
3535
type_allowed_to_implement_const_param_ty, ConstParamTyImplementationError,
3636
};

compiler/rustc_hir_analysis/src/coherence/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rustc_middle::ty::adjustment::CoerceUnsizedInfo;
1717
use rustc_middle::ty::print::PrintTraitRefExt as _;
1818
use rustc_middle::ty::{self, suggest_constraining_type_params, Ty, TyCtxt, TypeVisitableExt};
1919
use rustc_span::{Span, DUMMY_SP};
20-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt;
20+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt;
2121
use rustc_trait_selection::traits::misc::{
2222
type_allowed_to_implement_const_param_ty, type_allowed_to_implement_copy,
2323
ConstParamTyImplementationError, CopyImplementationError, InfringingFieldsReason,

compiler/rustc_hir_analysis/src/collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ use rustc_span::symbol::{kw, sym, Ident, Symbol};
3535
use rustc_span::{Span, DUMMY_SP};
3636
use rustc_target::abi::FieldIdx;
3737
use rustc_target::spec::abi;
38+
use rustc_trait_selection::error_reporting::traits::suggestions::NextTypeParamName;
3839
use rustc_trait_selection::infer::InferCtxtExt;
39-
use rustc_trait_selection::traits::error_reporting::suggestions::NextTypeParamName;
4040
use rustc_trait_selection::traits::ObligationCtxt;
4141
use std::cell::Cell;
4242
use std::iter;

compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::errors::{
44
};
55
use crate::fluent_generated as fluent;
66
use crate::hir_ty_lowering::HirTyLowerer;
7-
use crate::traits::error_reporting::report_object_safety_error;
87
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
98
use rustc_data_structures::sorted_map::SortedMap;
109
use rustc_data_structures::unord::UnordMap;
@@ -27,6 +26,7 @@ use rustc_span::edit_distance::find_best_match_for_name;
2726
use rustc_span::symbol::{kw, sym, Ident};
2827
use rustc_span::BytePos;
2928
use rustc_span::{Span, Symbol, DUMMY_SP};
29+
use rustc_trait_selection::error_reporting::traits::report_object_safety_error;
3030
use rustc_trait_selection::traits::FulfillmentError;
3131
use rustc_trait_selection::traits::{
3232
object_safety_violations_for_assoc_item, TraitAliasExpansionInfo,

compiler/rustc_hir_analysis/src/hir_ty_lowering/lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_hir as hir;
44
use rustc_hir::def::{DefKind, Res};
55
use rustc_lint_defs::{builtin::BARE_TRAIT_OBJECTS, Applicability};
66
use rustc_span::Span;
7-
use rustc_trait_selection::traits::error_reporting::suggestions::NextTypeParamName;
7+
use rustc_trait_selection::error_reporting::traits::suggestions::NextTypeParamName;
88

99
use super::HirTyLowerer;
1010

compiler/rustc_hir_analysis/src/hir_ty_lowering/object_safety.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_middle::ty::fold::BottomUpFolder;
1313
use rustc_middle::ty::{self, ExistentialPredicateStableCmpExt as _, Ty, TyCtxt, TypeFoldable};
1414
use rustc_middle::ty::{DynKind, Upcast};
1515
use rustc_span::{ErrorGuaranteed, Span};
16-
use rustc_trait_selection::traits::error_reporting::report_object_safety_error;
16+
use rustc_trait_selection::error_reporting::traits::report_object_safety_error;
1717
use rustc_trait_selection::traits::{self, hir_ty_lowering_object_safety_violations};
1818

1919
use smallvec::{smallvec, SmallVec};

compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ use rustc_middle::ty::trait_def::TraitSpecializationKind;
7878
use rustc_middle::ty::{self, TyCtxt, TypeVisitableExt};
7979
use rustc_middle::ty::{GenericArg, GenericArgs, GenericArgsRef};
8080
use rustc_span::{ErrorGuaranteed, Span};
81-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt;
81+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt;
8282
use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt as _;
8383
use rustc_trait_selection::traits::{self, translate_args_with_cause, wf, ObligationCtxt};
8484

compiler/rustc_hir_typeck/src/callee.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ use rustc_span::def_id::LocalDefId;
2424
use rustc_span::symbol::{sym, Ident};
2525
use rustc_span::Span;
2626
use rustc_target::spec::abi;
27+
use rustc_trait_selection::error_reporting::traits::DefIdOrName;
2728
use rustc_trait_selection::infer::InferCtxtExt as _;
28-
use rustc_trait_selection::traits::error_reporting::DefIdOrName;
2929
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _;
3030

3131
use std::{iter, slice};

compiler/rustc_hir_typeck/src/closure.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ use rustc_middle::ty::{self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitor};
1717
use rustc_span::def_id::LocalDefId;
1818
use rustc_span::Span;
1919
use rustc_target::spec::abi::Abi;
20+
use rustc_trait_selection::error_reporting::traits::ArgKind;
21+
use rustc_trait_selection::error_reporting::traits::InferCtxtExt as _;
2022
use rustc_trait_selection::traits;
21-
use rustc_trait_selection::traits::error_reporting::ArgKind;
22-
use rustc_trait_selection::traits::error_reporting::InferCtxtExt as _;
2323
use rustc_type_ir::ClosureKind;
2424
use std::iter;
2525
use std::ops::ControlFlow;

compiler/rustc_hir_typeck/src/coercion.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ use rustc_session::parse::feature_err;
5858
use rustc_span::symbol::sym;
5959
use rustc_span::{BytePos, DesugaringKind, Span, DUMMY_SP};
6060
use rustc_target::spec::abi::Abi;
61+
use rustc_trait_selection::error_reporting::traits::suggestions::TypeErrCtxtExt;
62+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt as _;
6163
use rustc_trait_selection::infer::InferCtxtExt as _;
62-
use rustc_trait_selection::traits::error_reporting::suggestions::TypeErrCtxtExt;
63-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt as _;
6464
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt;
6565
use rustc_trait_selection::traits::{
6666
self, NormalizeExt, ObligationCause, ObligationCauseCode, ObligationCtxt,

compiler/rustc_hir_typeck/src/expr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ use rustc_span::source_map::Spanned;
5353
use rustc_span::symbol::{kw, sym, Ident, Symbol};
5454
use rustc_span::Span;
5555
use rustc_target::abi::{FieldIdx, FIRST_VARIANT};
56+
use rustc_trait_selection::error_reporting::traits::suggestions::TypeErrCtxtExt as _;
57+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt;
5658
use rustc_trait_selection::infer::InferCtxtExt;
57-
use rustc_trait_selection::traits::error_reporting::suggestions::TypeErrCtxtExt as _;
58-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt;
5959
use rustc_trait_selection::traits::ObligationCtxt;
6060
use rustc_trait_selection::traits::{self, ObligationCauseCode};
6161

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use rustc_span::hygiene::DesugaringKind;
3737
use rustc_span::symbol::{kw, sym};
3838
use rustc_span::Span;
3939
use rustc_target::abi::FieldIdx;
40-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt as _;
40+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt as _;
4141
use rustc_trait_selection::traits::{
4242
self, NormalizeExt, ObligationCauseCode, ObligationCtxt, StructurallyNormalizeExt,
4343
};

compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ use rustc_session::errors::ExprParenthesesNeeded;
3232
use rustc_span::source_map::Spanned;
3333
use rustc_span::symbol::{sym, Ident};
3434
use rustc_span::{Span, Symbol};
35+
use rustc_trait_selection::error_reporting::traits::suggestions::TypeErrCtxtExt;
36+
use rustc_trait_selection::error_reporting::traits::DefIdOrName;
3537
use rustc_trait_selection::infer::InferCtxtExt;
3638
use rustc_trait_selection::traits;
37-
use rustc_trait_selection::traits::error_reporting::suggestions::TypeErrCtxtExt;
38-
use rustc_trait_selection::traits::error_reporting::DefIdOrName;
3939
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _;
4040

4141
impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

compiler/rustc_hir_typeck/src/method/suggest.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ use rustc_span::def_id::DefIdSet;
3535
use rustc_span::symbol::{kw, sym, Ident};
3636
use rustc_span::{edit_distance, ErrorGuaranteed, ExpnKind, FileName, MacroKind, Span};
3737
use rustc_span::{Symbol, DUMMY_SP};
38+
use rustc_trait_selection::error_reporting::traits::on_unimplemented::OnUnimplementedNote;
39+
use rustc_trait_selection::error_reporting::traits::on_unimplemented::TypeErrCtxtExt as _;
3840
use rustc_trait_selection::infer::InferCtxtExt;
39-
use rustc_trait_selection::traits::error_reporting::on_unimplemented::OnUnimplementedNote;
40-
use rustc_trait_selection::traits::error_reporting::on_unimplemented::TypeErrCtxtExt as _;
4141
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _;
4242
use rustc_trait_selection::traits::{
4343
supertraits, FulfillmentError, Obligation, ObligationCause, ObligationCauseCode,

compiler/rustc_hir_typeck/src/op.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use rustc_session::errors::ExprParenthesesNeeded;
1818
use rustc_span::source_map::Spanned;
1919
use rustc_span::symbol::{sym, Ident};
2020
use rustc_span::Span;
21+
use rustc_trait_selection::error_reporting::traits::suggestions::TypeErrCtxtExt as _;
2122
use rustc_trait_selection::infer::InferCtxtExt;
22-
use rustc_trait_selection::traits::error_reporting::suggestions::TypeErrCtxtExt as _;
2323
use rustc_trait_selection::traits::{FulfillmentError, ObligationCtxt};
2424
use rustc_type_ir::TyKind::*;
2525

compiler/rustc_hir_typeck/src/writeback.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use rustc_middle::ty::TypeSuperFoldable;
1818
use rustc_middle::ty::{self, Ty, TyCtxt};
1919
use rustc_span::symbol::sym;
2020
use rustc_span::Span;
21+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt;
2122
use rustc_trait_selection::solve;
22-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt;
2323

2424
use std::mem;
2525

compiler/rustc_lint/src/async_fn_in_trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::LateContext;
33
use crate::LateLintPass;
44
use rustc_hir as hir;
55
use rustc_session::{declare_lint, declare_lint_pass};
6-
use rustc_trait_selection::traits::error_reporting::suggestions::suggest_desugaring_async_fn_to_impl_future_in_trait;
6+
use rustc_trait_selection::error_reporting::traits::suggestions::suggest_desugaring_async_fn_to_impl_future_in_trait;
77

88
declare_lint! {
99
/// The `async_fn_in_trait` lint detects use of `async fn` in the

compiler/rustc_lint/src/non_local_def.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use rustc_session::{declare_lint, impl_lint_pass};
1111
use rustc_span::def_id::{DefId, LOCAL_CRATE};
1212
use rustc_span::Span;
1313
use rustc_span::{sym, symbol::kw, ExpnKind, MacroKind, Symbol};
14-
use rustc_trait_selection::infer::TyCtxtInferExt;
15-
use rustc_trait_selection::traits::error_reporting::ambiguity::{
14+
use rustc_trait_selection::error_reporting::traits::ambiguity::{
1615
compute_applicable_impls_for_diagnostics, CandidateSource,
1716
};
17+
use rustc_trait_selection::infer::TyCtxtInferExt;
1818

1919
use crate::fluent_generated as fluent;
2020
use crate::lints::{NonLocalDefinitionsCargoUpdateNote, NonLocalDefinitionsDiag};

compiler/rustc_mir_transform/src/coroutine.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ use rustc_span::symbol::sym;
8181
use rustc_span::Span;
8282
use rustc_target::abi::{FieldIdx, VariantIdx};
8383
use rustc_target::spec::PanicStrategy;
84+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt as _;
8485
use rustc_trait_selection::infer::TyCtxtInferExt as _;
85-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt as _;
8686
use rustc_trait_selection::traits::ObligationCtxt;
8787
use rustc_trait_selection::traits::{ObligationCause, ObligationCauseCode};
8888
use std::{iter, ops};

compiler/rustc_passes/src/check_attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ use rustc_session::parse::feature_err;
3434
use rustc_span::symbol::{kw, sym, Symbol};
3535
use rustc_span::{BytePos, Span, DUMMY_SP};
3636
use rustc_target::spec::abi::Abi;
37+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt;
3738
use rustc_trait_selection::infer::{TyCtxtInferExt, ValuePairs};
38-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt;
3939
use rustc_trait_selection::traits::ObligationCtxt;
4040
use std::cell::Cell;
4141
use std::collections::hash_map::Entry;

compiler/rustc_passes/src/layout_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_span::source_map::Spanned;
88
use rustc_span::symbol::sym;
99
use rustc_span::Span;
1010
use rustc_target::abi::{HasDataLayout, TargetDataLayout};
11-
use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt;
11+
use rustc_trait_selection::error_reporting::traits::TypeErrCtxtExt;
1212
use rustc_trait_selection::{infer::TyCtxtInferExt, traits};
1313

1414
use crate::errors::{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod traits;

0 commit comments

Comments
 (0)