From 64c61a32f6051fe769928b09bfb6e829b74d6f5e Mon Sep 17 00:00:00 2001 From: jam1garner <8260240+jam1garner@users.noreply.github.com> Date: Fri, 28 May 2021 00:55:32 -0400 Subject: [PATCH] Fix `future_prelude_collision` adding unneeded generic arguments --- compiler/rustc_typeck/src/check/method/mod.rs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/compiler/rustc_typeck/src/check/method/mod.rs b/compiler/rustc_typeck/src/check/method/mod.rs index 2198455c163..4a855d6e408 100644 --- a/compiler/rustc_typeck/src/check/method/mod.rs +++ b/compiler/rustc_typeck/src/check/method/mod.rs @@ -210,22 +210,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { call_expr.span, |lint| { let sp = call_expr.span; - let type_name = self.tcx.def_path_str(pick.item.container.id()); - let type_generics = self.tcx.generics_of(pick.item.container.id()); - let parameter_count = - type_generics.count() - (type_generics.has_self as usize); - let trait_name = if parameter_count == 0 { - type_name - } else { - format!( - "{}<{}>", - type_name, - std::iter::repeat("_") - .take(parameter_count) - .collect::>() - .join(", ") - ) - }; + let trait_name = self.tcx.def_path_str(pick.item.container.id()); let mut lint = lint.build(&format!( "trait method `{}` will become ambiguous in Rust 2021",