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:
12
12
image : rustlang/rust:nightly
13
13
script :
14
14
- cargo build --release
15
+ - rustup component add rustfmt-preview
15
16
- cd ci/svd2rust-regress
16
17
- rm -rf ./output
17
18
- cargo run --release -- --long-test --format --verbose
Original file line number Diff line number Diff line change @@ -108,16 +108,19 @@ fn main() {
108
108
None => & default_svd2rust,
109
109
} ;
110
110
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" )
112
112
. args ( & [ "which" , "rustfmt" ] )
113
113
. output ( )
114
114
. ok ( )
115
- . map ( |v| v . stdout )
115
+ . map ( |o| ( o . stdout , o . status . success ( ) ) )
116
116
{
117
117
Some ( String :: from_utf8_lossy ( & v) . into_owned ( ) . trim ( ) . into ( ) )
118
118
} else {
119
+ if opt. format && opt. rustfmt_bin_path . is_none ( ) {
120
+ panic ! ( "rustfmt binary not found, is rustup and rustfmt-preview installed?" ) ;
121
+ }
119
122
None
120
- } ; // FIXME: capture error and assure exit is 0
123
+ } ;
121
124
122
125
let rustfmt_bin_path = match ( & opt. rustfmt_bin_path , opt. format ) {
123
126
( _, false ) => None ,
You can’t perform that action at this time.
0 commit comments