File tree Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -430,6 +430,10 @@ impl Step for Rustfmt {
430430 & [ ] ,
431431 ) ;
432432
433+ if builder. config . cmd . bless ( ) {
434+ cargo. env ( "BLESS" , "1" ) ;
435+ }
436+
433437 let dir = testdir ( builder, compiler. host ) ;
434438 t ! ( fs:: create_dir_all( & dir) ) ;
435439 cargo. env ( "RUSTFMT_TEST_DIR" , dir) ;
Original file line number Diff line number Diff line change @@ -152,15 +152,13 @@ fn default_handler(
152152 TerminalUrl :: No ,
153153 ) )
154154 } ;
155- Handler :: with_emitter (
156- Box :: new ( SilentOnIgnoredFilesEmitter {
157- has_non_ignorable_parser_errors : false ,
158- source_map,
159- emitter,
160- ignore_path_set,
161- can_reset,
162- } ) ,
163- )
155+ Handler :: with_emitter ( Box :: new ( SilentOnIgnoredFilesEmitter {
156+ has_non_ignorable_parser_errors : false ,
157+ source_map,
158+ emitter,
159+ ignore_path_set,
160+ can_reset,
161+ } ) )
164162}
165163
166164impl ParseSess {
Original file line number Diff line number Diff line change @@ -838,6 +838,12 @@ fn handle_result(
838838
839839 // Ignore LF and CRLF difference for Windows.
840840 if !string_eq_ignore_newline_repr ( & fmt_text, & text) {
841+ if let Some ( bless) = std:: env:: var_os ( "BLESS" ) {
842+ if bless != "0" {
843+ std:: fs:: write ( file_name, fmt_text) . unwrap ( ) ;
844+ continue ;
845+ }
846+ }
841847 let diff = make_diff ( & text, & fmt_text, DIFF_CONTEXT_SIZE ) ;
842848 assert ! (
843849 !diff. is_empty( ) ,
You can’t perform that action at this time.
0 commit comments