File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -116,13 +116,23 @@ impl<'a> LintExtractor<'a> {
116116 result. push ( '\n' ) ;
117117 result. push_str ( "[warn-by-default]: listing/warn-by-default.md\n " ) ;
118118 for lint_name in to_link {
119- let lint_def =
120- lints. iter ( ) . find ( |l| l. name == lint_name. replace ( "-" , "_" ) ) . ok_or_else ( || {
121- format ! (
122- "`rustc -W help` defined lint `{}` but that lint does not appear to exist" ,
119+ let lint_def = match lints. iter ( ) . find ( |l| l. name == lint_name. replace ( "-" , "_" ) ) {
120+ Some ( def) => def,
121+ None => {
122+ let msg = format ! (
123+ "`rustc -W help` defined lint `{}` but that lint does not \
124+ appear to exist\n \
125+ Check that the lint definition includes the appropriate doc comments.",
123126 lint_name
124- )
125- } ) ?;
127+ ) ;
128+ if self . validate {
129+ return Err ( msg. into ( ) ) ;
130+ } else {
131+ eprintln ! ( "warning: {}" , msg) ;
132+ continue ;
133+ }
134+ }
135+ } ;
126136 write ! (
127137 result,
128138 "[{}]: listing/{}#{}\n " ,
You can’t perform that action at this time.
0 commit comments