about summary refs log tree commit diff
path: root/src/test/ui/proc-macro
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-09-05 10:11:37 +0000
committerbors <bors@rust-lang.org>2021-09-05 10:11:37 +0000
commit7e1e3eb5e19c7d1a4eabe4da22bf2aa085772766 (patch)
tree17f18508f3871b25d4aef2b72b6a611f4065b2ce /src/test/ui/proc-macro
parent6b9a227b12ea7a6c007500d834fcb5e3969b3fdc (diff)
parentb4d06bfa8f7c3a836fb124307bdd3ec5007fac73 (diff)
downloadrust-7e1e3eb5e19c7d1a4eabe4da22bf2aa085772766.tar.gz
rust-7e1e3eb5e19c7d1a4eabe4da22bf2aa085772766.zip
Auto merge of #88662 - m-ou-se:rollup-h6lgp7k, r=m-ou-se
Rollup of 4 pull requests

Successful merges:

 - #88257 (Provide more context on incorrect inner attribute)
 - #88432 (Fix a typo in raw_vec)
 - #88511 (x.py clippy: don't run with --all-targets by default)
 - #88657 (Fix 2021 `dyn` suggestion that used code as label)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/ui/proc-macro')
-rw-r--r--src/test/ui/proc-macro/issue-86781-bad-inner-doc.fixed12
-rw-r--r--src/test/ui/proc-macro/issue-86781-bad-inner-doc.rs3
-rw-r--r--src/test/ui/proc-macro/issue-86781-bad-inner-doc.stderr10
3 files changed, 22 insertions, 3 deletions
diff --git a/src/test/ui/proc-macro/issue-86781-bad-inner-doc.fixed b/src/test/ui/proc-macro/issue-86781-bad-inner-doc.fixed
new file mode 100644
index 00000000000..426a5fa723f
--- /dev/null
+++ b/src/test/ui/proc-macro/issue-86781-bad-inner-doc.fixed
@@ -0,0 +1,12 @@
+// aux-build:test-macros.rs
+// run-rustfix
+
+#[macro_use]
+extern crate test_macros;
+
+/// Inner doc comment
+//~^ ERROR expected outer doc comment
+#[derive(Empty)]
+pub struct Foo; //~ NOTE the inner doc comment doesn't annotate this struct
+
+fn main() {}
diff --git a/src/test/ui/proc-macro/issue-86781-bad-inner-doc.rs b/src/test/ui/proc-macro/issue-86781-bad-inner-doc.rs
index 8be1ae77738..31e3f3c8592 100644
--- a/src/test/ui/proc-macro/issue-86781-bad-inner-doc.rs
+++ b/src/test/ui/proc-macro/issue-86781-bad-inner-doc.rs
@@ -1,4 +1,5 @@
 // aux-build:test-macros.rs
+// run-rustfix
 
 #[macro_use]
 extern crate test_macros;
@@ -6,6 +7,6 @@ extern crate test_macros;
 //! Inner doc comment
 //~^ ERROR expected outer doc comment
 #[derive(Empty)]
-pub struct Foo;
+pub struct Foo; //~ NOTE the inner doc comment doesn't annotate this struct
 
 fn main() {}
diff --git a/src/test/ui/proc-macro/issue-86781-bad-inner-doc.stderr b/src/test/ui/proc-macro/issue-86781-bad-inner-doc.stderr
index 0b2e612ee5b..a92f07522e5 100644
--- a/src/test/ui/proc-macro/issue-86781-bad-inner-doc.stderr
+++ b/src/test/ui/proc-macro/issue-86781-bad-inner-doc.stderr
@@ -1,10 +1,16 @@
 error[E0753]: expected outer doc comment
-  --> $DIR/issue-86781-bad-inner-doc.rs:6:1
+  --> $DIR/issue-86781-bad-inner-doc.rs:7:1
    |
 LL | //! Inner doc comment
    | ^^^^^^^^^^^^^^^^^^^^^
+...
+LL | pub struct Foo;
+   | --------------- the inner doc comment doesn't annotate this struct
    |
-   = note: inner doc comments like this (starting with `//!` or `/*!`) can only appear before items
+help: to annotate the struct, change the doc comment from inner to outer style
+   |
+LL | /// Inner doc comment
+   |   ~
 
 error: aborting due to previous error