Update to the rustfmt in rust 1.29, which is now stable.

This commit is contained in:
Dan Gohman
2018-09-13 12:59:25 -07:00
parent f23ea04242
commit 53a0c6c67f
30 changed files with 305 additions and 135 deletions

View File

@@ -99,8 +99,7 @@ impl ArgAssigner for Args {
RU::r14
} else {
RU::rsi
} as RegUnit)
.into()
} as RegUnit).into()
}
// This is SpiderMonkey's `WasmTableCallSigReg`.
ArgumentPurpose::SignatureId => return ArgumentLoc::Reg(RU::r10 as RegUnit).into(),

View File

@@ -569,8 +569,7 @@ pub fn handle_return_abi(inst: Inst, func: &mut Function, cfg: &ControlFlowGraph
rt.purpose == ArgumentPurpose::Link
|| rt.purpose == ArgumentPurpose::StructReturn
|| rt.purpose == ArgumentPurpose::VMContext
})
.count();
}).count();
let abi_args = func.signature.returns.len() - special_args;
let pos = &mut FuncCursor::new(func).at_inst(inst);
@@ -689,8 +688,7 @@ fn spill_call_arguments(pos: &mut FuncCursor) -> bool {
}
_ => None,
}
})
.collect::<Vec<_>>()
}).collect::<Vec<_>>()
};
if arglist.is_empty() {

View File

@@ -3,7 +3,10 @@
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)]
#![warn(unused_import_braces)]
#![cfg_attr(feature = "std", deny(unstable_features))]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(
feature = "clippy",
plugin(clippy(conf_file = "../../clippy.toml"))
)]
#![cfg_attr(feature="cargo-clippy", allow(
// This requires Rust 1.27 or later.
duration_subsec,
@@ -32,8 +35,14 @@
#![cfg_attr(
feature = "cargo-clippy",
warn(
float_arithmetic, mut_mut, nonminimal_bool, option_map_unwrap_or, option_map_unwrap_or_else,
print_stdout, unicode_not_nfc, use_self
float_arithmetic,
mut_mut,
nonminimal_bool,
option_map_unwrap_or,
option_map_unwrap_or_else,
print_stdout,
unicode_not_nfc,
use_self
)
)]
// Turns on no_std and alloc features if std is not available.

View File

@@ -902,10 +902,9 @@ impl<'a> Context<'a> {
}
Table(jt) => {
let lr = &self.liveness[value];
!lr.is_local()
&& self.cur.func.jump_tables[jt]
.entries()
.any(|(_, ebb)| lr.is_livein(ebb, ctx))
!lr.is_local() && self.cur.func.jump_tables[jt]
.entries()
.any(|(_, ebb)| lr.is_livein(ebb, ctx))
}
}
}

View File

@@ -220,8 +220,7 @@ fn get_or_create<'a>(
func.dfg
.call_signature(inst)
.map(|sig| Affinity::abi(&func.dfg.signatures[sig].returns[rnum], isa))
})
.unwrap_or_default();
}).unwrap_or_default();
}
ValueDef::Param(ebb, num) => {
def = ebb.into();

View File

@@ -463,8 +463,7 @@ impl<'a> Context<'a> {
}
}
None
})
.min_by(|&a, &b| {
}).min_by(|&a, &b| {
// Find the minimum candidate according to the RPO of their defs.
self.domtree.rpo_cmp(
self.cur.func.dfg.value_def(a),

View File

@@ -113,7 +113,8 @@ impl<'a> FlagsVerifier<'a> {
.encinfo
.as_ref()
.and_then(|ei| ei.operand_constraints(self.func.encodings[inst]))
.map_or(false, |c| c.clobbers_flags) && live_val.is_some()
.map_or(false, |c| c.clobbers_flags)
&& live_val.is_some()
{
return fatal!(errors, inst, "encoding clobbers live CPU flags in {}", live);
}

View File

@@ -941,11 +941,11 @@ impl<'a> Verifier<'a> {
);
}
// The defining EBB dominates the instruction using this value.
if is_reachable
&& !self
.expected_domtree
.dominates(ebb, loc_inst, &self.func.layout)
{
if is_reachable && !self.expected_domtree.dominates(
ebb,
loc_inst,
&self.func.layout,
) {
return fatal!(
errors,
loc_inst,
@@ -1039,7 +1039,8 @@ impl<'a> Verifier<'a> {
for (&prev_ebb, &next_ebb) in domtree.cfg_postorder().iter().adjacent_pairs() {
if self
.expected_domtree
.rpo_cmp(prev_ebb, next_ebb, &self.func.layout) != Ordering::Greater
.rpo_cmp(prev_ebb, next_ebb, &self.func.layout)
!= Ordering::Greater
{
return fatal!(
errors,
@@ -1586,8 +1587,8 @@ impl<'a> Verifier<'a> {
let encoding = self.func.encodings[inst];
if encoding.is_legal() {
let mut encodings =
isa.legal_encodings(
let mut encodings = isa
.legal_encodings(
&self.func,
&self.func.dfg[inst],
self.func.dfg.ctrl_typevar(inst),