@@ -98,8 +98,7 @@ fn add_rust_attribute_on_codeblock(explanation: &str) -> String {
9898
9999fn render_html ( output_path : & Path ) -> Result < ( ) , Box < dyn Error > > {
100100 let mut introduction = format ! (
101- "<script src='redirect.js'></script>
102- # Rust error codes index
101+ "# Rust error codes index
103102
104103This page lists all the error codes emitted by the Rust compiler.
105104
@@ -149,7 +148,12 @@ This page lists all the error codes emitted by the Rust compiler.
149148 book. book . sections . push ( BookItem :: Chapter ( chapter) ) ;
150149 book. build ( ) ?;
151150
152- // We can't put this content into another file, otherwise `mbdbook` will also put it into the
151+ // The error-index used to be generated manually (without mdbook), and the
152+ // index was located at the top level. Now that it is generated with
153+ // mdbook, error-index.html has moved to error_codes/error-index.html.
154+ // This adds a redirect so that old links go to the new location.
155+ //
156+ // We can't put this content into another file, otherwise `mdbook` will also put it into the
153157 // output directory, making a duplicate.
154158 fs:: write (
155159 output_path. join ( "error-index.html" ) ,
@@ -163,7 +167,6 @@ This page lists all the error codes emitted by the Rust compiler.
163167 </head>
164168 <body>
165169 <div>If you are not automatically redirected to the error code index, please <a id="index-link" href="./error_codes/error-index.html">here</a>.
166- <script>document.getElementById("index-link").click()</script>
167170 </body>
168171</html>"# ,
169172 ) ?;
0 commit comments