diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2020-01-22 13:55:05 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2020-02-05 12:42:00 +0100 |
| commit | 551cc5ebe626e93b23d02eb9ff363943e7505e52 (patch) | |
| tree | 8b0f2dc652715088cba64216de7197e419c68c87 | |
| parent | c851db94951643c2b200b13bf6d8ab6d5fdb541e (diff) | |
| download | rust-551cc5ebe626e93b23d02eb9ff363943e7505e52.tar.gz rust-551cc5ebe626e93b23d02eb9ff363943e7505e52.zip | |
Move ExpectedFound::new to ty::error.
| -rw-r--r-- | src/librustc/infer/mod.rs | 10 | ||||
| -rw-r--r-- | src/librustc/ty/error.rs | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs index 1f1ff1fd8bc..4681a47317c 100644 --- a/src/librustc/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -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 } diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs index 217ca0ca3f6..0282f409b32 100644 --- a/src/librustc/ty/error.rs +++ b/src/librustc/ty/error.rs @@ -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> { |
