File tree 2 files changed +759
-1
lines changed
2 files changed +759
-1
lines changed Original file line number Diff line number Diff line change 7
7
//! An example with the word "MINOR" at the top is expected to successfully
8
8
//! build against the before and after. Otherwise it should fail. A comment of
9
9
//! "// Error:" will check that the given message appears in the error output.
10
+ //!
11
+ //! The code block can also include the annotations:
12
+ //! - `run-fail`: The test should fail at runtime, not compiletime.
13
+ //! - `dont-deny`: By default tests have a `#![deny(warnings)]`. This option
14
+ //! avoids this attribute. Note that `#![allow(unused)]` is always added.
10
15
11
16
use std:: error:: Error ;
12
17
use std:: fs;
@@ -57,7 +62,13 @@ fn doit() -> Result<(), Box<dyn Error>> {
57
62
if line. trim ( ) == "```" {
58
63
break ;
59
64
}
60
- block. push ( line) ;
65
+ // Support rustdoc/mdbook hidden lines.
66
+ let line = line. strip_prefix ( "# " ) . unwrap_or ( line) ;
67
+ if line == "#" {
68
+ block. push ( "" ) ;
69
+ } else {
70
+ block. push ( line) ;
71
+ }
61
72
}
62
73
None => {
63
74
return Err ( format ! (
You can’t perform that action at this time.
0 commit comments