]> git.lizzy.rs Git - rust.git/blobdiff - src/libproc_macro/diagnostic.rs
Rollup merge of #67233 - Luro02:cursor_traits, r=sfackler
[rust.git] / src / libproc_macro / diagnostic.rs
index 7a0c9419f62342f1ae4827987c77bfb398b3ee9f..fdf252e53387ecee7dcc4e2073cb55860e9e221e 100644 (file)
@@ -51,12 +51,12 @@ pub struct Diagnostic {
     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")]
@@ -67,7 +67,7 @@ pub fn $spanned<S, T>(mut self, spans: S, message: T) -> Diagnostic
             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 {
@@ -93,28 +93,25 @@ fn next(&mut self) -> Option<Self::Item> {
 
 #[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![],
         }
     }