diff options
| author | Orion Gonzalez <ardi@ardis.dev> | 2024-12-11 00:53:07 +0100 |
|---|---|---|
| committer | Orion Gonzalez <ardi@ardis.dev> | 2024-12-11 16:23:04 +0100 |
| commit | 014363e89e4347332c50daede2efa66af3c2c243 (patch) | |
| tree | 053869f875cb9a14aee13a2aa79340749834e5d8 /compiler/rustc_errors/src | |
| parent | 33c245b9e98bc91e18ea1c5033824f4c6f92766f (diff) | |
| download | rust-014363e89e4347332c50daede2efa66af3c2c243.tar.gz rust-014363e89e4347332c50daede2efa66af3c2c243.zip | |
Don't emit "field expressions may not have generic arguments" if it's a method call without ()
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 6232c875ee8..95b40b6a906 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -576,6 +576,10 @@ pub enum StashKey { UndeterminedMacroResolution, /// Used by `Parser::maybe_recover_trailing_expr` ExprInPat, + /// If in the parser we detect a field expr with turbofish generic params it's possible that + /// it's a method call without parens. If later on in `hir_typeck` we find out that this is + /// the case we suppress this message and we give a better suggestion. + GenericInFieldExpr, } fn default_track_diagnostic<R>(diag: DiagInner, f: &mut dyn FnMut(DiagInner) -> R) -> R { |
