about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
diff options
context:
space:
mode:
authorkadmin <julianknodt@gmail.com>2022-02-07 16:40:16 +0000
committerkadmin <julianknodt@gmail.com>2022-02-07 16:42:37 +0000
commitbe236d7fc2bab5edbd62d5250f62b448bbbaf858 (patch)
treeaa9f38d23213b6e6af89de5dd6a3e61269a86187 /compiler/rustc_trait_selection
parentfdd6f4e56c7470e939c874957f9c70e908b92f6f (diff)
downloadrust-be236d7fc2bab5edbd62d5250f62b448bbbaf858.tar.gz
rust-be236d7fc2bab5edbd62d5250f62b448bbbaf858.zip
Rm ValuePairs::Ty/Const
Remove old value pairs which is a strict subset of Terms.
Diffstat (limited to 'compiler/rustc_trait_selection')
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs25
1 files changed, 5 insertions, 20 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
index 6cb19416cd7..7f44f55c0d8 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
@@ -1378,26 +1378,11 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
                     normalized_ty,
                     data.term,
                 ) {
-                    values = Some(match (normalized_ty, data.term) {
-                        (ty::Term::Ty(normalized_ty), ty::Term::Ty(ty)) => {
-                            infer::ValuePairs::Types(ExpectedFound::new(
-                                is_normalized_ty_expected,
-                                normalized_ty,
-                                ty,
-                            ))
-                        }
-                        (ty::Term::Const(normalized_ct), ty::Term::Const(ct)) => {
-                            infer::ValuePairs::Consts(ExpectedFound::new(
-                                is_normalized_ty_expected,
-                                normalized_ct,
-                                ct,
-                            ))
-                        }
-                        (_, _) => span_bug!(
-                            obligation.cause.span,
-                            "found const or type where other expected"
-                        ),
-                    });
+                    values = Some(infer::ValuePairs::Terms(ExpectedFound::new(
+                        is_normalized_ty_expected,
+                        normalized_ty,
+                        data.term,
+                    )));
                     err_buf = error;
                     err = &err_buf;
                 }