about summary refs log tree commit diff
diff options
context:
space:
mode:
authorklensy <klensy@users.noreply.github.com>2023-03-11 16:15:06 +0300
committerklensy <klensy@users.noreply.github.com>2023-03-11 16:15:06 +0300
commit898d2c14e3e538056800499598b54e3d2daa5b87 (patch)
treee2005ddf9f97e48ca35a6b49bc6a843a547dcbdb
parent19c53768af6e48514238e4224b5bf5ecd51bc7b1 (diff)
downloadrust-898d2c14e3e538056800499598b54e3d2daa5b87.tar.gz
rust-898d2c14e3e538056800499598b54e3d2daa5b87.zip
remove duplicated calls to sort_string
-rw-r--r--compiler/rustc_middle/src/ty/error.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/compiler/rustc_middle/src/ty/error.rs b/compiler/rustc_middle/src/ty/error.rs
index 9c171a69d06..aff6c77e039 100644
--- a/compiler/rustc_middle/src/ty/error.rs
+++ b/compiler/rustc_middle/src/ty/error.rs
@@ -151,12 +151,8 @@ impl<'tcx> TypeError<'tcx> {
             .into(),
             RegionsPlaceholderMismatch => "one type is more general than the other".into(),
             ArgumentSorts(values, _) | Sorts(values) => {
-                let mut expected = values.expected.sort_string(tcx);
-                let mut found = values.found.sort_string(tcx);
-                if expected == found {
-                    expected = values.expected.sort_string(tcx);
-                    found = values.found.sort_string(tcx);
-                }
+                let expected = values.expected.sort_string(tcx);
+                let found = values.found.sort_string(tcx);
                 report_maybe_different(&expected, &found).into()
             }
             Traits(values) => {