This commit is contained in:
Aleksey Kladov 2020-04-08 12:19:41 +02:00
parent ffb7ea678b
commit 9e3c843847
3 changed files with 7 additions and 6 deletions

View file

@ -54,12 +54,14 @@ pub struct Diagnostic {
} }
macro_rules! diagnostic_child_methods { macro_rules! diagnostic_child_methods {
($spanned:ident, $regular:ident, $level:expr) => ( ($spanned:ident, $regular:ident, $level:expr) => {
/// Adds 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 /// identified by this method's name with the given `spans` and
/// `message`. /// `message`.
pub fn $spanned<S, T>(mut self, spans: S, message: T) -> Diagnostic pub fn $spanned<S, T>(mut self, spans: S, message: T) -> Diagnostic
where S: MultiSpan, T: Into<String> where
S: MultiSpan,
T: Into<String>,
{ {
self.children.push(Diagnostic::spanned(spans, $level, message)); self.children.push(Diagnostic::spanned(spans, $level, message));
self self
@ -71,7 +73,7 @@ macro_rules! diagnostic_child_methods {
self.children.push(Diagnostic::new($level, message)); self.children.push(Diagnostic::new($level, message));
self self
} }
) };
} }
/// Iterator over the children diagnostics of a `Diagnostic`. /// Iterator over the children diagnostics of a `Diagnostic`.

View file

@ -169,13 +169,13 @@ pub mod token_stream {
pub struct Span(bridge::client::Span); pub struct Span(bridge::client::Span);
macro_rules! diagnostic_method { macro_rules! diagnostic_method {
($name:ident, $level:expr) => ( ($name:ident, $level:expr) => {
/// Creates a new `Diagnostic` with the given `message` at the span /// Creates a new `Diagnostic` with the given `message` at the span
/// `self`. /// `self`.
pub fn $name<T: Into<String>>(self, message: T) -> Diagnostic { pub fn $name<T: Into<String>>(self, message: T) -> Diagnostic {
Diagnostic::spanned(self, $level, message) Diagnostic::spanned(self, $level, message)
} }
) };
} }
impl Span { impl Span {

View file

@ -7,7 +7,6 @@ use crate::{
project_root, project_root,
}; };
pub fn run_dist(nightly: bool, client_version: Option<String>) -> Result<()> { pub fn run_dist(nightly: bool, client_version: Option<String>) -> Result<()> {
let dist = project_root().join("dist"); let dist = project_root().join("dist");
rm_rf(&dist)?; rm_rf(&dist)?;