Move ExpectedFound::new to ty::error.
This commit is contained in:
parent
c851db9495
commit
551cc5ebe6
2 changed files with 10 additions and 10 deletions
|
|
@ -557,16 +557,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T> ExpectedFound<T> {
|
||||
pub fn new(a_is_expected: bool, a: T, b: T) -> Self {
|
||||
if a_is_expected {
|
||||
ExpectedFound { expected: a, found: b }
|
||||
} else {
|
||||
ExpectedFound { expected: b, found: a }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx, T> InferOk<'tcx, T> {
|
||||
pub fn unit(self) -> InferOk<'tcx, ()> {
|
||||
InferOk { value: (), obligations: self.obligations }
|
||||
|
|
|
|||
|
|
@ -15,6 +15,16 @@ pub struct ExpectedFound<T> {
|
|||
pub found: T,
|
||||
}
|
||||
|
||||
impl<T> ExpectedFound<T> {
|
||||
pub fn new(a_is_expected: bool, a: T, b: T) -> Self {
|
||||
if a_is_expected {
|
||||
ExpectedFound { expected: a, found: b }
|
||||
} else {
|
||||
ExpectedFound { expected: b, found: a }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Data structures used in type unification
|
||||
#[derive(Clone, Debug, TypeFoldable)]
|
||||
pub enum TypeError<'tcx> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue