+++ /dev/null
-// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// compile-flags: -Z parse-only
-
-fn main() {
- let foo =
- match
- Some(4).unwrap_or_else(5)
- //~^ NOTE expected one of `.`, `?`, `{`, or an operator here
- ; //~ NOTE unexpected token
- //~^ ERROR expected one of `.`, `?`, `{`, or an operator, found `;`
-
- println!("{}", foo)
-}
+++ /dev/null
-error: expected one of `.`, `?`, `{`, or an operator, found `;`
- --> $DIR/match-refactor-to-expr.rs:18:9
- |
-LL | match
- | ----- help: try removing this `match`
-LL | Some(4).unwrap_or_else(5)
- | - expected one of `.`, `?`, `{`, or an operator here
-LL | //~^ NOTE expected one of `.`, `?`, `{`, or an operator here
-LL | ; //~ NOTE unexpected token
- | ^ unexpected token
-
-error: aborting due to previous error
-
+++ /dev/null
-// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// compile-flags: -Z parse-only
-
-struct Obj {
- //~^ NOTE: un-closed delimiter
- member: usize
-)
-//~^ ERROR incorrect close delimiter
-//~| NOTE incorrect close delimiter
-
-fn main() {}
+++ /dev/null
-error: incorrect close delimiter: `)`
- --> $DIR/issue-10636-1.rs:16:1
- |
-LL | struct Obj {
- | - un-closed delimiter
-...
-LL | )
- | ^ incorrect close delimiter
-
-error: aborting due to previous error
-
+++ /dev/null
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// compile-flags: -Z parse-only
-
-fn foo() { //~ NOTE un-closed delimiter
- match Some(x) {
- //~^ NOTE this delimiter might not be properly closed...
- Some(y) => { panic!(); }
- None => { panic!(); }
-}
-//~^ NOTE ...as it matches this but it has different indentation
-
-fn bar() {
- let mut i = 0;
- while (i < 1000) {}
-}
-
-fn main() {} //~ ERROR this file contains an un-closed delimiter
+++ /dev/null
-error: this file contains an un-closed delimiter
- --> $DIR/issue-2354.rs:26:66
- |
-LL | fn foo() { //~ NOTE un-closed delimiter
- | - un-closed delimiter
-LL | match Some(x) {
- | - this delimiter might not be properly closed...
-...
-LL | }
- | - ...as it matches this but it has different indentation
-...
-LL | fn main() {} //~ ERROR this file contains an un-closed delimiter
- | ^
-
-error: aborting due to previous error
-
--- /dev/null
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only
+
+type A = Box<(Fn(D::Error) -> E) + 'static + Send + Sync>; // OK (but see #39318)
+
+FAIL
+//~^ ERROR
--- /dev/null
+error: expected one of `!` or `::`, found `<eof>`
+ --> $DIR/bounds-obj-parens.rs:15:1
+ |
+LL | FAIL
+ | ^^^^ expected one of `!` or `::` here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only -Z continue-parse-after-error
+
+impl ! {} // OK
+impl ! where u8: Copy {} // OK
+
+impl Trait Type {} //~ ERROR missing `for` in a trait impl
+impl Trait .. {} //~ ERROR missing `for` in a trait impl
+impl ?Sized for Type {} //~ ERROR expected a trait, found type
+impl ?Sized for .. {} //~ ERROR expected a trait, found type
+
+default unsafe FAIL //~ ERROR expected `impl`, found `FAIL`
--- /dev/null
+error: missing `for` in a trait impl
+ --> $DIR/impl-parsing.rs:16:11
+ |
+LL | impl Trait Type {} //~ ERROR missing `for` in a trait impl
+ | ^
+
+error: missing `for` in a trait impl
+ --> $DIR/impl-parsing.rs:17:11
+ |
+LL | impl Trait .. {} //~ ERROR missing `for` in a trait impl
+ | ^
+
+error: expected a trait, found type
+ --> $DIR/impl-parsing.rs:18:6
+ |
+LL | impl ?Sized for Type {} //~ ERROR expected a trait, found type
+ | ^^^^^^
+
+error: expected a trait, found type
+ --> $DIR/impl-parsing.rs:19:6
+ |
+LL | impl ?Sized for .. {} //~ ERROR expected a trait, found type
+ | ^^^^^^
+
+error: expected `impl`, found `FAIL`
+ --> $DIR/impl-parsing.rs:21:16
+ |
+LL | default unsafe FAIL //~ ERROR expected `impl`, found `FAIL`
+ | ^^^^ expected `impl` here
+
+error: aborting due to 5 previous errors
+
--- /dev/null
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only
+
+struct Obj {
+ //~^ NOTE: un-closed delimiter
+ member: usize
+)
+//~^ ERROR incorrect close delimiter
+//~| NOTE incorrect close delimiter
+
+fn main() {}
--- /dev/null
+error: incorrect close delimiter: `)`
+ --> $DIR/issue-10636-1.rs:16:1
+ |
+LL | struct Obj {
+ | - un-closed delimiter
+...
+LL | )
+ | ^ incorrect close delimiter
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2013-2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// FIXME(31528) we emit a bunch of silly errors here due to continuing past the
+// first one. This would be easy-ish to address by better recovery in tokenisation.
+
+pub fn trace_option(option: Option<isize>) {
+ option.map(|some| 42;
+ //~^ ERROR: expected one of
+
+} //~ ERROR: incorrect close delimiter
+//~^ ERROR: expected expression, found `)`
+
+fn main() {}
--- /dev/null
+error: incorrect close delimiter: `}`
+ --> $DIR/issue-10636-2.rs:18:1
+ |
+LL | pub fn trace_option(option: Option<isize>) {
+ | - close delimiter possibly meant for this
+LL | option.map(|some| 42;
+ | - un-closed delimiter
+...
+LL | } //~ ERROR: incorrect close delimiter
+ | ^ incorrect close delimiter
+
+error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;`
+ --> $DIR/issue-10636-2.rs:15:25
+ |
+LL | option.map(|some| 42;
+ | ^ expected one of `)`, `,`, `.`, `?`, or an operator here
+
+error: expected expression, found `)`
+ --> $DIR/issue-10636-2.rs:18:1
+ |
+LL | } //~ ERROR: incorrect close delimiter
+ | ^ expected expression
+
+error: aborting due to 3 previous errors
+
--- /dev/null
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::io;
+
+fn main(){
+ let x: io::IoResult<()> = Ok(());
+ //~^ ERROR cannot find type `IoResult` in module `io`
+ //~| NOTE did you mean `Result`?
+ match x {
+ Err(ref e) if e.kind == io::EndOfFile {
+ //~^ NOTE while parsing this struct
+ return
+ //~^ ERROR expected identifier, found keyword `return`
+ //~| NOTE expected identifier, found keyword
+ }
+ //~^ NOTE expected one of `.`, `=>`, `?`, or an operator here
+ _ => {}
+ //~^ ERROR expected one of `.`, `=>`, `?`, or an operator, found `_`
+ //~| NOTE unexpected token
+ }
+}
--- /dev/null
+error: expected identifier, found keyword `return`
+ --> $DIR/issue-15980.rs:20:13
+ |
+LL | Err(ref e) if e.kind == io::EndOfFile {
+ | ------------- while parsing this struct
+LL | //~^ NOTE while parsing this struct
+LL | return
+ | ^^^^^^ expected identifier, found keyword
+
+error: expected one of `.`, `=>`, `?`, or an operator, found `_`
+ --> $DIR/issue-15980.rs:25:9
+ |
+LL | }
+ | - expected one of `.`, `=>`, `?`, or an operator here
+LL | //~^ NOTE expected one of `.`, `=>`, `?`, or an operator here
+LL | _ => {}
+ | ^ unexpected token
+
+error[E0412]: cannot find type `IoResult` in module `io`
+ --> $DIR/issue-15980.rs:14:16
+ |
+LL | let x: io::IoResult<()> = Ok(());
+ | ^^^^^^^^ did you mean `Result`?
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0412`.
--- /dev/null
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only
+
+fn foo() { //~ NOTE un-closed delimiter
+ match Some(x) {
+ //~^ NOTE this delimiter might not be properly closed...
+ Some(y) => { panic!(); }
+ None => { panic!(); }
+}
+//~^ NOTE ...as it matches this but it has different indentation
+
+fn bar() {
+ let mut i = 0;
+ while (i < 1000) {}
+}
+
+fn main() {} //~ ERROR this file contains an un-closed delimiter
--- /dev/null
+error: this file contains an un-closed delimiter
+ --> $DIR/issue-2354.rs:26:66
+ |
+LL | fn foo() { //~ NOTE un-closed delimiter
+ | - un-closed delimiter
+LL | match Some(x) {
+ | - this delimiter might not be properly closed...
+...
+LL | }
+ | - ...as it matches this but it has different indentation
+...
+LL | fn main() {} //~ ERROR this file contains an un-closed delimiter
+ | ^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+impl S { //~ ERROR cannot find type
+ pub
+} //~ ERROR expected one of
+
+fn main() {}
--- /dev/null
+error: expected one of `(`, `async`, `const`, `default`, `existential`, `extern`, `fn`, `type`, or `unsafe`, found `}`
+ --> $DIR/issue-41155.rs:13:1
+ |
+LL | pub
+ | - expected one of 9 possible tokens here
+LL | } //~ ERROR expected one of
+ | ^ unexpected token
+
+error[E0412]: cannot find type `S` in this scope
+ --> $DIR/issue-41155.rs:11:6
+ |
+LL | impl S { //~ ERROR cannot find type
+ | ^ not found in this scope
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0412`.
--- /dev/null
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z continue-parse-after-error
+
+macro_rules! ignored_item {
+ () => {
+ fn foo() {}
+ fn bar() {}
+ , //~ ERROR macro expansion ignores token `,`
+ }
+}
+
+macro_rules! ignored_expr {
+ () => ( 1, //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `,`
+
+ 2 )
+}
+
+macro_rules! ignored_pat {
+ () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,`
+}
+
+ignored_item!();
+
+fn main() {
+ ignored_expr!();
+ match 1 {
+ ignored_pat!() => (),
+ _ => (),
+ }
+}
--- /dev/null
+error: macro expansion ignores token `,` and any following
+ --> $DIR/macro-incomplete-parse.rs:17:9
+ |
+LL | , //~ ERROR macro expansion ignores token `,`
+ | ^
+ |
+note: caused by the macro expansion here; the usage of `ignored_item!` is likely invalid in item context
+ --> $DIR/macro-incomplete-parse.rs:31:1
+ |
+LL | ignored_item!();
+ | ^^^^^^^^^^^^^^^^
+
+error: expected one of `.`, `;`, `?`, `}`, or an operator, found `,`
+ --> $DIR/macro-incomplete-parse.rs:22:14
+ |
+LL | () => ( 1, //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `,`
+ | ^ expected one of `.`, `;`, `?`, `}`, or an operator here
+...
+LL | ignored_expr!();
+ | ---------------- in this macro invocation
+
+error: macro expansion ignores token `,` and any following
+ --> $DIR/macro-incomplete-parse.rs:28:14
+ |
+LL | () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,`
+ | ^
+ |
+note: caused by the macro expansion here; the usage of `ignored_pat!` is likely invalid in pattern context
+ --> $DIR/macro-incomplete-parse.rs:36:9
+ |
+LL | ignored_pat!() => (),
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors
+
--- /dev/null
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+ let foo =
+ match
+ Some(4).unwrap_or_else(5)
+ //~^ NOTE expected one of `.`, `?`, `{`, or an operator here
+ ; //~ NOTE unexpected token
+ //~^ ERROR expected one of `.`, `?`, `{`, or an operator, found `;`
+
+ println!("{}", foo)
+}
--- /dev/null
+error: expected one of `.`, `?`, `{`, or an operator, found `;`
+ --> $DIR/match-refactor-to-expr.rs:18:9
+ |
+LL | match
+ | ----- help: try removing this `match`
+LL | Some(4).unwrap_or_else(5)
+ | - expected one of `.`, `?`, `{`, or an operator here
+LL | //~^ NOTE expected one of `.`, `?`, `{`, or an operator here
+LL | ; //~ NOTE unexpected token
+ | ^ unexpected token
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only
+
+fn test_if() {
+ r#if true { } //~ ERROR found `true`
+}
+
+fn test_struct() {
+ r#struct Test; //~ ERROR found `Test`
+}
+
+fn test_union() {
+ r#union Test; //~ ERROR found `Test`
+}
--- /dev/null
+error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `true`
+ --> $DIR/raw-literal-keywords.rs:14:10
+ |
+LL | r#if true { } //~ ERROR found `true`
+ | ^^^^ expected one of 8 possible tokens here
+
+error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `Test`
+ --> $DIR/raw-literal-keywords.rs:18:14
+ |
+LL | r#struct Test; //~ ERROR found `Test`
+ | ^^^^ expected one of 8 possible tokens here
+
+error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `Test`
+ --> $DIR/raw-literal-keywords.rs:22:13
+ |
+LL | r#union Test; //~ ERROR found `Test`
+ | ^^^^ expected one of 8 possible tokens here
+
+error: aborting due to 3 previous errors
+
--- /dev/null
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only
+
+fn self_test(r#self: u32) {
+ //~^ ERROR `r#self` is not currently supported.
+}
--- /dev/null
+error: `r#self` is not currently supported.
+ --> $DIR/raw-literal-self.rs:13:14
+ |
+LL | fn self_test(r#self: u32) {
+ | ^^^^^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only
+
+fn underscore_test(r#_: u32) {
+ //~^ ERROR `r#_` is not currently supported.
+}
--- /dev/null
+error: `r#_` is not currently supported.
+ --> $DIR/raw-literal-underscore.rs:13:20
+ |
+LL | fn underscore_test(r#_: u32) {
+ | ^^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+ let x = r##"lol"#;
+ //~^ ERROR unterminated raw string
+}
--- /dev/null
+error: unterminated raw string
+ --> $DIR/raw_string.rs:12:13
+ |
+LL | let x = r##"lol"#;
+ | ^ unterminated raw string
+ |
+ = note: this raw string should be terminated with `"##`
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only -Z continue-parse-after-error
+
+use std::fmt::Debug;
+
+fn main() {
+ let x: Box<Debug+> = box 3 as Box<Debug+>; // Trailing `+` is OK
+}
+
+FAIL
+//~^ ERROR
--- /dev/null
+error: expected one of `!` or `::`, found `<eof>`
+ --> $DIR/trailing-plus-in-bounds.rs:19:1
+ |
+LL | FAIL
+ | ^^^^ expected one of `!` or `::` here
+
+error: aborting due to previous error
+
+++ /dev/null
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// compile-flags: -Z parse-only
-
-fn test_if() {
- r#if true { } //~ ERROR found `true`
-}
-
-fn test_struct() {
- r#struct Test; //~ ERROR found `Test`
-}
-
-fn test_union() {
- r#union Test; //~ ERROR found `Test`
-}
+++ /dev/null
-error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `true`
- --> $DIR/raw-literal-keywords.rs:14:10
- |
-LL | r#if true { } //~ ERROR found `true`
- | ^^^^ expected one of 8 possible tokens here
-
-error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `Test`
- --> $DIR/raw-literal-keywords.rs:18:14
- |
-LL | r#struct Test; //~ ERROR found `Test`
- | ^^^^ expected one of 8 possible tokens here
-
-error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `Test`
- --> $DIR/raw-literal-keywords.rs:22:13
- |
-LL | r#union Test; //~ ERROR found `Test`
- | ^^^^ expected one of 8 possible tokens here
-
-error: aborting due to 3 previous errors
-
+++ /dev/null
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// compile-flags: -Z parse-only
-
-fn self_test(r#self: u32) {
- //~^ ERROR `r#self` is not currently supported.
-}
+++ /dev/null
-error: `r#self` is not currently supported.
- --> $DIR/raw-literal-self.rs:13:14
- |
-LL | fn self_test(r#self: u32) {
- | ^^^^^^
-
-error: aborting due to previous error
-
+++ /dev/null
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// compile-flags: -Z parse-only
-
-fn underscore_test(r#_: u32) {
- //~^ ERROR `r#_` is not currently supported.
-}
+++ /dev/null
-error: `r#_` is not currently supported.
- --> $DIR/raw-literal-underscore.rs:13:20
- |
-LL | fn underscore_test(r#_: u32) {
- | ^^^
-
-error: aborting due to previous error
-
+++ /dev/null
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn main() {
- let x = r##"lol"#;
- //~^ ERROR unterminated raw string
-}
+++ /dev/null
-error: unterminated raw string
- --> $DIR/raw_string.rs:12:13
- |
-LL | let x = r##"lol"#;
- | ^ unterminated raw string
- |
- = note: this raw string should be terminated with `"##`
-
-error: aborting due to previous error
-
+++ /dev/null
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// compile-flags: -Z parse-only -Z continue-parse-after-error
-
-impl ! {} // OK
-impl ! where u8: Copy {} // OK
-
-impl Trait Type {} //~ ERROR missing `for` in a trait impl
-impl Trait .. {} //~ ERROR missing `for` in a trait impl
-impl ?Sized for Type {} //~ ERROR expected a trait, found type
-impl ?Sized for .. {} //~ ERROR expected a trait, found type
-
-default unsafe FAIL //~ ERROR expected `impl`, found `FAIL`
+++ /dev/null
-error: missing `for` in a trait impl
- --> $DIR/impl-parsing.rs:16:11
- |
-LL | impl Trait Type {} //~ ERROR missing `for` in a trait impl
- | ^
-
-error: missing `for` in a trait impl
- --> $DIR/impl-parsing.rs:17:11
- |
-LL | impl Trait .. {} //~ ERROR missing `for` in a trait impl
- | ^
-
-error: expected a trait, found type
- --> $DIR/impl-parsing.rs:18:6
- |
-LL | impl ?Sized for Type {} //~ ERROR expected a trait, found type
- | ^^^^^^
-
-error: expected a trait, found type
- --> $DIR/impl-parsing.rs:19:6
- |
-LL | impl ?Sized for .. {} //~ ERROR expected a trait, found type
- | ^^^^^^
-
-error: expected `impl`, found `FAIL`
- --> $DIR/impl-parsing.rs:21:16
- |
-LL | default unsafe FAIL //~ ERROR expected `impl`, found `FAIL`
- | ^^^^ expected `impl` here
-
-error: aborting due to 5 previous errors
-
+++ /dev/null
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// compile-flags: -Z parse-only
-
-type A = Box<(Fn(D::Error) -> E) + 'static + Send + Sync>; // OK (but see #39318)
-
-FAIL
-//~^ ERROR
+++ /dev/null
-error: expected one of `!` or `::`, found `<eof>`
- --> $DIR/bounds-obj-parens.rs:15:1
- |
-LL | FAIL
- | ^^^^ expected one of `!` or `::` here
-
-error: aborting due to previous error
-
+++ /dev/null
-// Copyright 2013-2016 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// FIXME(31528) we emit a bunch of silly errors here due to continuing past the
-// first one. This would be easy-ish to address by better recovery in tokenisation.
-
-pub fn trace_option(option: Option<isize>) {
- option.map(|some| 42;
- //~^ ERROR: expected one of
-
-} //~ ERROR: incorrect close delimiter
-//~^ ERROR: expected expression, found `)`
-
-fn main() {}
+++ /dev/null
-error: incorrect close delimiter: `}`
- --> $DIR/issue-10636-2.rs:18:1
- |
-LL | pub fn trace_option(option: Option<isize>) {
- | - close delimiter possibly meant for this
-LL | option.map(|some| 42;
- | - un-closed delimiter
-...
-LL | } //~ ERROR: incorrect close delimiter
- | ^ incorrect close delimiter
-
-error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;`
- --> $DIR/issue-10636-2.rs:15:25
- |
-LL | option.map(|some| 42;
- | ^ expected one of `)`, `,`, `.`, `?`, or an operator here
-
-error: expected expression, found `)`
- --> $DIR/issue-10636-2.rs:18:1
- |
-LL | } //~ ERROR: incorrect close delimiter
- | ^ expected expression
-
-error: aborting due to 3 previous errors
-
+++ /dev/null
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-use std::io;
-
-fn main(){
- let x: io::IoResult<()> = Ok(());
- //~^ ERROR cannot find type `IoResult` in module `io`
- //~| NOTE did you mean `Result`?
- match x {
- Err(ref e) if e.kind == io::EndOfFile {
- //~^ NOTE while parsing this struct
- return
- //~^ ERROR expected identifier, found keyword `return`
- //~| NOTE expected identifier, found keyword
- }
- //~^ NOTE expected one of `.`, `=>`, `?`, or an operator here
- _ => {}
- //~^ ERROR expected one of `.`, `=>`, `?`, or an operator, found `_`
- //~| NOTE unexpected token
- }
-}
+++ /dev/null
-error: expected identifier, found keyword `return`
- --> $DIR/issue-15980.rs:20:13
- |
-LL | Err(ref e) if e.kind == io::EndOfFile {
- | ------------- while parsing this struct
-LL | //~^ NOTE while parsing this struct
-LL | return
- | ^^^^^^ expected identifier, found keyword
-
-error: expected one of `.`, `=>`, `?`, or an operator, found `_`
- --> $DIR/issue-15980.rs:25:9
- |
-LL | }
- | - expected one of `.`, `=>`, `?`, or an operator here
-LL | //~^ NOTE expected one of `.`, `=>`, `?`, or an operator here
-LL | _ => {}
- | ^ unexpected token
-
-error[E0412]: cannot find type `IoResult` in module `io`
- --> $DIR/issue-15980.rs:14:16
- |
-LL | let x: io::IoResult<()> = Ok(());
- | ^^^^^^^^ did you mean `Result`?
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0412`.
+++ /dev/null
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-impl S { //~ ERROR cannot find type
- pub
-} //~ ERROR expected one of
-
-fn main() {}
+++ /dev/null
-error: expected one of `(`, `async`, `const`, `default`, `existential`, `extern`, `fn`, `type`, or `unsafe`, found `}`
- --> $DIR/issue-41155.rs:13:1
- |
-LL | pub
- | - expected one of 9 possible tokens here
-LL | } //~ ERROR expected one of
- | ^ unexpected token
-
-error[E0412]: cannot find type `S` in this scope
- --> $DIR/issue-41155.rs:11:6
- |
-LL | impl S { //~ ERROR cannot find type
- | ^ not found in this scope
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0412`.
+++ /dev/null
-// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// compile-flags: -Z continue-parse-after-error
-
-macro_rules! ignored_item {
- () => {
- fn foo() {}
- fn bar() {}
- , //~ ERROR macro expansion ignores token `,`
- }
-}
-
-macro_rules! ignored_expr {
- () => ( 1, //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `,`
-
- 2 )
-}
-
-macro_rules! ignored_pat {
- () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,`
-}
-
-ignored_item!();
-
-fn main() {
- ignored_expr!();
- match 1 {
- ignored_pat!() => (),
- _ => (),
- }
-}
+++ /dev/null
-error: macro expansion ignores token `,` and any following
- --> $DIR/macro-incomplete-parse.rs:17:9
- |
-LL | , //~ ERROR macro expansion ignores token `,`
- | ^
- |
-note: caused by the macro expansion here; the usage of `ignored_item!` is likely invalid in item context
- --> $DIR/macro-incomplete-parse.rs:31:1
- |
-LL | ignored_item!();
- | ^^^^^^^^^^^^^^^^
-
-error: expected one of `.`, `;`, `?`, `}`, or an operator, found `,`
- --> $DIR/macro-incomplete-parse.rs:22:14
- |
-LL | () => ( 1, //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `,`
- | ^ expected one of `.`, `;`, `?`, `}`, or an operator here
-...
-LL | ignored_expr!();
- | ---------------- in this macro invocation
-
-error: macro expansion ignores token `,` and any following
- --> $DIR/macro-incomplete-parse.rs:28:14
- |
-LL | () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,`
- | ^
- |
-note: caused by the macro expansion here; the usage of `ignored_pat!` is likely invalid in pattern context
- --> $DIR/macro-incomplete-parse.rs:36:9
- |
-LL | ignored_pat!() => (),
- | ^^^^^^^^^^^^^^
-
-error: aborting due to 3 previous errors
-
+++ /dev/null
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// compile-flags: -Z parse-only -Z continue-parse-after-error
-
-use std::fmt::Debug;
-
-fn main() {
- let x: Box<Debug+> = box 3 as Box<Debug+>; // Trailing `+` is OK
-}
-
-FAIL
-//~^ ERROR
+++ /dev/null
-error: expected one of `!` or `::`, found `<eof>`
- --> $DIR/trailing-plus-in-bounds.rs:19:1
- |
-LL | FAIL
- | ^^^^ expected one of `!` or `::` here
-
-error: aborting due to previous error
-