about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/stmt.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-12-21 03:02:07 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-12-21 03:02:07 +0000
commit1549af29c3fea4c9afde42712b5092d8cc98e140 (patch)
treeeef347149220a58f709cded0a39f0c6c2f6acf57 /compiler/rustc_parse/src/parser/stmt.rs
parentcbbc7becc820e05f64d8a23d1a63a27e51b8ff7a (diff)
downloadrust-1549af29c3fea4c9afde42712b5092d8cc98e140.tar.gz
rust-1549af29c3fea4c9afde42712b5092d8cc98e140.zip
Do not suggest `foo.Bar`
Diffstat (limited to 'compiler/rustc_parse/src/parser/stmt.rs')
-rw-r--r--compiler/rustc_parse/src/parser/stmt.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs
index 30a150db728..1ddb5fc0a11 100644
--- a/compiler/rustc_parse/src/parser/stmt.rs
+++ b/compiler/rustc_parse/src/parser/stmt.rs
@@ -746,7 +746,12 @@ impl<'a> Parser<'a> {
     }
 
     fn recover_missing_dot(&mut self, err: &mut Diag<'_>) {
-        if !self.token.is_ident() {
+        let Some((ident, _)) = self.token.ident() else {
+            return;
+        };
+        if let Some(c) = ident.name.as_str().chars().next()
+            && c.is_uppercase()
+        {
             return;
         }
         if self.token.is_reserved_ident() && !self.token.is_ident_named(kw::Await) {