Skip to content

Commit 63acf90

Browse files
Merge pull request #5276 from calebcartwright/subtree-sync-2022-03-27
sync subtree
2 parents 8984438 + c2039d9 commit 63acf90

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2022-03-17"
2+
channel = "nightly-2022-03-27"
33
components = ["rustc-dev"]

src/lists.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ where
575575
pub(crate) fn extract_pre_comment(pre_snippet: &str) -> (Option<String>, ListItemCommentStyle) {
576576
let trimmed_pre_snippet = pre_snippet.trim();
577577
// Both start and end are checked to support keeping a block comment inline with
578-
// the item, even if there are preceeding line comments, while still supporting
578+
// the item, even if there are preceding line comments, while still supporting
579579
// a snippet that starts with a block comment but also contains one or more
580580
// trailing single line comments.
581581
// https://github.com/rust-lang/rustfmt/issues/3025

src/parse/macros/lazy_static.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub(crate) fn parse_lazy_static(
1616
($method:ident $(,)* $($arg:expr),* $(,)*) => {
1717
match parser.$method($($arg,)*) {
1818
Ok(val) => {
19-
if parser.sess.span_diagnostic.has_errors() {
19+
if parser.sess.span_diagnostic.has_errors().is_some() {
2020
parser.sess.span_diagnostic.reset_err_count();
2121
return None;
2222
} else {

src/parse/macros/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn parse_macro_arg<'a, 'b: 'a>(parser: &'a mut Parser<'b>) -> Option<MacroArg> {
2828
let mut cloned_parser = (*parser).clone();
2929
match $parser(&mut cloned_parser) {
3030
Ok(x) => {
31-
if parser.sess.span_diagnostic.has_errors() {
31+
if parser.sess.span_diagnostic.has_errors().is_some() {
3232
parser.sess.span_diagnostic.reset_err_count();
3333
} else {
3434
// Parsing succeeded.

src/parse/session.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,10 @@ impl ParseSess {
255255
// Methods that should be restricted within the parse module.
256256
impl ParseSess {
257257
pub(super) fn emit_diagnostics(&self, diagnostics: Vec<Diagnostic>) {
258-
for diagnostic in diagnostics {
259-
self.parse_sess.span_diagnostic.emit_diagnostic(&diagnostic);
258+
for mut diagnostic in diagnostics {
259+
self.parse_sess
260+
.span_diagnostic
261+
.emit_diagnostic(&mut diagnostic);
260262
}
261263
}
262264

@@ -265,7 +267,7 @@ impl ParseSess {
265267
}
266268

267269
pub(super) fn has_errors(&self) -> bool {
268-
self.parse_sess.span_diagnostic.has_errors()
270+
self.parse_sess.span_diagnostic.has_errors().is_some()
269271
}
270272

271273
pub(super) fn reset_errors(&self) {

src/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ fn rewrite_segment(
251251
match **args {
252252
ast::GenericArgs::AngleBracketed(ref data) if !data.args.is_empty() => {
253253
// HACK: squeeze out the span between the identifier and the parameters.
254-
// The hack is requried so that we don't remove the separator inside macro calls.
254+
// The hack is required so that we don't remove the separator inside macro calls.
255255
// This does not work in the presence of comment, hoping that people are
256256
// sane about where to put their comment.
257257
let separator_snippet = context

0 commit comments

Comments
 (0)