Fix the test script to return an error if formatting diffs are found.
This commit is contained in:
@@ -27,8 +27,7 @@ function banner {
|
|||||||
# Run rustfmt if we have it.
|
# Run rustfmt if we have it.
|
||||||
banner "Rust formatting"
|
banner "Rust formatting"
|
||||||
if type rustfmt > /dev/null; then
|
if type rustfmt > /dev/null; then
|
||||||
# In newer versions of rustfmt, replace --write-mode=diff with --check.
|
if ! "$topdir/format-all.sh" --write-mode=check ; then
|
||||||
if ! "$topdir/format-all.sh" --write-mode=diff ; then
|
|
||||||
echo "Formatting diffs detected! Run \"cargo fmt --all\" to correct."
|
echo "Formatting diffs detected! Run \"cargo fmt --all\" to correct."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -148,12 +148,7 @@ fn write_preamble(
|
|||||||
//
|
//
|
||||||
// Basic blocks
|
// Basic blocks
|
||||||
|
|
||||||
fn write_arg(
|
fn write_arg(w: &mut Write, func: &Function, regs: Option<&RegInfo>, arg: Value) -> fmt::Result {
|
||||||
w: &mut Write,
|
|
||||||
func: &Function,
|
|
||||||
regs: Option<&RegInfo>,
|
|
||||||
arg: Value,
|
|
||||||
) -> fmt::Result {
|
|
||||||
write!(w, "{}: {}", arg, func.dfg.value_type(arg))?;
|
write!(w, "{}: {}", arg, func.dfg.value_type(arg))?;
|
||||||
let loc = func.locations[arg];
|
let loc = func.locations[arg];
|
||||||
if loc.is_assigned() {
|
if loc.is_assigned() {
|
||||||
|
|||||||
Reference in New Issue
Block a user