2
2
3
3
extern crate rustc_driver;
4
4
5
- // We use the function we generate from `register_diagnostics!`.
6
- use crate :: error_codes:: error_codes;
7
-
8
5
use std:: env;
9
6
use std:: error:: Error ;
10
7
use std:: fs:: { self , File } ;
@@ -17,22 +14,6 @@ use std::str::FromStr;
17
14
use mdbook:: book:: { parse_summary, BookItem , Chapter } ;
18
15
use mdbook:: { Config , MDBook } ;
19
16
20
- macro_rules! register_diagnostics {
21
- ( $( $error_code: ident: $message: expr, ) + ; $( $undocumented: ident, ) * ) => {
22
- pub fn error_codes( ) -> Vec <( & ' static str , Option <& ' static str >) > {
23
- let mut errors: Vec <( & str , Option <& str >) > = vec![
24
- $( ( stringify!( $error_code) , Some ( $message) ) , ) +
25
- $( ( stringify!( $undocumented) , None ) , ) *
26
- ] ;
27
- errors. sort( ) ;
28
- errors
29
- }
30
- }
31
- }
32
-
33
- #[ path = "../../../compiler/rustc_error_codes/src/error_codes.rs" ]
34
- mod error_codes;
35
-
36
17
enum OutputFormat {
37
18
HTML ,
38
19
Markdown ,
@@ -102,7 +83,7 @@ This page lists all the error codes emitted by the Rust compiler.
102
83
"
103
84
) ;
104
85
105
- let err_codes = error_codes ( ) ;
86
+ let err_codes = rustc_error_codes :: DIAGNOSTICS ;
106
87
let mut chapters = Vec :: with_capacity ( err_codes. len ( ) ) ;
107
88
108
89
for ( err_code, explanation) in err_codes. iter ( ) {
0 commit comments