]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_infer/infer/error_reporting/mod.rs
Auto merge of #71049 - eddyb:const-err, r=oli-obk
[rust.git] / src / librustc_infer / infer / error_reporting / mod.rs
index ebeb5df63271b39574577618521b6012d8c99ff8..3711d848d814018d92908a120cc40bde6418541e 100644 (file)
@@ -871,7 +871,7 @@ fn cmp_type_arg(
                 return Some(());
             }
             if let &ty::Adt(def, _) = &ta.kind {
-                let path_ = self.tcx.def_path_str(def.did.clone());
+                let path_ = self.tcx.def_path_str(def.did);
                 if path_ == other_path {
                     self.highlight_outer(&mut t1_out, &mut t2_out, path, sub, i, &other_ty);
                     return Some(());
@@ -1091,8 +1091,8 @@ fn push_ty_ref<'tcx>(
                 let sub_no_defaults_1 = self.strip_generic_default_params(def1.did, sub1);
                 let sub_no_defaults_2 = self.strip_generic_default_params(def2.did, sub2);
                 let mut values = (DiagnosticStyledString::new(), DiagnosticStyledString::new());
-                let path1 = self.tcx.def_path_str(def1.did.clone());
-                let path2 = self.tcx.def_path_str(def2.did.clone());
+                let path1 = self.tcx.def_path_str(def1.did);
+                let path2 = self.tcx.def_path_str(def2.did);
                 if def1.did == def2.did {
                     // Easy case. Replace same types with `_` to shorten the output and highlight
                     // the differing ones.