remove invalid suggestion of into_iter for extern macro
This commit is contained in:
parent
dc37ff82e8
commit
c45463ec8b
4 changed files with 56 additions and 5 deletions
|
@ -905,11 +905,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
} else if self.impl_into_iterator_should_be_iterator(rcvr_ty, span, unsatisfied_predicates)
|
||||
{
|
||||
err.span_label(span, format!("`{rcvr_ty}` is not an iterator"));
|
||||
err.multipart_suggestion_verbose(
|
||||
"call `.into_iter()` first",
|
||||
vec![(span.shrink_to_lo(), format!("into_iter()."))],
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
if !span.in_external_macro(self.tcx.sess.source_map()) {
|
||||
err.multipart_suggestion_verbose(
|
||||
"call `.into_iter()` first",
|
||||
vec![(span.shrink_to_lo(), format!("into_iter()."))],
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
}
|
||||
return err.emit();
|
||||
} else if !unsatisfied_predicates.is_empty() && matches!(rcvr_ty.kind(), ty::Param(_)) {
|
||||
// We special case the situation where we are looking for `_` in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue