Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --Another case from : The md5 of is: <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --It is test with nightly, beta, and stable versions. : The output is from nightly. <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
Because we already emit some correct errors a potential fix would be to just remove the problematic and return an empty function body. However there's another problem; call in generates non-existing tokens outside of the file to close all unmatched brackets. That's why we see column 11 in the error message even though column of the last token is 9 in the source file. called by (called by to recover from the invlid argument when seeing which is invalid in pattern context) first generates at column 9 (which is actually the location of ), which I guess (didn't check) shifts to column 10, which is somehow skipped and some other function inserts (couldn't figure out which function) at column 11. As a result we get this error that points to outside of the file
Is there an expected buffer overrun here or is it guarded?
Assigning as discussed as part of the and removing .
I ran  and some finer-grained manual bisection. The regression happened in cc
I'm guessing is because of this code branch: I haven't checked to see how it could even get to it, as looking at the code it should be unreachable.
Actually, this is caused by a different problem (), because if you try the same code without a trailing newline, this behavior doesn't occur (the error message then points to column 10, which is correct, as it is the location of the EOF token). The spurious ]` is an unrelated issue, which I have filed separately ().
Fixed by but there's no regression test for this case, marking as E-needs-test.

Discussion:
<ins> // error-pattern: this file contains an unclosed delimiter // error-pattern: this file contains an unclosed delimiter // error-pattern: expected pattern, found `=` // error-pattern: expected one of `)`, `,`, `->`, `where`, or `{`, found `]` // error-pattern: expected item, found `]` fn main() {} fn p([=(} </ins>

<ins> error: this file contains an unclosed delimiter --> $DIR/issue-81804.rs:9:11 | LL | fn p([=(} |     --    ^ |     || |     |unclosed delimiter |     unclosed delimiter error: this file contains an unclosed delimiter --> $DIR/issue-81804.rs:9:11 | LL | fn p([=(} |     --    ^ |     || |     |unclosed delimiter |     unclosed delimiter error: expected pattern, found `=` --> $DIR/issue-81804.rs:9:7 | LL | fn p([=(} |       ^ expected pattern error: expected one of `)`, `,`, `->`, `where`, or `{`, found `]` --> $DIR/issue-81804.rs:9:8 | LL | fn p([=(} |        ^ -^ |        | | |        | help: `)` may belong here |        unclosed delimiter error: expected item, found `]` --> $DIR/issue-81804.rs:9:11 | LL | fn p([=(} |           ^ expected item error: aborting due to 5 previous errors </ins>