rust/src/test/ui/parse-error-correct.rs

13 lines
498 B
Rust
Raw Normal View History

// compile-flags: -Z continue-parse-after-error
2016-01-21 12:32:56 +13: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-20 02:39:34 +03:00
//~^ ERROR expected function, found `{integer}`
2017-06-11 19:48:46 +02:00
let x = y.foo; //~ ERROR `{integer}` is a primitive type and therefore doesn't have fields [E061
2016-01-21 12:32:56 +13:00
}