Use iter::zip in compiler/
This commit is contained in:
parent
3b1f5e3462
commit
72ebebe474
87 changed files with 213 additions and 204 deletions
|
@ -9,6 +9,7 @@
|
|||
#![feature(const_panic)]
|
||||
#![feature(crate_visibility_modifier)]
|
||||
#![feature(in_band_lifetimes)]
|
||||
#![feature(iter_zip)]
|
||||
#![feature(nll)]
|
||||
#![cfg_attr(bootstrap, feature(or_patterns))]
|
||||
#![recursion_limit = "256"]
|
||||
|
|
|
@ -103,6 +103,7 @@ use rustc_span::Span;
|
|||
use std::collections::VecDeque;
|
||||
use std::io;
|
||||
use std::io::prelude::*;
|
||||
use std::iter;
|
||||
use std::rc::Rc;
|
||||
|
||||
mod rwu_table;
|
||||
|
@ -1093,7 +1094,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
|
|||
let ia = &asm.inner;
|
||||
let outputs = asm.outputs_exprs;
|
||||
let inputs = asm.inputs_exprs;
|
||||
let succ = ia.outputs.iter().zip(outputs).rev().fold(succ, |succ, (o, output)| {
|
||||
let succ = iter::zip(&ia.outputs, outputs).rev().fold(succ, |succ, (o, output)| {
|
||||
// see comment on places
|
||||
// in propagate_through_place_components()
|
||||
if o.is_indirect {
|
||||
|
@ -1344,7 +1345,7 @@ fn check_expr<'tcx>(this: &mut Liveness<'_, 'tcx>, expr: &'tcx Expr<'tcx>) {
|
|||
}
|
||||
|
||||
// Output operands must be places
|
||||
for (o, output) in asm.inner.outputs.iter().zip(asm.outputs_exprs) {
|
||||
for (o, output) in iter::zip(&asm.inner.outputs, asm.outputs_exprs) {
|
||||
if !o.is_indirect {
|
||||
this.check_place(output);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
use crate::liveness::{LiveNode, Variable};
|
||||
use std::iter;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub(super) struct RWU {
|
||||
|
@ -91,7 +92,7 @@ impl RWUTable {
|
|||
|
||||
let mut changed = false;
|
||||
let (dst_row, src_row) = self.pick2_rows_mut(dst, src);
|
||||
for (dst_word, src_word) in dst_row.iter_mut().zip(src_row.iter()) {
|
||||
for (dst_word, src_word) in iter::zip(dst_row, &*src_row) {
|
||||
let old = *dst_word;
|
||||
let new = *dst_word | src_word;
|
||||
*dst_word = new;
|
||||
|
|
|
@ -22,6 +22,7 @@ use rustc_span::symbol::{sym, Symbol};
|
|||
use rustc_span::{Span, DUMMY_SP};
|
||||
|
||||
use std::cmp::Ordering;
|
||||
use std::iter;
|
||||
use std::mem::replace;
|
||||
use std::num::NonZeroU32;
|
||||
|
||||
|
@ -214,7 +215,7 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
|
|||
{
|
||||
// Explicit version of iter::order::lt to handle parse errors properly
|
||||
for (dep_v, stab_v) in
|
||||
dep_since.as_str().split('.').zip(stab_since.as_str().split('.'))
|
||||
iter::zip(dep_since.as_str().split('.'), stab_since.as_str().split('.'))
|
||||
{
|
||||
match stab_v.parse::<u64>() {
|
||||
Err(_) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue