]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/issue-15980.rs
Move more parsing tests to ui/parser
[rust.git] / src / test / ui / parser / issue-15980.rs
1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 use std::io;
12
13 fn main(){
14     let x: io::IoResult<()> = Ok(());
15     //~^ ERROR cannot find type `IoResult` in module `io`
16     //~| NOTE did you mean `Result`?
17     match x {
18         Err(ref e) if e.kind == io::EndOfFile {
19             //~^ NOTE while parsing this struct
20             return
21             //~^ ERROR expected identifier, found keyword `return`
22             //~| NOTE expected identifier, found keyword
23         }
24         //~^ NOTE expected one of `.`, `=>`, `?`, or an operator here
25         _ => {}
26         //~^ ERROR expected one of `.`, `=>`, `?`, or an operator, found `_`
27         //~| NOTE unexpected token
28     }
29 }