Patchwork test-check-rust-format: specify --edition=2018

login
register
mail settings
Submitter Yuya Nishihara
Date April 17, 2020, 10:46 a.m.
Message ID <f44a7d8660eacbe7c993.1587120393@mimosa>
Download mbox | patch
Permalink /patch/46181/
State Accepted
Headers show

Comments

Yuya Nishihara - April 17, 2020, 10:46 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1587119718 -32400
#      Fri Apr 17 19:35:18 2020 +0900
# Node ID f44a7d8660eacbe7c99361138141aab1d2f7b722
# Parent  59ad165f6cdb55a8fb9131e5c75f8486be8bb413
test-check-rust-format: specify --edition=2018

rustfmt doesn't read Cargo.toml unless it's executed by cargo.

https://github.com/rust-lang/rustfmt#rusts-editions
Augie Fackler - April 20, 2020, 3 p.m.
queued, thanks

> On Apr 17, 2020, at 06:46, Yuya Nishihara <yuya@tcha.org> wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1587119718 -32400
> #      Fri Apr 17 19:35:18 2020 +0900
> # Node ID f44a7d8660eacbe7c99361138141aab1d2f7b722
> # Parent  59ad165f6cdb55a8fb9131e5c75f8486be8bb413
> test-check-rust-format: specify --edition=2018
> 
> rustfmt doesn't read Cargo.toml unless it's executed by cargo.
> 
> https://github.com/rust-lang/rustfmt#rusts-editions
> 
> diff --git a/tests/test-check-rust-format.t b/tests/test-check-rust-format.t
> --- a/tests/test-check-rust-format.t
> +++ b/tests/test-check-rust-format.t
> @@ -5,5 +5,5 @@
>   $ cd "$TESTDIR"/..
>   $ RUSTFMT=$(rustup which --toolchain nightly rustfmt)
>   $ for f in `testrepohg files 'glob:**/*.rs'` ; do
> -  >   $RUSTFMT --check --unstable-features --color=never $f
> +  >   $RUSTFMT --check --edition=2018 --unstable-features --color=never $f
>> done
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/tests/test-check-rust-format.t b/tests/test-check-rust-format.t
--- a/tests/test-check-rust-format.t
+++ b/tests/test-check-rust-format.t
@@ -5,5 +5,5 @@ 
   $ cd "$TESTDIR"/..
   $ RUSTFMT=$(rustup which --toolchain nightly rustfmt)
   $ for f in `testrepohg files 'glob:**/*.rs'` ; do
-  >   $RUSTFMT --check --unstable-features --color=never $f
+  >   $RUSTFMT --check --edition=2018 --unstable-features --color=never $f
   > done