Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/librustc/mir/interpret/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,10 @@ impl AllocDecodingState {
}

pub fn new(data_offsets: Vec<u32>) -> AllocDecodingState {
let decoding_state: Vec<_> = ::std::iter::repeat(Mutex::new(State::Empty))
.take(data_offsets.len())
.collect();
let decoding_state = vec![Mutex::new(State::Empty); data_offsets.len()];

AllocDecodingState {
decoding_state: decoding_state,
decoding_state,
data_offsets,
}
}
Expand Down
6 changes: 1 addition & 5 deletions src/librustc/traits/error_reporting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use hir::def_id::DefId;
use infer::{self, InferCtxt};
use infer::type_variable::TypeVariableOrigin;
use std::fmt;
use std::iter;
use syntax::ast;
use session::DiagnosticMessageId;
use ty::{self, AdtKind, ToPredicate, ToPolyTraitRef, Ty, TyCtxt, TypeFoldable};
Expand Down Expand Up @@ -1095,10 +1094,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
// found arguments is empty (assume the user just wants to ignore args in this case).
// For example, if `expected_args_length` is 2, suggest `|_, _|`.
if found_args.is_empty() && is_closure {
let underscores = iter::repeat("_")
.take(expected_args.len())
.collect::<Vec<_>>()
.join(", ");
let underscores = vec!["_"; expected_args.len()].join(", ");
err.span_suggestion_with_applicability(
found_span,
&format!(
Expand Down