about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-03-12 08:13:28 +0100
committerGitHub <noreply@github.com>2023-03-12 08:13:28 +0100
commitc9a38c3c697cb9db276178ec3690a08f599d38d4 (patch)
treef4df6664f96dbba838a9a5739956ed1ccf1951cc
parent738c4bf176cc2bae9d51e19b292f8f5f1ce4fd0b (diff)
parent898d2c14e3e538056800499598b54e3d2daa5b87 (diff)
downloadrust-c9a38c3c697cb9db276178ec3690a08f599d38d4.tar.gz
rust-c9a38c3c697cb9db276178ec3690a08f599d38d4.zip
Rollup merge of #109017 - klensy:dupe, r=cjgillot
remove duplicated calls to sort_string

`with_forced_trimmed_paths!` was removed in https://github.com/rust-lang/rust/commit/62ba3e70a1f01d801d068b84a097e38bd82a8c6e, and this lines became dups.
-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) => {