@@ -134,7 +134,7 @@ impl Step for Profile {
134
134
t ! ( fs:: remove_file( path) ) ;
135
135
}
136
136
_ => {
137
- println ! ( "Exiting." ) ;
137
+ eprintln ! ( "Exiting." ) ;
138
138
crate :: exit!( 1 ) ;
139
139
}
140
140
}
@@ -184,15 +184,15 @@ pub fn setup(config: &Config, profile: Profile) {
184
184
Profile :: Dist => & [ "dist" , "build" ] ,
185
185
} ;
186
186
187
- println ! ( ) ;
187
+ eprintln ! ( ) ;
188
188
189
- println ! ( "To get started, try one of the following commands:" ) ;
189
+ eprintln ! ( "To get started, try one of the following commands:" ) ;
190
190
for cmd in suggestions {
191
- println ! ( "- `x.py {cmd}`" ) ;
191
+ eprintln ! ( "- `x.py {cmd}`" ) ;
192
192
}
193
193
194
194
if profile != Profile :: Dist {
195
- println ! (
195
+ eprintln ! (
196
196
"For more suggestions, see https://rustc-dev-guide.rust-lang.org/building/suggested.html"
197
197
) ;
198
198
}
@@ -224,7 +224,7 @@ fn setup_config_toml(path: &PathBuf, profile: Profile, config: &Config) {
224
224
t ! ( fs:: write( path, settings) ) ;
225
225
226
226
let include_path = profile. include_path ( & config. src ) ;
227
- println ! ( "`x.py` will now use the configuration at {}" , include_path. display( ) ) ;
227
+ eprintln ! ( "`x.py` will now use the configuration at {}" , include_path. display( ) ) ;
228
228
}
229
229
230
230
/// Creates a toolchain link for stage1 using `rustup`
@@ -256,7 +256,7 @@ impl Step for Link {
256
256
}
257
257
258
258
if !rustup_installed ( builder) {
259
- println ! ( "WARNING: `rustup` is not installed; Skipping `stage1` toolchain linking." ) ;
259
+ eprintln ! ( "WARNING: `rustup` is not installed; Skipping `stage1` toolchain linking." ) ;
260
260
return ;
261
261
}
262
262
@@ -296,7 +296,7 @@ fn attempt_toolchain_link(builder: &Builder<'_>, stage_path: &str) {
296
296
}
297
297
298
298
if try_link_toolchain ( builder, stage_path) {
299
- println ! (
299
+ eprintln ! (
300
300
"Added `stage1` rustup toolchain; try `cargo +stage1 build` on a separate rust project to run a newly-built toolchain"
301
301
) ;
302
302
} else {
@@ -321,14 +321,14 @@ fn toolchain_is_linked(builder: &Builder<'_>) -> bool {
321
321
return false ;
322
322
}
323
323
// The toolchain has already been linked.
324
- println ! (
324
+ eprintln ! (
325
325
"`stage1` toolchain already linked; not attempting to link `stage1` toolchain"
326
326
) ;
327
327
}
328
328
None => {
329
329
// In this case, we don't know if the `stage1` toolchain has been linked;
330
330
// but `rustup` failed, so let's not go any further.
331
- println ! (
331
+ eprintln ! (
332
332
"`rustup` failed to list current toolchains; not attempting to link `stage1` toolchain"
333
333
) ;
334
334
}
@@ -389,12 +389,12 @@ pub fn interactive_path() -> io::Result<Profile> {
389
389
input. parse ( )
390
390
}
391
391
392
- println ! ( "Welcome to the Rust project! What do you want to do with x.py?" ) ;
392
+ eprintln ! ( "Welcome to the Rust project! What do you want to do with x.py?" ) ;
393
393
for ( ( letter, _) , profile) in abbrev_all ( ) {
394
- println ! ( "{}) {}: {}" , letter, profile, profile. purpose( ) ) ;
394
+ eprintln ! ( "{}) {}: {}" , letter, profile, profile. purpose( ) ) ;
395
395
}
396
396
let template = loop {
397
- print ! (
397
+ eprint ! (
398
398
"Please choose one ({}): " ,
399
399
abbrev_all( ) . map( |( ( l, _) , _) | l) . collect:: <Vec <_>>( ) . join( "/" )
400
400
) ;
@@ -428,7 +428,7 @@ enum PromptResult {
428
428
fn prompt_user ( prompt : & str ) -> io:: Result < Option < PromptResult > > {
429
429
let mut input = String :: new ( ) ;
430
430
loop {
431
- print ! ( "{prompt} " ) ;
431
+ eprint ! ( "{prompt} " ) ;
432
432
io:: stdout ( ) . flush ( ) ?;
433
433
input. clear ( ) ;
434
434
io:: stdin ( ) . read_line ( & mut input) ?;
@@ -490,15 +490,15 @@ fn install_git_hook_maybe(builder: &Builder<'_>, config: &Config) -> io::Result<
490
490
return Ok ( ( ) ) ;
491
491
}
492
492
493
- println ! (
493
+ eprintln ! (
494
494
"\n Rust's CI will automatically fail if it doesn't pass `tidy`, the internal tool for ensuring code quality.
495
495
If you'd like, x.py can install a git hook for you that will automatically run `test tidy` before
496
496
pushing your code to ensure your code is up to par. If you decide later that this behavior is
497
497
undesirable, simply delete the `pre-push` file from .git/hooks."
498
498
) ;
499
499
500
500
if prompt_user ( "Would you like to install the git hook?: [y/N]" ) ? != Some ( PromptResult :: Yes ) {
501
- println ! ( "Ok, skipping installation!" ) ;
501
+ eprintln ! ( "Ok, skipping installation!" ) ;
502
502
return Ok ( ( ) ) ;
503
503
}
504
504
if !hooks_dir. exists ( ) {
@@ -515,7 +515,7 @@ undesirable, simply delete the `pre-push` file from .git/hooks."
515
515
) ;
516
516
return Err ( e) ;
517
517
}
518
- Ok ( _) => println ! ( "Linked `src/etc/pre-push.sh` to `.git/hooks/pre-push`" ) ,
518
+ Ok ( _) => eprintln ! ( "Linked `src/etc/pre-push.sh` to `.git/hooks/pre-push`" ) ,
519
519
} ;
520
520
Ok ( ( ) )
521
521
}
@@ -541,7 +541,7 @@ Select which editor you would like to set up [default: None]: ";
541
541
542
542
let mut input = String :: new ( ) ;
543
543
loop {
544
- print ! ( "{}" , prompt_str) ;
544
+ eprint ! ( "{}" , prompt_str) ;
545
545
io:: stdout ( ) . flush ( ) ?;
546
546
input. clear ( ) ;
547
547
io:: stdin ( ) . read_line ( & mut input) ?;
@@ -656,7 +656,7 @@ impl Step for Editor {
656
656
if let Some ( editor_kind) = editor_kind {
657
657
while !t ! ( create_editor_settings_maybe( config, editor_kind. clone( ) ) ) { }
658
658
} else {
659
- println ! ( "Ok, skipping editor setup!" ) ;
659
+ eprintln ! ( "Ok, skipping editor setup!" ) ;
660
660
}
661
661
}
662
662
Err ( e) => eprintln ! ( "Could not determine the editor: {e}" ) ,
@@ -689,7 +689,7 @@ fn create_editor_settings_maybe(config: &Config, editor: EditorKind) -> io::Resu
689
689
mismatched_settings = Some ( false ) ;
690
690
}
691
691
}
692
- println ! (
692
+ eprintln ! (
693
693
"\n x.py can automatically install the recommended `{settings_filename}` file for rustc development"
694
694
) ;
695
695
@@ -708,7 +708,7 @@ fn create_editor_settings_maybe(config: &Config, editor: EditorKind) -> io::Resu
708
708
Some ( PromptResult :: Yes ) => true ,
709
709
Some ( PromptResult :: Print ) => false ,
710
710
_ => {
711
- println ! ( "Ok, skipping settings!" ) ;
711
+ eprintln ! ( "Ok, skipping settings!" ) ;
712
712
return Ok ( true ) ;
713
713
}
714
714
} ;
@@ -735,9 +735,9 @@ fn create_editor_settings_maybe(config: &Config, editor: EditorKind) -> io::Resu
735
735
_ => "Created" ,
736
736
} ;
737
737
fs:: write ( & settings_path, editor. settings_template ( ) ) ?;
738
- println ! ( "{verb} `{}`" , settings_filename) ;
738
+ eprintln ! ( "{verb} `{}`" , settings_filename) ;
739
739
} else {
740
- println ! ( "\n {}" , editor. settings_template( ) ) ;
740
+ eprintln ! ( "\n {}" , editor. settings_template( ) ) ;
741
741
}
742
742
Ok ( should_create)
743
743
}
0 commit comments