Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
2fcea9fb68c8e04f10e5cb15bbfb486de9800afa
rust/tests/ui/parser/better-expected.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

4 lines
77 B
Rust
Raw Normal View History

Make the parser’s ‘expected <foo>, found <bar>’ errors more accurate As an example of what this changes, the following code: let x: [int ..4]; Currently spits out ‘expected `]`, found `..`’. However, a comma would also be valid there, as would a number of other tokens. This change adjusts the parser to produce more accurate errors, so that that example now produces ‘expected one of `(`, `+`, `,`, `::`, or `]`, found `..`’.
2014-12-03 22:47:53 +13:00
fn main() {
Recover and suggest use `;` to construct array type Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-07-14 04:28:20 +08:00
let x: [isize 3]; //~ ERROR expected `;` or `]`, found `3`
Make the parser’s ‘expected <foo>, found <bar>’ errors more accurate As an example of what this changes, the following code: let x: [int ..4]; Currently spits out ‘expected `]`, found `..`’. However, a comma would also be valid there, as would a number of other tokens. This change adjusts the parser to produce more accurate errors, so that that example now produces ‘expected one of `(`, `+`, `,`, `::`, or `]`, found `..`’.
2014-12-03 22:47:53 +13:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 4650ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API