Recover from a misplaced inner doc comment

Fixes #86781
This commit is contained in:
Aaron Hill 2021-07-02 11:30:20 -05:00
parent f9fa13f705
commit 5c9bd9c2b4
No known key found for this signature in database
GPG key ID: B4087E510E98B164
3 changed files with 30 additions and 1 deletions

View file

@ -0,0 +1,11 @@
// aux-build:test-macros.rs
#[macro_use]
extern crate test_macros;
//! Inner doc comment
//~^ ERROR expected outer doc comment
#[derive(Empty)]
pub struct Foo;
fn main() {}

View file

@ -0,0 +1,11 @@
error[E0753]: expected outer doc comment
--> $DIR/issue-86781-bad-inner-doc.rs:6:1
|
LL | //! Inner doc comment
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: inner doc comments like this (starting with `//!` or `/*!`) can only appear before items
error: aborting due to previous error
For more information about this error, try `rustc --explain E0753`.