Skip to content

Commit 2186847

Browse files
committed
move structural_traits into assembly
1 parent 2b0f572 commit 2186847

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

compiler/rustc_trait_selection/src/solve/assembly.rs renamed to compiler/rustc_trait_selection/src/solve/assembly/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//! Code shared by trait and projection goals for candidate assembly.
22
33
use super::search_graph::OverflowHandler;
4-
#[cfg(doc)]
5-
use super::trait_goals::structural_traits::*;
64
use super::{EvalCtxt, SolverMode};
75
use crate::solve::CanonicalResponseExt;
86
use crate::traits::coherence;
@@ -16,6 +14,8 @@ use rustc_middle::ty::TypeFoldable;
1614
use rustc_middle::ty::{self, Ty, TyCtxt};
1715
use std::fmt::Debug;
1816

17+
pub(super) mod structural_traits;
18+
1919
/// A candidate is a possible way to prove a goal.
2020
///
2121
/// It consists of both the `source`, which describes how that goal would be proven,

compiler/rustc_trait_selection/src/solve/trait_goals/structural_traits.rs renamed to compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::solve::EvalCtxt;
1111
//
1212
// For types with an "existential" binder, i.e. generator witnesses, we also
1313
// instantiate the binder with placeholders eagerly.
14-
pub(super) fn instantiate_constituent_tys_for_auto_trait<'tcx>(
14+
pub(crate) fn instantiate_constituent_tys_for_auto_trait<'tcx>(
1515
ecx: &EvalCtxt<'_, 'tcx>,
1616
ty: Ty<'tcx>,
1717
) -> Result<Vec<Ty<'tcx>>, NoSolution> {
@@ -87,7 +87,7 @@ pub(super) fn instantiate_constituent_tys_for_auto_trait<'tcx>(
8787
}
8888
}
8989

90-
fn replace_erased_lifetimes_with_bound_vars<'tcx>(
90+
pub(crate) fn replace_erased_lifetimes_with_bound_vars<'tcx>(
9191
tcx: TyCtxt<'tcx>,
9292
ty: Ty<'tcx>,
9393
) -> ty::Binder<'tcx, Ty<'tcx>> {
@@ -108,7 +108,7 @@ fn replace_erased_lifetimes_with_bound_vars<'tcx>(
108108
ty::Binder::bind_with_vars(ty, bound_vars)
109109
}
110110

111-
pub(super) fn instantiate_constituent_tys_for_sized_trait<'tcx>(
111+
pub(crate) fn instantiate_constituent_tys_for_sized_trait<'tcx>(
112112
ecx: &EvalCtxt<'_, 'tcx>,
113113
ty: Ty<'tcx>,
114114
) -> Result<Vec<Ty<'tcx>>, NoSolution> {
@@ -158,7 +158,7 @@ pub(super) fn instantiate_constituent_tys_for_sized_trait<'tcx>(
158158
}
159159
}
160160

161-
pub(super) fn instantiate_constituent_tys_for_copy_clone_trait<'tcx>(
161+
pub(crate) fn instantiate_constituent_tys_for_copy_clone_trait<'tcx>(
162162
ecx: &EvalCtxt<'_, 'tcx>,
163163
ty: Ty<'tcx>,
164164
) -> Result<Vec<Ty<'tcx>>, NoSolution> {

compiler/rustc_trait_selection/src/solve/project_goals.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::traits::specialization_graph;
22

3-
use super::assembly;
4-
use super::trait_goals::structural_traits;
3+
use super::assembly::{self, structural_traits};
54
use super::EvalCtxt;
65
use rustc_errors::ErrorGuaranteed;
76
use rustc_hir::def::DefKind;

compiler/rustc_trait_selection/src/solve/trait_goals.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Dealing with trait goals, i.e. `T: Trait<'a, U>`.
22
3-
use super::{assembly, EvalCtxt, SolverMode};
3+
use super::assembly::{self, structural_traits};
4+
use super::{EvalCtxt, SolverMode};
45
use rustc_hir::def_id::DefId;
56
use rustc_hir::LangItem;
67
use rustc_infer::traits::query::NoSolution;
@@ -11,8 +12,6 @@ use rustc_middle::ty::{self, ToPredicate, Ty, TyCtxt};
1112
use rustc_middle::ty::{TraitPredicate, TypeVisitableExt};
1213
use rustc_span::DUMMY_SP;
1314

14-
pub mod structural_traits;
15-
1615
impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
1716
fn self_ty(self) -> Ty<'tcx> {
1817
self.self_ty()

0 commit comments

Comments
 (0)