pub fn diagnostic<D: Diagnostic>(&self) -> (String, u32) {
        let mut buf = String::new();
        let mut count = 0;
        self.diag(|d| {
            // We want to filter diagnostics by the particular one we are testing for, to
            // avoid surprising results in tests.
            if d.downcast_ref::<D>().is_some() {
                format_to!(buf, "{:?}: {}\n", d.syntax_node(self).text(), d.message());
                count += 1;
            };
        });
        (buf, count)
    }
/// Like `diagnostics`, but filtered for a single diagnostic.
Like `diagnostics`, but filtered for a single diagnostic.
Like ` diagnostics ` but filtered for a single diagnostic .
pub fn diagnostic<D: Diagnostic>(&self) -> (String, u32) {
        let mut buf = String::new();
        let mut count = 0;
        self.diag(|d| {
            // We want to filter diagnostics by the particular one we are testing for, to
            // avoid surprising results in tests.
            if d.downcast_ref::<D>().is_some() {
                format_to!(buf, "{:?}: {}\n", d.syntax_node(self).text(), d.message());
                count += 1;
            };
        });
        (buf, count)
    }
pub fn diagnostic < D : Diagnostic > ( & self ) -> ( String , u32 ) { let mut buf = String :: new ( ) ; let mut count = 0 ; self . diag ( | d | { // We want to filter diagnostics by the particular one we are testing for, to // avoid surprising results in tests. if d . downcast_ref :: < D > ( ) . is_some ( ) { format_to ! ( buf " \n " d syntax_node ( self ) text ( ) d message ( ) ) ; count += 1 ; } ; } ) ; ( buf , count ) }
Like `diagnostics`, but filtered for a single diagnostic.
Like ` diagnostics ` but filtered for a single diagnostic .
&self
&self