File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ regress:nightly:
1212 image : rustlang/rust:nightly
1313 script :
1414 - cargo build --release
15+ - rustup component add rustfmt-preview
1516 - cd ci/svd2rust-regress
1617 - rm -rf ./output
1718 - cargo run --release -- --long-test --format --verbose
Original file line number Diff line number Diff line change @@ -108,16 +108,19 @@ fn main() {
108108 None => & default_svd2rust,
109109 } ;
110110
111- let default_rustfmt: Option < PathBuf > = if let Some ( v ) = Command :: new ( "rustup" )
111+ let default_rustfmt: Option < PathBuf > = if let Some ( ( v , true ) ) = Command :: new ( "rustup" )
112112 . args ( & [ "which" , "rustfmt" ] )
113113 . output ( )
114114 . ok ( )
115- . map ( |v| v . stdout )
115+ . map ( |o| ( o . stdout , o . status . success ( ) ) )
116116 {
117117 Some ( String :: from_utf8_lossy ( & v) . into_owned ( ) . trim ( ) . into ( ) )
118118 } else {
119+ if opt. format && opt. rustfmt_bin_path . is_none ( ) {
120+ panic ! ( "rustfmt binary not found, is rustup and rustfmt-preview installed?" ) ;
121+ }
119122 None
120- } ; // FIXME: capture error and assure exit is 0
123+ } ;
121124
122125 let rustfmt_bin_path = match ( & opt. rustfmt_bin_path , opt. format ) {
123126 ( _, false ) => None ,
You can’t perform that action at this time.
0 commit comments