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

This commit is contained in:
Dan Gohman
2018-12-06 16:15:48 -05:00
parent 323a9925e5
commit 5adab629f2
43 changed files with 181 additions and 177 deletions

View File

@@ -1,9 +1,5 @@
#![deny(trivial_numeric_casts)]
#![warn(
unused_import_braces,
unstable_features,
unused_extern_crates
)]
#![warn(unused_import_braces, unstable_features, unused_extern_crates)]
#![cfg_attr(
feature = "cargo-clippy",
warn(
@@ -163,26 +159,31 @@ fn main() {
.arg(add_time_flag())
.arg(add_input_file_arg())
.arg(add_debug_flag()),
).subcommand(
)
.subcommand(
SubCommand::with_name("cat")
.about("Outputs .clif file")
.arg(add_input_file_arg())
.arg(add_debug_flag()),
).subcommand(
)
.subcommand(
SubCommand::with_name("print-cfg")
.about("Prints out cfg in dot format")
.arg(add_input_file_arg())
.arg(add_debug_flag()),
).subcommand(
)
.subcommand(
add_wasm_or_compile("compile")
.arg(
Arg::with_name("just-decode")
.short("t")
.help("Just decode WebAssembly to Cranelift IR"),
).arg(Arg::with_name("check-translation").short("c").help(
)
.arg(Arg::with_name("check-translation").short("c").help(
"Just checks the correctness of Cranelift IR translated from WebAssembly",
)),
).subcommand(add_wasm_or_compile("wasm"))
)
.subcommand(add_wasm_or_compile("wasm"))
.subcommand(
SubCommand::with_name("pass")
.about("Run specified pass(s) on an input file.")
@@ -204,7 +205,8 @@ fn main() {
rest_cmd.is_present("verbose"),
rest_cmd.is_present("time-passes"),
&get_vec(rest_cmd.values_of("file")),
).map(|_time| ())
)
.map(|_time| ())
}
("pass", Some(rest_cmd)) => {
handle_debug_flag(rest_cmd.is_present("debug"));
@@ -221,7 +223,8 @@ fn main() {
&get_vec(rest_cmd.values_of("pass")),
target_val,
rest_cmd.value_of("single-file").unwrap(),
).map(|_time| ())
)
.map(|_time| ())
}
("print-cfg", Some(rest_cmd)) => {
handle_debug_flag(rest_cmd.is_present("debug"));

View File

@@ -65,7 +65,8 @@ pub fn parse_sets_and_triple(
flag_set.iter().map(|x| x.as_str()),
&mut flag_builder,
Location { line_number: 0 },
).map_err(|err| err.to_string())?;
)
.map_err(|err| err.to_string())?;
let mut words = flag_triple.trim().split_whitespace();
// Look for `target foo`.

View File

@@ -16,10 +16,7 @@
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)]
#![warn(unused_import_braces)]
#![cfg_attr(feature = "std", warn(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(new_without_default, new_without_default_derive)

View File

@@ -153,16 +153,15 @@ impl TargetIsaBuilder {
// If the intersection is the second one, then it must be a subclass.
if intersect == rc2_mask {
assert!(
self.isa
.reg_classes
.get(*i1)
.unwrap()
.subclasses
.iter()
.find(|x| **x == *i2)
.is_some()
);
assert!(self
.isa
.reg_classes
.get(*i1)
.unwrap()
.subclasses
.iter()
.find(|x| **x == *i2)
.is_some());
}
}
}
@@ -184,7 +183,8 @@ impl TargetIsaBuilder {
.values()
.filter(|x| {
x.toprc == x.index && self.isa.reg_banks.get(x.bank).unwrap().pressure_tracking
}).count();
})
.count();
assert!(num_toplevel <= 4, "Too many top-level register classes");
self.isa

View File

@@ -128,7 +128,8 @@ impl SettingGroup {
} else {
false
}
}).count() as u8
})
.count() as u8
}
pub fn byte_size(&self) -> u8 {

View File

@@ -190,19 +190,20 @@ impl LaneType {
/// Find the unique number associated with this lane type.
pub fn number(self) -> u8 {
LANE_BASE + match self {
LaneType::BoolType(base_types::Bool::B1) => 0,
LaneType::BoolType(base_types::Bool::B8) => 1,
LaneType::BoolType(base_types::Bool::B16) => 2,
LaneType::BoolType(base_types::Bool::B32) => 3,
LaneType::BoolType(base_types::Bool::B64) => 4,
LaneType::IntType(base_types::Int::I8) => 5,
LaneType::IntType(base_types::Int::I16) => 6,
LaneType::IntType(base_types::Int::I32) => 7,
LaneType::IntType(base_types::Int::I64) => 8,
LaneType::FloatType(base_types::Float::F32) => 9,
LaneType::FloatType(base_types::Float::F64) => 10,
}
LANE_BASE
+ match self {
LaneType::BoolType(base_types::Bool::B1) => 0,
LaneType::BoolType(base_types::Bool::B8) => 1,
LaneType::BoolType(base_types::Bool::B16) => 2,
LaneType::BoolType(base_types::Bool::B32) => 3,
LaneType::BoolType(base_types::Bool::B64) => 4,
LaneType::IntType(base_types::Int::I8) => 5,
LaneType::IntType(base_types::Int::I16) => 6,
LaneType::IntType(base_types::Int::I32) => 7,
LaneType::IntType(base_types::Int::I64) => 8,
LaneType::FloatType(base_types::Float::F32) => 9,
LaneType::FloatType(base_types::Float::F64) => 10,
}
}
}

View File

@@ -114,7 +114,8 @@ impl Formatter {
} else {
format!("/// {}", l)
}
}).for_each(|s| self.line(s.as_str()));
})
.for_each(|s| self.line(s.as_str()));
}
/// Add a match expression.
@@ -131,7 +132,8 @@ impl Formatter {
} else {
name.clone()
}
}).collect();
})
.collect();
let lhs = conditions.join(" | ");
fmt.line(&format!("{} => {{", lhs));
fmt.indent(|fmt| {

View File

@@ -186,7 +186,8 @@ fn relax_branch(
debug!(" trying [{}]: OK", encinfo.display(enc));
true
}
}) {
})
{
cur.func.encodings[inst] = enc;
return encinfo.byte_size(enc, inst, &divert, &cur.func);
}

View File

@@ -802,9 +802,9 @@ impl DataFlowGraph {
.remove(num as usize, &mut self.value_lists);
for index in num..(self.num_ebb_params(ebb) as u16) {
match self.values[self.ebbs[ebb]
.params
.get(index as usize, &self.value_lists)
.unwrap()]
.params
.get(index as usize, &self.value_lists)
.unwrap()]
{
ValueData::Param { ref mut num, .. } => {
*num -= 1;

View File

@@ -89,7 +89,8 @@ impl RegBank {
None
}
}
}.and_then(|offset| {
}
.and_then(|offset| {
if offset < self.units {
Some(offset + self.first_unit)
} else {

View File

@@ -98,7 +98,8 @@ 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

@@ -575,7 +575,8 @@ 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);
@@ -694,7 +695,8 @@ fn spill_call_arguments(pos: &mut FuncCursor) -> bool {
}
_ => None,
}
}).collect::<Vec<_>>()
})
.collect::<Vec<_>>()
};
if arglist.is_empty() {

View File

@@ -165,7 +165,8 @@ fn split_any(
.get_mut(
num_fixed_args + repair.hi_num,
&mut pos.func.dfg.value_lists,
).unwrap() = hi;
)
.unwrap() = hi;
} else {
// We need to append one or more arguments. If we're adding more than one argument,
// there must be pending repairs on the stack that will fill in the correct values

View File

@@ -3,10 +3,7 @@
#![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(
// Produces only a false positive:
while_let_loop,

View File

@@ -30,14 +30,16 @@ pub fn pretty_verifier_error<'a>(
&mut w,
func,
isa,
).unwrap();
)
.unwrap();
writeln!(
w,
"\n; {} verifier error{} detected (see above). Compilation aborted.",
num_errors,
if num_errors == 1 { "" } else { "s" }
).unwrap();
)
.unwrap();
w
}

View File

@@ -914,12 +914,10 @@ impl<'a> Context<'a> {
Table(jt, ebb) => {
let lr = &self.liveness[value];
!lr.is_local()
&& (ebb.map_or(false, |ebb| lr.is_livein(ebb, ctx)) || self
.cur
.func
.jump_tables[jt]
.iter()
.any(|ebb| lr.is_livein(*ebb, ctx)))
&& (ebb.map_or(false, |ebb| lr.is_livein(ebb, ctx))
|| self.cur.func.jump_tables[jt]
.iter()
.any(|ebb| lr.is_livein(*ebb, ctx)))
}
}
}

View File

@@ -116,7 +116,8 @@ impl Context {
&self.liveness,
&self.virtregs,
&mut errors,
).is_ok();
)
.is_ok();
if !ok {
return Err(errors.into());
@@ -144,7 +145,8 @@ impl Context {
&self.liveness,
&self.virtregs,
&mut errors,
).is_ok();
)
.is_ok();
if !ok {
return Err(errors.into());
@@ -171,7 +173,8 @@ impl Context {
&self.liveness,
&self.virtregs,
&mut errors,
).is_ok();
)
.is_ok();
if !ok {
return Err(errors.into());
@@ -193,7 +196,8 @@ impl Context {
&self.liveness,
&self.virtregs,
&mut errors,
).is_ok();
)
.is_ok();
if !ok {
return Err(errors.into());

View File

@@ -220,7 +220,8 @@ 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

@@ -207,7 +207,8 @@ impl<'a> fmt::Display for DisplayRegisterSet<'a> {
.unwrap_or_else(|| char::from_digit(
u32::from(offset % 10),
10
).unwrap())
)
.unwrap())
)?;
}
}

View File

@@ -264,9 +264,9 @@ impl<'a> Context<'a> {
// Same thing for spilled call return values.
let retvals = &defs[self.cur.func.dfg[inst]
.opcode()
.constraints()
.num_fixed_results()..];
.opcode()
.constraints()
.num_fixed_results()..];
if !retvals.is_empty() {
let sig = self
.cur

View File

@@ -504,7 +504,8 @@ 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

@@ -37,7 +37,7 @@ macro_rules! define_passes {
}
// Pass definitions.
define_passes!{
define_passes! {
Pass, NUM_PASSES, DESCRIPTIONS;
process_file: "Processing test file",
@@ -176,7 +176,7 @@ mod details {
}
/// Information about passes in a single thread.
thread_local!{
thread_local! {
static CURRENT_PASS: Cell<Pass> = Cell::new(Pass::None);
static PASS_TIME: RefCell<PassTimes> = RefCell::new(Default::default());
}

View File

@@ -887,11 +887,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,
@@ -1559,7 +1559,8 @@ impl<'a> Verifier<'a> {
&self.func,
&self.func.dfg[inst],
self.func.dfg.ctrl_typevar(inst),
).peekable();
)
.peekable();
if encodings.peek().is_none() {
return nonfatal!(

View File

@@ -32,10 +32,7 @@
#![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(new_without_default, new_without_default_derive)

View File

@@ -231,7 +231,8 @@ impl Backend for FaerieBackend {
from: name,
to,
at: u64::from(offset),
}).map_err(|e| ModuleError::Backend(e.to_string()))?;
})
.map_err(|e| ModuleError::Backend(e.to_string()))?;
}
for &(offset, id, addend) in data_relocs {
debug_assert_eq!(
@@ -244,7 +245,8 @@ impl Backend for FaerieBackend {
from: name,
to,
at: u64::from(offset),
}).map_err(|e| ModuleError::Backend(e.to_string()))?;
})
.map_err(|e| ModuleError::Backend(e.to_string()))?;
}
self.artifact
@@ -410,7 +412,8 @@ impl<'a> RelocSink for FaerieRelocSink<'a> {
reloc: raw_reloc,
addend: addend_i32,
},
).expect("faerie relocation error");
)
.expect("faerie relocation error");
}
fn reloc_jt(&mut self, _offset: CodeOffset, _reloc: Reloc, _jt: ir::JumpTable) {

View File

@@ -9,10 +9,7 @@
unstable_features
)]
#![warn(unused_import_braces)]
#![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(new_without_default, new_without_default_derive)

View File

@@ -106,7 +106,8 @@ fn heartbeat_thread(replies: Sender<Reply>) -> thread::JoinHandle<()> {
while replies.send(Reply::Tick).is_ok() {
thread::sleep(Duration::from_secs(1));
}
}).unwrap()
})
.unwrap()
}
/// Spawn a worker thread running tests.
@@ -153,5 +154,6 @@ fn worker_thread(
// Timing is accumulated independently per thread.
// Timings from this worker thread will be aggregated by `ConcurrentRunner::join()`.
timing::take_current()
}).unwrap()
})
.unwrap()
}

View File

@@ -317,7 +317,8 @@ impl TestRunner {
..
} => Some(dur),
_ => None,
}).collect::<Vec<_>>();
})
.collect::<Vec<_>>();
// Get me some real data, kid.
let len = times.len();

View File

@@ -514,10 +514,12 @@ impl<'a> FunctionBuilder<'a> {
None => false,
Some(entry) => self.position.ebb.unwrap() == entry,
};
!is_entry && self.func_ctx.ssa.is_sealed(self.position.ebb.unwrap()) && !self
.func_ctx
.ssa
.has_any_predecessors(self.position.ebb.unwrap())
!is_entry
&& self.func_ctx.ssa.is_sealed(self.position.ebb.unwrap())
&& !self
.func_ctx
.ssa
.has_any_predecessors(self.position.ebb.unwrap())
}
/// Returns `true` if and only if no instructions have been added since the last call to
@@ -769,7 +771,8 @@ impl<'a> FunctionBuilder<'a> {
self.ins().load(config.pointer_type(), flags, src, offset),
offset,
)
}).collect();
})
.collect();
for (value, offset) in registers {
self.ins().store(flags, value, dest, offset);

View File

@@ -3,10 +3,7 @@
#![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(new_without_default, new_without_default_derive)

View File

@@ -130,19 +130,14 @@ pub enum ModuleError {
/// different signature than declared previously
#[fail(
display = "Function {} signature {:?} is incompatible with previous declaration {:?}",
_0,
_2,
_1
_0, _2, _1
)]
IncompatibleSignature(String, ir::Signature, ir::Signature),
/// Indicates an identifier was defined more than once
#[fail(display = "Duplicate definition of identifier: {}", _0)]
DuplicateDefinition(String),
/// Indicates an identifier was defined, but was declared as an import
#[fail(
display = "Invalid to define identifier declared as an import: {}",
_0
)]
#[fail(display = "Invalid to define identifier declared as an import: {}", _0)]
InvalidImportDefinition(String),
/// Wraps a `cranelift-codegen` error
#[fail(display = "Compilation error: {}", _0)]

View File

@@ -8,10 +8,7 @@
unstable_features
)]
#![warn(unused_import_braces)]
#![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(new_without_default, new_without_default_derive)

View File

@@ -1,12 +1,9 @@
//! Performes early-stage optimizations on Cranelift IR.
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates,)]
#![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(new_without_default, new_without_default_derive)

View File

@@ -322,7 +322,8 @@ impl<'a> Lexer<'a> {
.and_then(|(prefix, number)| {
Self::numbered_entity(prefix, number)
.or_else(|| Self::value_type(text, prefix, number))
}).unwrap_or_else(|| match text {
})
.unwrap_or_else(|| match text {
"iflags" => Token::Type(types::IFLAGS),
"fflags" => Token::Type(types::FFLAGS),
_ => Token::Identifier(text),

View File

@@ -10,10 +10,7 @@
unstable_features
)]
#![warn(unused_import_braces)]
#![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(new_without_default, new_without_default_derive)

View File

@@ -2587,7 +2587,8 @@ mod tests {
v3 -> v4
v1 = iadd_imm v3, 17
}",
).parse_function(None)
)
.parse_function(None)
.unwrap();
assert_eq!(func.name.to_string(), "%qux");
let v4 = details.map.lookup_str("v4").unwrap();
@@ -2663,7 +2664,8 @@ mod tests {
ss3 = incoming_arg 13
ss1 = spill_slot 1
}",
).parse_function(None)
)
.parse_function(None)
.unwrap();
assert_eq!(func.name.to_string(), "%foo");
let mut iter = func.stack_slots.keys();
@@ -2686,7 +2688,8 @@ mod tests {
ss1 = spill_slot 13
ss1 = spill_slot 1
}",
).parse_function(None)
)
.parse_function(None)
.unwrap_err()
.to_string(),
"3: duplicate entity: ss1"
@@ -2700,7 +2703,8 @@ mod tests {
ebb0:
ebb4(v3: i32):
}",
).parse_function(None)
)
.parse_function(None)
.unwrap();
assert_eq!(func.name.to_string(), "%ebbs");
@@ -2722,7 +2726,8 @@ mod tests {
ebb0:
ebb0:
return 2",
).parse_function(None)
)
.parse_function(None)
.unwrap_err();
assert_eq!(location.line_number, 3);
@@ -2735,7 +2740,8 @@ mod tests {
"function %ebbs() system_v {
jt0 = jump_table []
jt0 = jump_table []",
).parse_function(None)
)
.parse_function(None)
.unwrap_err();
assert_eq!(location.line_number, 3);
@@ -2748,7 +2754,8 @@ mod tests {
"function %ebbs() system_v {
ss0 = explicit_slot 8
ss0 = explicit_slot 8",
).parse_function(None)
)
.parse_function(None)
.unwrap_err();
assert_eq!(location.line_number, 3);
@@ -2761,7 +2768,8 @@ mod tests {
"function %ebbs() system_v {
gv0 = vmctx
gv0 = vmctx",
).parse_function(None)
)
.parse_function(None)
.unwrap_err();
assert_eq!(location.line_number, 3);
@@ -2774,7 +2782,8 @@ mod tests {
"function %ebbs() system_v {
heap0 = static gv0, min 0x1000, bound 0x10_0000, guard 0x1000
heap0 = static gv0, min 0x1000, bound 0x10_0000, guard 0x1000",
).parse_function(None)
)
.parse_function(None)
.unwrap_err();
assert_eq!(location.line_number, 3);
@@ -2787,7 +2796,8 @@ mod tests {
"function %ebbs() system_v {
sig0 = ()
sig0 = ()",
).parse_function(None)
)
.parse_function(None)
.unwrap_err();
assert_eq!(location.line_number, 3);
@@ -2801,7 +2811,8 @@ mod tests {
sig0 = ()
fn0 = %foo sig0
fn0 = %foo sig0",
).parse_function(None)
)
.parse_function(None)
.unwrap_err();
assert_eq!(location.line_number, 4);
@@ -2821,7 +2832,8 @@ mod tests {
trap user42; Instruction
} ; Trailing.
; More trailing.",
).parse_function(None)
)
.parse_function(None)
.unwrap();
assert_eq!(func.name.to_string(), "%comment");
assert_eq!(comments.len(), 8); // no 'before' comment.
@@ -2858,7 +2870,8 @@ mod tests {
function %comment() system_v {}",
None,
None,
).unwrap();
)
.unwrap();
assert_eq!(tf.commands.len(), 2);
assert_eq!(tf.commands[0].command, "cfg");
assert_eq!(tf.commands[1].command, "verify");
@@ -2879,26 +2892,25 @@ mod tests {
#[test]
#[cfg(build_riscv)]
fn isa_spec() {
assert!(
parse_test(
"target
assert!(parse_test(
"target
function %foo() system_v {}",
).is_err()
);
)
.is_err());
assert!(
parse_test(
"target riscv32
assert!(parse_test(
"target riscv32
set enable_float=false
function %foo() system_v {}",
).is_err()
);
)
.is_err());
match parse_test(
"set enable_float=false
isa riscv
function %foo() system_v {}",
).unwrap()
)
.unwrap()
.isa_spec
{
IsaSpec::None(_) => panic!("Expected some ISA"),
@@ -2917,7 +2929,8 @@ mod tests {
ebb0:
trap int_divz
}",
).parse_function(None)
)
.parse_function(None)
.unwrap()
.0;
assert_eq!(func.name.to_string(), "u1:2");

View File

@@ -224,7 +224,8 @@ mod tests {
}",
None,
None,
).unwrap();
)
.unwrap();
let map = &tf.functions[0].1.map;
assert_eq!(map.lookup_str("v0"), None);

View File

@@ -7,10 +7,7 @@
unstable_features
)]
#![warn(unused_import_braces)]
#![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(new_without_default, new_without_default_derive)
@@ -83,7 +80,8 @@ fn main() {
.value_name("FILE")
.help("Input file for serialization"),
),
).subcommand(
)
.subcommand(
SubCommand::with_name("deserialize")
.about("Deserializes Cranelift IR into JSON.")
.arg(
@@ -92,7 +90,8 @@ fn main() {
.value_name("FILE")
.help("Input file for deserialization"),
),
).get_matches();
)
.get_matches();
let res_serde = match matches.subcommand() {
("serialize", Some(m)) => {

View File

@@ -7,10 +7,7 @@
unstable_features
)]
#![warn(unused_import_braces)]
#![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(new_without_default, new_without_default_derive)

View File

@@ -7,10 +7,7 @@
unstable_features
)]
#![warn(unused_import_braces)]
#![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(new_without_default, new_without_default_derive)

View File

@@ -35,11 +35,7 @@ pub enum WasmError {
///
/// This error code is used by a WebAssembly translator when it encounters invalid WebAssembly
/// code. This should never happen for validated WebAssembly code.
#[fail(
display = "Invalid input WebAssembly code at offset {}: {}",
_1,
_0
)]
#[fail(display = "Invalid input WebAssembly code at offset {}: {}", _1, _0)]
InvalidWebAssembly {
/// A string describing the validation error.
message: &'static str,

View File

@@ -12,10 +12,7 @@
#![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(new_without_default, new_without_default_derive)

View File

@@ -30,7 +30,8 @@ fn testsuite() {
}
}
false
}).collect();
})
.collect();
paths.sort_by_key(|dir| dir.path());
let flags = Flags::new(settings::builder());
for path in paths {