]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/comment-in-doctest.rs
Auto merge of #103858 - Mark-Simulacrum:bump-bootstrap, r=pietroalbini
[rust.git] / src / test / rustdoc / comment-in-doctest.rs
1 // compile-flags:--test
2
3 // comments, both doc comments and regular ones, used to trick rustdoc's doctest parser into
4 // thinking that everything after it was part of the regular program. combined with the librustc_ast
5 // parser loop failing to detect the manual main function, it would wrap everything in `fn main`,
6 // which would cause the doctest to fail as the "extern crate" declaration was no longer valid.
7 // oddly enough, it would pass in 2018 if a crate was in the extern prelude. see
8 // https://github.com/rust-lang/rust/issues/56727
9
10 //! ```
11 //! // crate: proc-macro-test
12 //! //! this is a test
13 //!
14 //! // used to pull in proc-macro specific items
15 //! extern crate proc_macro;
16 //!
17 //! use proc_macro::TokenStream;
18 //!
19 //! # fn main() {}
20 //! ```