@@ -30,7 +30,7 @@ pub fn project_root() -> PathBuf {
3030
3131pub fn run_rustfmt ( mode : Mode ) -> Result < ( ) > {
3232 let _dir = pushd ( project_root ( ) ) ;
33- let _e = pushenv ( "RUSTUP_TOOLCHAIN" , "stable " ) ;
33+ let _e = pushenv ( "RUSTUP_TOOLCHAIN" , "nightly " ) ;
3434 ensure_rustfmt ( ) ?;
3535 match mode {
3636 Mode :: Overwrite => run ! ( "cargo fmt" ) ,
@@ -55,7 +55,7 @@ pub fn prepend_generated_preamble(content: impl Display) -> String {
5555}
5656
5757pub fn reformat_without_preamble ( text : impl Display ) -> Result < String > {
58- let _e = pushenv ( "RUSTUP_TOOLCHAIN" , "stable " ) ;
58+ let _e = pushenv ( "RUSTUP_TOOLCHAIN" , "nightly " ) ;
5959 ensure_rustfmt ( ) ?;
6060 let output = run ! (
6161 "rustfmt --config newline_style=Unix" ;
@@ -67,10 +67,10 @@ pub fn reformat_without_preamble(text: impl Display) -> Result<String> {
6767
6868pub fn ensure_rustfmt ( ) -> Result < ( ) > {
6969 let out = run ! ( "rustfmt --version" ) ?;
70- if !out. contains ( "stable " ) {
70+ if !out. contains ( "nightly " ) {
7171 bail ! (
72- "Failed to run rustfmt from toolchain 'stable '. \
73- Please run `rustup component add rustfmt --toolchain stable ` to install it.",
72+ "Failed to run rustfmt from toolchain 'nightly '. \
73+ Please run `rustup component add rustfmt --toolchain nightly ` to install it.",
7474 )
7575 }
7676 Ok ( ( ) )
0 commit comments