Auto merge of #88611 - m-ou-se:array-into-iter-new-deprecate, r=joshtriplett

Deprecate array::IntoIter::new.
This commit is contained in:
bors 2021-12-05 12:53:01 +00:00
commit 1597728ef5
25 changed files with 69 additions and 99 deletions

View file

@ -1043,7 +1043,7 @@ impl Build {
options[1] = Some(format!("-Clink-arg=-Wl,{}", threads));
}
std::array::IntoIter::new(options).flatten()
IntoIterator::into_iter(options).flatten()
}
/// Returns if this target should statically link the C runtime, if specified

View file

@ -6,6 +6,7 @@
#![crate_type = "proc-macro"]
extern crate proc_macro;
use std::iter::FromIterator;
use std::str::FromStr;
use proc_macro::*;
@ -23,7 +24,7 @@ pub fn custom_quote(input: TokenStream) -> TokenStream {
let set_span_method = TokenStream::from_str("ident.set_span").unwrap();
let set_span_arg = TokenStream::from(TokenTree::Group(Group::new(Delimiter::Parenthesis, quoted_span)));
let suffix = TokenStream::from_str(";proc_macro::TokenStream::from(proc_macro::TokenTree::Ident(ident))").unwrap();
let full_stream: TokenStream = std::array::IntoIter::new([prefix, set_span_method, set_span_arg, suffix]).collect();
let full_stream = TokenStream::from_iter([prefix, set_span_method, set_span_arg, suffix]);
full_stream
}
_ => unreachable!()

View file

@ -13,7 +13,6 @@ use clippy_utils::{
remove_blocks, strip_pat_refs,
};
use clippy_utils::{paths, search_same, SpanlessEq, SpanlessHash};
use core::array;
use core::iter::{once, ExactSizeIterator};
use if_chain::if_chain;
use rustc_ast::ast::{Attribute, LitKind};
@ -1306,7 +1305,7 @@ fn check_match_like_matches<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>)
return find_matches_sugg(
cx,
let_expr,
array::IntoIter::new([(&[][..], Some(let_pat), if_then, None), (&[][..], None, if_else, None)]),
IntoIterator::into_iter([(&[][..], Some(let_pat), if_then, None), (&[][..], None, if_else, None)]),
expr,
true,
);