55// `all-shared` should only emit files that can be shared between crates. 
66// See https://github.com/rust-lang/rust/pull/83478 
77
8- use  std:: path:: Path ; 
9- 
10- use  run_make_support:: { has_extension,  has_prefix,  rustdoc,  shallow_find_files} ; 
8+ use  run_make_support:: { has_extension,  has_prefix,  path,  rustdoc,  shallow_find_files} ; 
119
1210fn  main ( )  { 
1311    rustdoc ( ) 
@@ -19,18 +17,18 @@ fn main() {
1917        . args ( & [ "--extend-css" ,  "z.css" ] ) 
2018        . input ( "x.rs" ) 
2119        . run ( ) ; 
22-     assert ! ( Path :: new ( "invocation-only/search-index-xxx.js" ) . exists( ) ) ; 
23-     assert ! ( Path :: new ( "invocation-only/crates-xxx.js" ) . exists( ) ) ; 
24-     assert ! ( Path :: new ( "invocation-only/settings.html" ) . exists( ) ) ; 
25-     assert ! ( Path :: new ( "invocation-only/x/all.html" ) . exists( ) ) ; 
26-     assert ! ( Path :: new ( "invocation-only/x/index.html" ) . exists( ) ) ; 
27-     assert ! ( Path :: new ( "invocation-only/theme-xxx.css" ) . exists( ) ) ;  // generated from z.css 
28-     assert ! ( !Path :: new ( "invocation-only/storage-xxx.js" ) . exists( ) ) ; 
29-     assert ! ( !Path :: new ( "invocation-only/SourceSerif4-It.ttf.woff2" ) . exists( ) ) ; 
20+     assert ! ( path ( "invocation-only/search-index-xxx.js" ) . exists( ) ) ; 
21+     assert ! ( path ( "invocation-only/crates-xxx.js" ) . exists( ) ) ; 
22+     assert ! ( path ( "invocation-only/settings.html" ) . exists( ) ) ; 
23+     assert ! ( path ( "invocation-only/x/all.html" ) . exists( ) ) ; 
24+     assert ! ( path ( "invocation-only/x/index.html" ) . exists( ) ) ; 
25+     assert ! ( path ( "invocation-only/theme-xxx.css" ) . exists( ) ) ;  // generated from z.css 
26+     assert ! ( !path ( "invocation-only/storage-xxx.js" ) . exists( ) ) ; 
27+     assert ! ( !path ( "invocation-only/SourceSerif4-It.ttf.woff2" ) . exists( ) ) ; 
3028    // FIXME: this probably shouldn't have a suffix 
31-     assert ! ( Path :: new ( "invocation-only/y-xxx.css" ) . exists( ) ) ; 
29+     assert ! ( path ( "invocation-only/y-xxx.css" ) . exists( ) ) ; 
3230    // FIXME: this is technically incorrect (see `write_shared`) 
33-     assert ! ( !Path :: new ( "invocation-only/main-xxx.js" ) . exists( ) ) ; 
31+     assert ! ( !path ( "invocation-only/main-xxx.js" ) . exists( ) ) ; 
3432
3533    rustdoc ( ) 
3634        . arg ( "-Zunstable-options" ) 
@@ -61,10 +59,10 @@ fn main() {
6159        . len( ) , 
6260        1 
6361    ) ; 
64-     assert ! ( !Path :: new ( "toolchain-only/search-index-xxx.js" ) . exists( ) ) ; 
65-     assert ! ( !Path :: new ( "toolchain-only/x/index.html" ) . exists( ) ) ; 
66-     assert ! ( !Path :: new ( "toolchain-only/theme.css" ) . exists( ) ) ; 
67-     assert ! ( !Path :: new ( "toolchain-only/y-xxx.css" ) . exists( ) ) ; 
62+     assert ! ( !path ( "toolchain-only/search-index-xxx.js" ) . exists( ) ) ; 
63+     assert ! ( !path ( "toolchain-only/x/index.html" ) . exists( ) ) ; 
64+     assert ! ( !path ( "toolchain-only/theme.css" ) . exists( ) ) ; 
65+     assert ! ( !path ( "toolchain-only/y-xxx.css" ) . exists( ) ) ; 
6866
6967    rustdoc ( ) 
7068        . arg ( "-Zunstable-options" ) 
@@ -88,17 +86,17 @@ fn main() {
8886        . len( ) , 
8987        1 
9088    ) ; 
91-     assert ! ( !Path :: new ( "all-shared/search-index-xxx.js" ) . exists( ) ) ; 
92-     assert ! ( !Path :: new ( "all-shared/settings.html" ) . exists( ) ) ; 
93-     assert ! ( !Path :: new ( "all-shared/x" ) . exists( ) ) ; 
94-     assert ! ( !Path :: new ( "all-shared/src" ) . exists( ) ) ; 
95-     assert ! ( !Path :: new ( "all-shared/theme.css" ) . exists( ) ) ; 
89+     assert ! ( !path ( "all-shared/search-index-xxx.js" ) . exists( ) ) ; 
90+     assert ! ( !path ( "all-shared/settings.html" ) . exists( ) ) ; 
91+     assert ! ( !path ( "all-shared/x" ) . exists( ) ) ; 
92+     assert ! ( !path ( "all-shared/src" ) . exists( ) ) ; 
93+     assert ! ( !path ( "all-shared/theme.css" ) . exists( ) ) ; 
9694    assert_eq ! ( 
9795        shallow_find_files( "all-shared/static.files" ,  |path| { 
9896            has_prefix( path,  "main-" )  && has_extension( path,  "js" ) 
9997        } ) 
10098        . len( ) , 
10199        1 
102100    ) ; 
103-     assert ! ( !Path :: new ( "all-shared/y-xxx.css" ) . exists( ) ) ; 
101+     assert ! ( !path ( "all-shared/y-xxx.css" ) . exists( ) ) ; 
104102} 
0 commit comments