|
1 | 1 | use crate::traits;
|
2 | 2 | use crate::traits::project::Normalized;
|
3 |
| -use rustc_middle::ty::fold::{FallibleTypeFolder, TypeFoldable}; |
4 |
| -use rustc_middle::ty::visit::{TypeVisitable, TypeVisitor}; |
5 |
| -use rustc_middle::ty::{self, TyCtxt}; |
| 3 | +use rustc_middle::ty; |
6 | 4 |
|
7 | 5 | use std::fmt;
|
8 |
| -use std::ops::ControlFlow; |
9 | 6 |
|
10 | 7 | // Structural impls for the structs in `traits`.
|
11 | 8 |
|
@@ -57,31 +54,3 @@ impl<'tcx> fmt::Debug for traits::MismatchedProjectionTypes<'tcx> {
|
57 | 54 | write!(f, "MismatchedProjectionTypes({:?})", self.err)
|
58 | 55 | }
|
59 | 56 | }
|
60 |
| - |
61 |
| -/////////////////////////////////////////////////////////////////////////// |
62 |
| -// TypeFoldable implementations. |
63 |
| - |
64 |
| -impl<'tcx, O: TypeFoldable<TyCtxt<'tcx>>> TypeFoldable<TyCtxt<'tcx>> |
65 |
| - for traits::Obligation<'tcx, O> |
66 |
| -{ |
67 |
| - fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( |
68 |
| - self, |
69 |
| - folder: &mut F, |
70 |
| - ) -> Result<Self, F::Error> { |
71 |
| - Ok(traits::Obligation { |
72 |
| - cause: self.cause, |
73 |
| - recursion_depth: self.recursion_depth, |
74 |
| - predicate: self.predicate.try_fold_with(folder)?, |
75 |
| - param_env: self.param_env.try_fold_with(folder)?, |
76 |
| - }) |
77 |
| - } |
78 |
| -} |
79 |
| - |
80 |
| -impl<'tcx, O: TypeVisitable<TyCtxt<'tcx>>> TypeVisitable<TyCtxt<'tcx>> |
81 |
| - for traits::Obligation<'tcx, O> |
82 |
| -{ |
83 |
| - fn visit_with<V: TypeVisitor<TyCtxt<'tcx>>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy> { |
84 |
| - self.predicate.visit_with(visitor)?; |
85 |
| - self.param_env.visit_with(visitor) |
86 |
| - } |
87 |
| -} |
0 commit comments