rust/tests/ui/parser/parse-error-correct.rs

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

11 lines
449 B
Rust
Raw Normal View History

2016-01-20 23:32:56 +00:00
// Test that the parser is error correcting missing idents. Despite a parsing
// error (or two), we still run type checking (and don't get extra errors there).
fn main() {
let y = 42;
let x = y.; //~ ERROR unexpected token
let x = y.(); //~ ERROR unexpected token
2017-07-19 23:39:34 +00:00
//~^ ERROR expected function, found `{integer}`
2017-06-11 17:48:46 +00:00
let x = y.foo; //~ ERROR `{integer}` is a primitive type and therefore doesn't have fields [E061
2016-01-20 23:32:56 +00:00
}