diff --git a/rust-toolchain b/rust-toolchain index 0d407f11994b..94b57d506c20 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2022-03-17" +channel = "nightly-2022-03-27" components = ["rustc-dev"] diff --git a/src/lists.rs b/src/lists.rs index 97eea19f9321..e87850507824 100644 --- a/src/lists.rs +++ b/src/lists.rs @@ -575,7 +575,7 @@ pub(crate) struct ListItems<'a, I, F1, F2, F3> pub(crate) fn extract_pre_comment(pre_snippet: &str) -> (Option, ListItemCommentStyle) { let trimmed_pre_snippet = pre_snippet.trim(); // Both start and end are checked to support keeping a block comment inline with - // the item, even if there are preceeding line comments, while still supporting + // the item, even if there are preceding line comments, while still supporting // a snippet that starts with a block comment but also contains one or more // trailing single line comments. // https://github.com/rust-lang/rustfmt/issues/3025 diff --git a/src/parse/macros/lazy_static.rs b/src/parse/macros/lazy_static.rs index 4c541de04be0..a8c2feec453c 100644 --- a/src/parse/macros/lazy_static.rs +++ b/src/parse/macros/lazy_static.rs @@ -16,7 +16,7 @@ macro_rules! parse_or { ($method:ident $(,)* $($arg:expr),* $(,)*) => { match parser.$method($($arg,)*) { Ok(val) => { - if parser.sess.span_diagnostic.has_errors() { + if parser.sess.span_diagnostic.has_errors().is_some() { parser.sess.span_diagnostic.reset_err_count(); return None; } else { diff --git a/src/parse/macros/mod.rs b/src/parse/macros/mod.rs index fd738908170f..3728f3a19b44 100644 --- a/src/parse/macros/mod.rs +++ b/src/parse/macros/mod.rs @@ -28,7 +28,7 @@ macro_rules! parse_macro_arg { let mut cloned_parser = (*parser).clone(); match $parser(&mut cloned_parser) { Ok(x) => { - if parser.sess.span_diagnostic.has_errors() { + if parser.sess.span_diagnostic.has_errors().is_some() { parser.sess.span_diagnostic.reset_err_count(); } else { // Parsing succeeded. diff --git a/src/parse/session.rs b/src/parse/session.rs index bf9acd435b92..7571e6d078a7 100644 --- a/src/parse/session.rs +++ b/src/parse/session.rs @@ -255,8 +255,10 @@ pub(crate) fn get_original_snippet(&self, file_name: &FileName) -> Option) { - for diagnostic in diagnostics { - self.parse_sess.span_diagnostic.emit_diagnostic(&diagnostic); + for mut diagnostic in diagnostics { + self.parse_sess + .span_diagnostic + .emit_diagnostic(&mut diagnostic); } } @@ -265,7 +267,7 @@ pub(super) fn can_reset_errors(&self) -> bool { } pub(super) fn has_errors(&self) -> bool { - self.parse_sess.span_diagnostic.has_errors() + self.parse_sess.span_diagnostic.has_errors().is_some() } pub(super) fn reset_errors(&self) { diff --git a/src/types.rs b/src/types.rs index b13e75a93b35..64a201e45ddd 100644 --- a/src/types.rs +++ b/src/types.rs @@ -251,7 +251,7 @@ fn rewrite_segment( match **args { ast::GenericArgs::AngleBracketed(ref data) if !data.args.is_empty() => { // HACK: squeeze out the span between the identifier and the parameters. - // The hack is requried so that we don't remove the separator inside macro calls. + // The hack is required so that we don't remove the separator inside macro calls. // This does not work in the presence of comment, hoping that people are // sane about where to put their comment. let separator_snippet = context