Change proc_macro::Diagnostics docs

Add links

Fit 100-character limit
This commit is contained in:
Klim Tsoutsman 2021-08-07 13:46:58 +10:00
parent db3cb435c1
commit 75e80358d2
No known key found for this signature in database
GPG key ID: EF1A6E3FD4ABB8DC

View file

@ -56,10 +56,9 @@ pub struct Diagnostic {
macro_rules! diagnostic_child_methods {
($spanned:ident, $regular:ident, $level:expr) => {
/// Adds a new child diagnostic message to `self` with the level
/// identified by this method's name with the given `spans` and
/// `message`.
#[unstable(feature = "proc_macro_diagnostic", issue = "54140")]
#[doc = concat!("Adds a new child diagnostics message to `self` with the [`",
stringify!($level), "`] level, and the given `spans` and `message`.")]
pub fn $spanned<S, T>(mut self, spans: S, message: T) -> Diagnostic
where
S: MultiSpan,
@ -69,9 +68,9 @@ pub fn $spanned<S, T>(mut self, spans: S, message: T) -> Diagnostic
self
}
/// Adds a new child diagnostic message to `self` with the level
/// identified by this method's name with the given `message`.
#[unstable(feature = "proc_macro_diagnostic", issue = "54140")]
#[doc = concat!("Adds a new child diagnostic message to `self` with the [`",
stringify!($level), "`] level, and the given `message`.")]
pub fn $regular<T: Into<String>>(mut self, message: T) -> Diagnostic {
self.children.push(Diagnostic::new($level, message));
self