Skip to content

Commit 5339bd1

Browse files
committed
Add back missing comments
1 parent 57c6ed0 commit 5339bd1

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

compiler/rustc_lexer/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ pub fn is_whitespace(c: char) -> bool {
240240

241241
matches!(
242242
c,
243+
// Usual ASCII suspects
243244
'\u{0009}' // \t
244245
| '\u{000A}' // \n
245246
| '\u{000B}' // vertical tab

compiler/rustc_parse/src/parser/pat.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl<'a> Parser<'a> {
160160
| token::Comma // e.g. `let (a |,)`.
161161
| token::CloseDelim(token::Bracket) // e.g. `let [a | ]`.
162162
| token::CloseDelim(token::Paren) // e.g. `let (a | )`.
163-
| token::CloseDelim(token::Brace)
163+
| token::CloseDelim(token::Brace) // e.g. `let A { f: a | }`.
164164
)
165165
});
166166
match (is_end_ahead, &self.token.kind) {
@@ -768,11 +768,12 @@ impl<'a> Parser<'a> {
768768
&& !self.token.is_path_segment_keyword() // Avoid e.g. `Self` as it is a path.
769769
// Avoid `in`. Due to recovery in the list parser this messes with `for ( $pat in $expr )`.
770770
&& !self.token.is_keyword(kw::In)
771+
// Try to do something more complex?
771772
&& self.look_ahead(1, |t| !matches!(t.kind, token::OpenDelim(token::Paren) // A tuple struct pattern.
772773
| token::OpenDelim(token::Brace) // A struct pattern.
773774
| token::DotDotDot | token::DotDotEq | token::DotDot // A range pattern.
774775
| token::ModSep // A tuple / struct variant pattern.
775-
| token::Not))
776+
| token::Not)) // A macro expanding to a pattern.
776777
}
777778

778779
/// Parses `ident` or `ident @ pat`.

compiler/rustc_resolve/src/diagnostics.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,7 @@ impl<'a> Resolver<'a> {
10051005
fn binding_description(&self, b: &NameBinding<'_>, ident: Ident, from_prelude: bool) -> String {
10061006
let res = b.res();
10071007
if b.span.is_dummy() {
1008+
// These already contain the "built-in" prefix or look bad with it.
10081009
let add_built_in =
10091010
!matches!(b.res(), Res::NonMacroAttr(..) | Res::PrimTy(..) | Res::ToolMod);
10101011
let (built_in, from) = if from_prelude {

0 commit comments

Comments
 (0)