level: Level,
message: String,
spans: Vec<Span>,
- children: Vec<Diagnostic>
+ children: Vec<Diagnostic>,
}
macro_rules! diagnostic_child_methods {
($spanned:ident, $regular:ident, $level:expr) => (
- /// Add a new child diagnostic message to `self` with the level
+ /// 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")]
self
}
- /// Add a new child diagnostic message to `self` with the level
+ /// 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")]
pub fn $regular<T: Into<String>>(mut self, message: T) -> Diagnostic {
#[unstable(feature = "proc_macro_diagnostic", issue = "54140")]
impl Diagnostic {
- /// Create a new diagnostic with the given `level` and `message`.
+ /// Creates a new diagnostic with the given `level` and `message`.
#[unstable(feature = "proc_macro_diagnostic", issue = "54140")]
pub fn new<T: Into<String>>(level: Level, message: T) -> Diagnostic {
- Diagnostic {
- level: level,
- message: message.into(),
- spans: vec![],
- children: vec![]
- }
+ Diagnostic { level: level, message: message.into(), spans: vec![], children: vec![] }
}
- /// Create a new diagnostic with the given `level` and `message` pointing to
+ /// Creates a new diagnostic with the given `level` and `message` pointing to
/// the given set of `spans`.
#[unstable(feature = "proc_macro_diagnostic", issue = "54140")]
pub fn spanned<S, T>(spans: S, level: Level, message: T) -> Diagnostic
- where S: MultiSpan, T: Into<String>
+ where
+ S: MultiSpan,
+ T: Into<String>,
{
Diagnostic {
level: level,
message: message.into(),
spans: spans.into_spans(),
- children: vec![]
+ children: vec![],
}
}