about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/diagnostic_builder.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-03-19 15:38:57 +0000
committerbors <bors@rust-lang.org>2021-03-19 15:38:57 +0000
commit9f4bc3ead43a57783d8abea2fa6931a6736f3490 (patch)
treeea7f9020ead403b250e25b49007cbc9043c9ec21 /compiler/rustc_errors/src/diagnostic_builder.rs
parentb97fd3e5a1545ab02e18c52e7f3d2e78a5c960bf (diff)
parent99f411d4385f654cfffb5126725414da8b99e211 (diff)
downloadrust-9f4bc3ead43a57783d8abea2fa6931a6736f3490.tar.gz
rust-9f4bc3ead43a57783d8abea2fa6931a6736f3490.zip
Auto merge of #83301 - Dylan-DPC:rollup-x1yzvhm, r=Dylan-DPC
Rollup of 11 pull requests

Successful merges:

 - #82500 (Reuse `std::sys::unsupported::pipe` on `hermit`)
 - #82759 (Remove unwrap_none/expect_none from compiler/.)
 - #82846 (rustdoc: allow list syntax for #[doc(alias)] attributes)
 - #82892 (Clarify docs for Read::read's return value)
 - #83179 (Extend `proc_macro_back_compat` lint to `actix-web`)
 - #83197 (Move some test-only code to test files)
 - #83208 (Fix gitattibutes for old git versions)
 - #83215 (Deprecate std::os::haiku::raw, which accidentally wasn't deprecated)
 - #83230 (Remove unnecessary `forward_inner_docs` hack)
 - #83236 (Upgrade memmap to memmap2)
 - #83270 (Fix typo/inaccuracy in the documentation of Iterator::skip_while)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_errors/src/diagnostic_builder.rs')
-rw-r--r--compiler/rustc_errors/src/diagnostic_builder.rs21
1 files changed, 6 insertions, 15 deletions
diff --git a/compiler/rustc_errors/src/diagnostic_builder.rs b/compiler/rustc_errors/src/diagnostic_builder.rs
index c09cce21bf2..79507e61522 100644
--- a/compiler/rustc_errors/src/diagnostic_builder.rs
+++ b/compiler/rustc_errors/src/diagnostic_builder.rs
@@ -30,15 +30,6 @@ struct DiagnosticBuilderInner<'a> {
     allow_suggestions: bool,
 }
 
-/// This is a helper macro for [`forward!`] that allows automatically adding documentation
-/// that uses tokens from [`forward!`]'s input.
-macro_rules! forward_inner_docs {
-    ($e:expr => $i:item) => {
-        #[doc = $e]
-        $i
-    };
-}
-
 /// In general, the `DiagnosticBuilder` uses deref to allow access to
 /// the fields and methods of the embedded `diagnostic` in a
 /// transparent way. *However,* many of the methods are intended to
@@ -54,11 +45,11 @@ macro_rules! forward {
         pub fn $n:ident(&self, $($name:ident: $ty:ty),* $(,)?) -> &Self
     ) => {
         $(#[$attrs])*
-        forward_inner_docs!(concat!("See [`Diagnostic::", stringify!($n), "()`].") =>
+        #[doc = concat!("See [`Diagnostic::", stringify!($n), "()`].")]
         pub fn $n(&self, $($name: $ty),*) -> &Self {
             self.diagnostic.$n($($name),*);
             self
-        });
+        }
     };
 
     // Forward pattern for &mut self -> &mut Self
@@ -67,11 +58,11 @@ macro_rules! forward {
         pub fn $n:ident(&mut self, $($name:ident: $ty:ty),* $(,)?) -> &mut Self
     ) => {
         $(#[$attrs])*
-        forward_inner_docs!(concat!("See [`Diagnostic::", stringify!($n), "()`].") =>
+        #[doc = concat!("See [`Diagnostic::", stringify!($n), "()`].")]
         pub fn $n(&mut self, $($name: $ty),*) -> &mut Self {
             self.0.diagnostic.$n($($name),*);
             self
-        });
+        }
     };
 
     // Forward pattern for &mut self -> &mut Self, with generic parameters.
@@ -84,11 +75,11 @@ macro_rules! forward {
         ) -> &mut Self
     ) => {
         $(#[$attrs])*
-        forward_inner_docs!(concat!("See [`Diagnostic::", stringify!($n), "()`].") =>
+        #[doc = concat!("See [`Diagnostic::", stringify!($n), "()`].")]
         pub fn $n<$($generic: $bound),*>(&mut self, $($name: $ty),*) -> &mut Self {
             self.0.diagnostic.$n($($name),*);
             self
-        });
+        }
     };
 }