Skip to content

[WIP] Move parse error recovery for types "out of line" & refactor in the area - #164538

Draft
fmease wants to merge 7 commits into
rust-lang:mainfrom
fmease:parser-ty-outta-line
Draft

fmease wants to merge 7 commits into
rust-lang:mainfrom
fmease:parser-ty-outta-line

Conversation

@fmease

@fmease fmease commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

CC #162591 and the like.

(No LLM was or will be used by me during the entire creation process of this PR)

fmease added 7 commits October 8, 2026 13:03
* consolidate "unexpected `...`" & "`...` nested in a type" diagnostics
  into a new "`...` in invalid context" one
* it didn't make sense to emit "`...` nested in a type" for code like
  `type X = &'static ...;` since it's immaterial whether `...` is wrapped
  by something (here: `&`), `...` is never allowed on the RHS of a type
  alias even if "bare" or "top-level"
* previously we would awkwardly & hackily try to "patch away" the "`...`
  nested in a type" by manually checking for `DotDotDot` at the beginning
  of `parse_ty` precisely to emit "unexpected `...`" instead which made
  more sense most of the time as I've explained above; however, not
  everybody calls `parse_ty` instead reaching for `parse_ty_common` to
  customize the behavior, so that patching over things would only work
  half the time
* update the error code entry for E0743
  * necessary since we've consolidated the two diagnostics
  * previously it would say things like only foreign functions (i.e.,
    ones inside `unsafe extern "…" { … }`) were allowed to be variadic;
    but that's outdated, `extern "…"` functions can now be variadic, too
* change the notes to no longer mention calling conventions C{-unwind}
  since that's a semantic restriction not a syntactic one and we're
  talking about a syntax error here
@fmease fmease added the rla-silenced Silences rust-log-analyzer postings to the PR it's added on. label Oct 18, 2026
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rla-silenced Silences rust-log-analyzer postings to the PR it's added on. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants