Skip to content

Commit 551cc5e

Browse files
committed
Move ExpectedFound::new to ty::error.
1 parent c851db9 commit 551cc5e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/librustc/infer/mod.rs

-10
Original file line numberDiff line numberDiff line change
@@ -557,16 +557,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
557557
}
558558
}
559559

560-
impl<T> ExpectedFound<T> {
561-
pub fn new(a_is_expected: bool, a: T, b: T) -> Self {
562-
if a_is_expected {
563-
ExpectedFound { expected: a, found: b }
564-
} else {
565-
ExpectedFound { expected: b, found: a }
566-
}
567-
}
568-
}
569-
570560
impl<'tcx, T> InferOk<'tcx, T> {
571561
pub fn unit(self) -> InferOk<'tcx, ()> {
572562
InferOk { value: (), obligations: self.obligations }

src/librustc/ty/error.rs

+10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ pub struct ExpectedFound<T> {
1515
pub found: T,
1616
}
1717

18+
impl<T> ExpectedFound<T> {
19+
pub fn new(a_is_expected: bool, a: T, b: T) -> Self {
20+
if a_is_expected {
21+
ExpectedFound { expected: a, found: b }
22+
} else {
23+
ExpectedFound { expected: b, found: a }
24+
}
25+
}
26+
}
27+
1828
// Data structures used in type unification
1929
#[derive(Clone, Debug, TypeFoldable)]
2030
pub enum TypeError<'tcx> {

0 commit comments

Comments
 (0)