]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir_typeck/src/method/suggest.rs
Merge from rustc
[rust.git] / compiler / rustc_hir_typeck / src / method / suggest.rs
index 63cec9216eb89fa70f262db6c73cb57b4eee1d6b..7c5a9a333feba56da059e18d4b90b1cf1563db56 100644 (file)
@@ -689,6 +689,16 @@ pub fn report_method_error(
                                 let entry = spanned_predicates.entry(spans);
                                 entry.or_insert_with(|| (path, tr_self_ty, Vec::new())).2.push(p);
                             }
+                            Some(Node::Item(hir::Item {
+                                kind: hir::ItemKind::Trait(rustc_ast::ast::IsAuto::Yes, ..),
+                                span: item_span,
+                                ..
+                            })) => {
+                                tcx.sess.delay_span_bug(
+                                        *item_span,
+                                        "auto trait is invoked with no method error, but no error reported?",
+                                    );
+                            }
                             Some(_) => unreachable!(),
                             None => (),
                         }
@@ -997,7 +1007,7 @@ trait bound{s}",
                         if def_kind == DefKind::AssocFn && lev_candidate.fn_has_self_parameter {
                             err.span_suggestion(
                                 span,
-                                &format!("there is a method with a similar name",),
+                                "there is a method with a similar name",
                                 lev_candidate.name,
                                 Applicability::MaybeIncorrect,
                             );