about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2024-11-23 20:19:54 +0800
committerGitHub <noreply@github.com>2024-11-23 20:19:54 +0800
commit96e8c7c7ba96b08e9eca26d1fe1f9ddbf12668e9 (patch)
treeb86a737122f83114aacbec6edf463d6f313e8c61 /compiler/rustc_middle/src
parent8036ff1302245cad6a2501e84d337019a184b1a0 (diff)
parentd294e4746bb1dae054b8e3e195b96e644e271b04 (diff)
downloadrust-96e8c7c7ba96b08e9eca26d1fe1f9ddbf12668e9.tar.gz
rust-96e8c7c7ba96b08e9eca26d1fe1f9ddbf12668e9.zip
Rollup merge of #133366 - compiler-errors:expected-found, r=dtolnay
Remove unnecessary bool from `ExpectedFound::new`

It's true almost everywhere, and the one place it's not can be replaced w/ an if statement.
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/ty/relate.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/relate.rs b/compiler/rustc_middle/src/ty/relate.rs
index 504a3c8a6d8..b06687490d2 100644
--- a/compiler/rustc_middle/src/ty/relate.rs
+++ b/compiler/rustc_middle/src/ty/relate.rs
@@ -92,7 +92,7 @@ impl<'tcx> Relate<TyCtxt<'tcx>> for &'tcx ty::List<ty::PolyExistentialPredicate<
         b_v.sort_by(|a, b| a.skip_binder().stable_cmp(tcx, &b.skip_binder()));
         b_v.dedup();
         if a_v.len() != b_v.len() {
-            return Err(TypeError::ExistentialMismatch(ExpectedFound::new(true, a, b)));
+            return Err(TypeError::ExistentialMismatch(ExpectedFound::new(a, b)));
         }
 
         let v = iter::zip(a_v, b_v).map(|(ep_a, ep_b)| {
@@ -112,7 +112,7 @@ impl<'tcx> Relate<TyCtxt<'tcx>> for &'tcx ty::List<ty::PolyExistentialPredicate<
                     ty::ExistentialPredicate::AutoTrait(a),
                     ty::ExistentialPredicate::AutoTrait(b),
                 ) if a == b => Ok(ep_a.rebind(ty::ExistentialPredicate::AutoTrait(a))),
-                _ => Err(TypeError::ExistentialMismatch(ExpectedFound::new(true, a, b))),
+                _ => Err(TypeError::ExistentialMismatch(ExpectedFound::new(a, b))),
             }
         });
         tcx.mk_poly_existential_predicates_from_iter(v)