This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed
src/tools/rust-analyzer/xtask/src/codegen Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,11 @@ r#####"
5353 ) ;
5454 }
5555
56+ // Do not generate assists manual when run with `--check`
57+ if check {
58+ return ;
59+ }
60+
5661 {
5762 // Generate assists manual. Note that we do _not_ commit manual to the
5863 // git repo. Instead, `cargo xtask release` runs this test before making
Original file line number Diff line number Diff line change @@ -10,13 +10,15 @@ use crate::{
1010
1111pub ( crate ) fn generate ( check : bool ) {
1212 let diagnostics = Diagnostic :: collect ( ) . unwrap ( ) ;
13- if !check {
14- let contents =
15- diagnostics. into_iter ( ) . map ( |it| it. to_string ( ) ) . collect :: < Vec < _ > > ( ) . join ( "\n \n " ) ;
16- let contents = add_preamble ( crate :: flags:: CodegenType :: DiagnosticsDocs , contents) ;
17- let dst = project_root ( ) . join ( "docs/book/src/diagnostics_generated.md" ) ;
18- fs:: write ( dst, contents) . unwrap ( ) ;
13+ // Do not generate docs when run with `--check`
14+ if check {
15+ return ;
1916 }
17+ let contents =
18+ diagnostics. into_iter ( ) . map ( |it| it. to_string ( ) ) . collect :: < Vec < _ > > ( ) . join ( "\n \n " ) ;
19+ let contents = add_preamble ( crate :: flags:: CodegenType :: DiagnosticsDocs , contents) ;
20+ let dst = project_root ( ) . join ( "docs/book/src/diagnostics_generated.md" ) ;
21+ fs:: write ( dst, contents) . unwrap ( ) ;
2022}
2123
2224#[ derive( Debug ) ]
Original file line number Diff line number Diff line change @@ -8,8 +8,12 @@ use crate::{
88 util:: list_rust_files,
99} ;
1010
11- pub ( crate ) fn generate ( _check : bool ) {
11+ pub ( crate ) fn generate ( check : bool ) {
1212 let features = Feature :: collect ( ) . unwrap ( ) ;
13+ // Do not generate docs when run with `--check`
14+ if check {
15+ return ;
16+ }
1317 let contents = features. into_iter ( ) . map ( |it| it. to_string ( ) ) . collect :: < Vec < _ > > ( ) . join ( "\n \n " ) ;
1418 let contents = add_preamble ( crate :: flags:: CodegenType :: FeatureDocs , contents) ;
1519 let dst = project_root ( ) . join ( "docs/book/src/features_generated.md" ) ;
You can’t perform that action at this time.
0 commit comments