File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+ // file at the top-level directory of this distribution and at
3+ // http://rust-lang.org/COPYRIGHT.
4+ //
5+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+ // option. This file may not be copied, modified, or distributed
9+ // except according to those terms.
10+
11+ // compile-flags:--test
12+
13+ // comments, both doc comments and regular ones, used to trick rustdoc's doctest parser into
14+ // thinking that everything after it was part of the regular program. combined with the libsyntax
15+ // parser loop failing to detect the manual main function, it would wrap everything in `fn main`,
16+ // which would cause the doctest to fail as the "extern crate" declaration was no longer valid.
17+ // oddly enough, it would pass in 2018 if a crate was in the extern prelude. see
18+ // https://github.com/rust-lang/rust/issues/56727
19+
20+ //! ```
21+ //! // crate: proc-macro-test
22+ //! //! this is a test
23+ //!
24+ //! // used to pull in proc-macro specific items
25+ //! extern crate proc_macro;
26+ //!
27+ //! use proc_macro::TokenStream;
28+ //!
29+ //! # fn main() {}
30+ //! ```
You can’t perform that action at this time.
0 commit comments