Update to the rustfmt in rust 1.31, which is now stable.
This commit is contained in:
@@ -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"));
|
||||
|
||||
@@ -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`.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
assert!(self
|
||||
.isa
|
||||
.reg_classes
|
||||
.get(*i1)
|
||||
.unwrap()
|
||||
.subclasses
|
||||
.iter()
|
||||
.find(|x| **x == *i2)
|
||||
.is_some()
|
||||
);
|
||||
.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
|
||||
|
||||
@@ -128,7 +128,8 @@ impl SettingGroup {
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}).count() as u8
|
||||
})
|
||||
.count() as u8
|
||||
}
|
||||
|
||||
pub fn byte_size(&self) -> u8 {
|
||||
|
||||
@@ -190,7 +190,8 @@ impl LaneType {
|
||||
|
||||
/// Find the unique number associated with this lane type.
|
||||
pub fn number(self) -> u8 {
|
||||
LANE_BASE + match self {
|
||||
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,
|
||||
|
||||
@@ -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| {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,8 @@ impl RegBank {
|
||||
None
|
||||
}
|
||||
}
|
||||
}.and_then(|offset| {
|
||||
}
|
||||
.and_then(|offset| {
|
||||
if offset < self.units {
|
||||
Some(offset + self.first_unit)
|
||||
} else {
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -914,10 +914,8 @@ 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]
|
||||
&& (ebb.map_or(false, |ebb| lr.is_livein(ebb, ctx))
|
||||
|| self.cur.func.jump_tables[jt]
|
||||
.iter()
|
||||
.any(|ebb| lr.is_livein(*ebb, ctx)))
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -207,7 +207,8 @@ impl<'a> fmt::Display for DisplayRegisterSet<'a> {
|
||||
.unwrap_or_else(|| char::from_digit(
|
||||
u32::from(offset % 10),
|
||||
10
|
||||
).unwrap())
|
||||
)
|
||||
.unwrap())
|
||||
)?;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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!(
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -317,7 +317,8 @@ impl TestRunner {
|
||||
..
|
||||
} => Some(dur),
|
||||
_ => None,
|
||||
}).collect::<Vec<_>>();
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// Get me some real data, kid.
|
||||
let len = times.len();
|
||||
|
||||
@@ -514,7 +514,9 @@ 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
|
||||
!is_entry
|
||||
&& self.func_ctx.ssa.is_sealed(self.position.ebb.unwrap())
|
||||
&& !self
|
||||
.func_ctx
|
||||
.ssa
|
||||
.has_any_predecessors(self.position.ebb.unwrap())
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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(
|
||||
assert!(parse_test(
|
||||
"target
|
||||
function %foo() system_v {}",
|
||||
).is_err()
|
||||
);
|
||||
)
|
||||
.is_err());
|
||||
|
||||
assert!(
|
||||
parse_test(
|
||||
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");
|
||||
|
||||
@@ -224,7 +224,8 @@ mod tests {
|
||||
}",
|
||||
None,
|
||||
None,
|
||||
).unwrap();
|
||||
)
|
||||
.unwrap();
|
||||
let map = &tf.functions[0].1.map;
|
||||
|
||||
assert_eq!(map.lookup_str("v0"), None);
|
||||
|
||||
@@ -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)) => {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user