Auto merge of #92070 - rukai:replace_vec_into_iter_with_array_into_iter, r=Mark-Simulacrum
Replace usages of vec![].into_iter with [].into_iter `[].into_iter` is idiomatic over `vec![].into_iter` because its simpler and faster (unless the vec is optimized away in which case it would be the same) So we should change all the implementation, documentation and tests to use it. I skipped: * `src/tools` - Those are copied in from upstream * `src/test/ui` - Hard to tell if `vec![].into_iter` was used intentionally or not here and not much benefit to changing it. * any case where `vec![].into_iter` was used because we specifically needed a `Vec::IntoIter<T>` * any case where it looked like we were intentionally using `vec![].into_iter` to test it.
This commit is contained in:
commit
2e2c86eba2
36 changed files with 116 additions and 122 deletions
|
@ -455,7 +455,7 @@ impl DiagnosticSpan {
|
|||
let backtrace_step = backtrace.next().map(|bt| {
|
||||
let call_site = Self::from_span_full(bt.call_site, false, None, None, backtrace, je);
|
||||
let def_site_span =
|
||||
Self::from_span_full(bt.def_site, false, None, None, vec![].into_iter(), je);
|
||||
Self::from_span_full(bt.def_site, false, None, None, [].into_iter(), je);
|
||||
Box::new(DiagnosticSpanMacroExpansion {
|
||||
span: call_site,
|
||||
macro_decl_name: bt.kind.descr(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue