+++ /dev/null
-// Copyright 2014 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
-
-fn main() {
- let x = "\x80"; //~ ERROR may only be used
- let y = "\xff"; //~ ERROR may only be used
- let z = "\xe2"; //~ ERROR may only be used
- let a = b"\x00e2"; // ok because byte literal
-}
+++ /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 that_odd_parse() {
- // following lines below parse and must not fail
- x = if c { a } else { b }();
- x = if true { 1 } else { 0 } as *mut _;
- // however this does not parse and probably should fail to retain compat?
- // NB: `..` here is arbitrary, failure happens/should happen ∀ops that aren’t `=`
- // see assoc-oddities-2 and assoc-oddities-3
- ..if c { a } else { b }[n]; //~ ERROR expected one of
-}
+++ /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 that_odd_parse() {
- // see assoc-oddities-1 for explanation
- x..if c { a } else { b }[n]; //~ ERROR expected one of
-}
+++ /dev/null
-// Copyright 2014 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
-
-// Test you can't use a higher-ranked trait bound inside of a qualified
-// path (just won't parse).
-
-pub trait Foo<T> {
- type A;
-
- fn get(&self, t: T) -> Self::A;
-}
-
-fn foo2<I>(x: <I as for<'x> Foo<&'x isize>>::A)
- //~^ ERROR expected identifier, found keyword `for`
- //~| ERROR expected one of `::` or `>`
-{
-}
-
-pub fn main() {}
+++ /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.
-
-#[path =] //~ ERROR unexpected token: `]`
-mod m {}
+++ /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.
-
-#[path() token] //~ ERROR expected `]`, found `token`
-mod m {}
+++ /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.
-
-#![feature(unrestricted_attribute_tokens)]
-
-#[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
-mod m {}
+++ /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
-
-#[derive(Debug)] //~ERROR expected item after attributes
+++ /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
-
-// error-pattern:expected statement
-
-fn f() {
- #[foo = "bar"]
-}
-
-fn main() {
-}
+++ /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
-
-// error-pattern:expected item
-
-fn main() {
-}
-
-#[foo = "bar"]
+++ /dev/null
-// Copyright 2014 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
-
-#![feature(lang_items)]
-
-fn main() {}
-
-#![lang(foo)] //~ ERROR an inner attribute is not permitted in this context
-fn foo() {}
+++ /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
-
-// Constants (static variables) can be used to match in patterns, but mutable
-// statics cannot. This ensures that there's some form of error if this is
-// attempted.
-
-extern crate libc;
-
-extern {
- static mut rust_dbg_static_mut: libc::c_int;
- pub fn rust_dbg_static_mut_check_four();
- #[cfg(stage37)] //~ ERROR expected item after attributes
-}
-
-pub fn main() {}
+++ /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 -Z continue-parse-after-error
-
-// ignore-tidy-cr
-// ignore-tidy-tab
-fn main() {
- // these literals are just silly.
- ''';
- //~^ ERROR: character constant must be escaped: '
-
- // note that this is a literal "\n" byte
- '
-';
- //~^^ ERROR: character constant must be escaped: \n
-
- // note that this is a literal "\r" byte
- '\r'; //~ ERROR: character constant must be escaped: \r
-
- // note that this is a literal tab character here
- ' ';
- //~^ ERROR: character constant must be escaped: \t
-}
+++ /dev/null
-// Copyright 2014 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
-
-
-extern
- "C"suffix //~ ERROR ABI spec with a suffix is invalid
- fn foo() {}
-
-extern
- "C"suffix //~ ERROR ABI spec with a suffix is invalid
-{}
-
-fn main() {
- ""suffix; //~ ERROR string literal with a suffix is invalid
- b""suffix; //~ ERROR byte string literal with a suffix is invalid
- r#""#suffix; //~ ERROR string literal with a suffix is invalid
- br#""#suffix; //~ ERROR byte string literal with a suffix is invalid
- 'a'suffix; //~ ERROR char literal with a suffix is invalid
- b'a'suffix; //~ ERROR byte literal with a suffix is invalid
-
- 1234u1024; //~ ERROR invalid width `1024` for integer literal
- 1234i1024; //~ ERROR invalid width `1024` for integer literal
- 1234f1024; //~ ERROR invalid width `1024` for float literal
- 1234.5f1024; //~ ERROR invalid width `1024` for float literal
-
- 1234suffix; //~ ERROR invalid suffix `suffix` for numeric literal
- 0b101suffix; //~ ERROR invalid suffix `suffix` for numeric literal
- 1.0suffix; //~ ERROR invalid suffix `suffix` for float literal
- 1.0e10suffix; //~ ERROR invalid suffix `suffix` for float literal
-}
+++ /dev/null
-// Copyright 2014 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
-
-// error-pattern: expected
-
-fn main() {
- let isize x = 5;
- match x;
-}
-
-fn main() {
-}
+++ /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
-
-// error-pattern: expected
-
-fn main() {
- let x.y::<isize>.z foo;
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-fn foo(_: *()) {
- //~^ expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate)
-}
+++ /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 false() { } //~ ERROR expected identifier, found keyword `false`
-fn main() { }
+++ /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 true() { } //~ ERROR expected identifier, found keyword `true`
-fn main() { }
+++ /dev/null
-// Copyright 2014 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 x: [isize 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3`
-}
+++ /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
-
-fn main() {
- struct Foo { x: isize }
- match (Foo { x: 10 }) {
- Foo { ref x: ref x } => {}, //~ ERROR expected `,`
- _ => {}
- }
-}
+++ /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
-
-fn f<T: ?>() {} //~ ERROR expected identifier, found `>`
+++ /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 = for<'a 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `'b`
-
-fn main() {}
+++ /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 = for<'a + 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `+`
-
-fn main() {}
+++ /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 where 'a; //~ ERROR expected `:`, found `;`
-
-fn main() {}
+++ /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 where 'a: 'b + 'c = u8; // OK
-type A where 'a: 'b, = u8; // OK
-type A where 'a: = u8; // OK
-type A where 'a:, = u8; // OK
-type A where 'a: 'b + 'c = u8; // OK
-type A where = u8; // OK
-type A where 'a: 'b + = u8; // OK
-type A where , = u8; //~ ERROR expected one of `=`, lifetime, or type, found `,`
-
-fn main() {}
+++ /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 = for<'a:> fn(); // OK
-type A = for<'a:,> fn(); // OK
-type A = for<'a> fn(); // OK
-type A = for<> fn(); // OK
-type A = for<'a: 'b + 'c> fn(); // OK (rejected later by ast_validation)
-type A = for<'a: 'b,> fn(); // OK(rejected later by ast_validation)
-type A = for<'a: 'b +> fn(); // OK (rejected later by ast_validation)
-type A = for<'a, T> fn(); // OK (rejected later by ast_validation)
-type A = for<,> fn(); //~ ERROR expected one of `>`, identifier, or lifetime, found `,`
-
-fn main() {}
+++ /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 where for<'a> for<'b> Trait1 + ?Trait2: 'a + Trait = u8; // OK
-type A where T: Trait, = u8; // OK
-type A where T: = u8; // OK
-type A where T:, = u8; // OK
-type A where T: Trait + Trait = u8; // OK
-type A where = u8; // OK
-type A where T: Trait + = u8; // OK
-type A where T, = u8;
-//~^ ERROR expected one of `!`, `(`, `+`, `::`, `:`, `<`, `==`, or `=`, found `,`
-
-fn main() {}
+++ /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
-
-struct S<
- T: 'a + Tr, // OK
- T: Tr + 'a, // OK
- T: 'a, // OK
- T:, // OK
- T: ?for<'a> Trait, // OK
- T: Tr +, // OK
- T: ?'a, //~ ERROR `?` may only modify trait bounds, not lifetime bounds
->;
-
-fn main() {}
+++ /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 foo() {
- match x {
- <T as Trait>::Type{key: value} => (),
- //~^ ERROR unexpected `{` after qualified path
- _ => (),
- }
-}
+++ /dev/null
-// Copyright 2014 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
-
-
-// ignore-tidy-tab
-
-static FOO: u8 = b'\f'; //~ ERROR unknown byte escape
-
-pub fn main() {
- b'\f'; //~ ERROR unknown byte escape
- b'\x0Z'; //~ ERROR invalid character in numeric character escape: Z
- b' '; //~ ERROR byte constant must be escaped
- b'''; //~ ERROR byte constant must be escaped
- b'é'; //~ ERROR byte constant must be ASCII
- b'a //~ ERROR unterminated byte constant
-}
+++ /dev/null
-// Copyright 2014 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
-
-
-// ignore-tidy-tab
-
-static FOO: &'static [u8] = b"\f"; //~ ERROR unknown byte escape
-
-pub fn main() {
- b"\f"; //~ ERROR unknown byte escape
- b"\x0Z"; //~ ERROR invalid character in numeric character escape: Z
- b"é"; //~ ERROR byte constant must be ASCII
- b"a //~ ERROR unterminated double quote byte string
-}
+++ /dev/null
-// Copyright 2013-2014 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
-
-// ignore-test: this is an auxiliary file for circular-modules-main.rs
-
-#[path = "circular_modules_main.rs"]
-mod circular_modules_main;
-
-pub fn say_hello() {
- println!("{}", circular_modules_main::hi_str());
-}
+++ /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
-
-#[path = "circular_modules_hello.rs"]
-mod circular_modules_hello; //~ ERROR: circular modules
-
-pub fn hi_str() -> String {
- "Hi!".to_string()
-}
-
-fn main() {
- circular_modules_hello::say_hello();
-}
+++ /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
-
-// error-pattern:nonexistent
-class cat : nonexistent {
- let meows: usize;
- new(in_x : usize) { self.meows = in_x; }
-}
-
-fn main() {
- let nyan = cat(0);
-}
+++ /dev/null
-// Copyright 2014 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.
-
-// Test that we cannot parse a closure with an explicit return type
-// unless it uses braces.
-
-fn main() {
- let x = || -> i32 22;
- //~^ ERROR expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22`
-}
+++ /dev/null
-// Copyright 2014 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
-
-# //~ ERROR 13:1: 13:2: expected `[`, found `<eof>`
+++ /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
-
-// Test successful and unsuccessful parsing of the `default` contextual keyword
-
-trait Foo {
- fn foo<T: Default>() -> T;
-}
-
-impl Foo for u8 {
- default fn foo<T: Default>() -> T {
- T::default()
- }
-}
-
-impl Foo for u16 {
- pub default fn foo<T: Default>() -> T {
- T::default()
- }
-}
-
-impl Foo for u32 {
- default pub fn foo<T: Default>() -> T { T::default() } //~ ERROR expected one of
-}
-
-fn main() {}
+++ /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 main() {
- let _: Option<()> = do catch {};
- //~^ ERROR found removed `do catch` syntax
- //~^^ HELP Following RFC #2388, the new non-placeholder syntax is `try`
-}
+++ /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 continue-parse-after-error
-
-struct X {
- a: u8 /** document a */,
- //~^ ERROR found a documentation comment that doesn't document anything
- //~| HELP maybe a comment was intended
-}
-
-struct Y {
- a: u8 /// document a
- //~^ ERROR found a documentation comment that doesn't document anything
- //~| HELP maybe a comment was intended
-}
-
-fn main() {
- let x = X { a: 1 };
- let y = Y { a: 1 };
-}
+++ /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
-
-/// hi
-#[derive(Debug)] //~ERROR expected item after attributes
+++ /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
-
-/// hi //~ERROR expected item after doc comment
+++ /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
-
-extern {
- /// hi
- //~^ ERROR expected item after doc comment
-}
+++ /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 continue-parse-after-error
-fn main() {
- /// document
- //~^ ERROR found a documentation comment that doesn't document anything
- //~| HELP maybe a comment was intended
-}
+++ /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 continue-parse-after-error
-fn /// document
-foo() {}
-//~^^ ERROR expected identifier, found `/// document`
-
-fn main() {
- foo();
-}
+++ /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 continue-parse-after-error
-mod Foo {
- /// document
- //~^ ERROR expected item after doc comment
-}
+++ /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 main() {
- println!("Hi"); /// hi
- //~^ ERROR found a documentation comment that doesn't document anything
- //~| HELP maybe a comment was intended
-}
+++ /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 main() {
- /// hi
- //~^ ERROR found a documentation comment that doesn't document anything
- //~| HELP maybe a comment was intended
- ;
-}
+++ /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 continue-parse-after-error
-struct X {
- a: u8,
- /// document
- //~^ ERROR found a documentation comment that doesn't document anything
- //~| HELP maybe a comment was intended
-}
-
-fn main() {
- let y = X {a: 1};
-}
+++ /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 continue-parse-after-error
-struct X {
- a: u8 /// document
- //~^ ERROR found a documentation comment that doesn't document anything
- //~| HELP maybe a comment was intended
-}
-
-fn main() {
- let y = X {a: 1};
-}
+++ /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
-
-// error-pattern:expected one of `(`, `fn`, `static`, or `type`
-extern {
- pub pub fn foo();
-}
+++ /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
-
-impl Foo; //~ ERROR expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;`
+++ /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.
-
-extern crte foo; //~ ERROR expected one of `crate`, `fn`, or `{`, found `crte`
+++ /dev/null
-// Copyright 2014 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
-
-// Verifies that the expected token errors for `extern crate` are
-// raised
-
-extern "C" mod foo; //~ERROR expected one of `fn` or `{`, found `mod`
+++ /dev/null
-// Copyright 2014 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
-
-// Verifies that the expected token errors for `extern crate` are
-// raised
-
-extern crate foo {} //~ERROR expected one of `;` or `as`, found `{`
+++ /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
-
-extern { //~ ERROR missing `fn`, `type`, or `static` for extern-item declaration
- f();
-}
-
-fn main() {
-}
+++ /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
-
-impl <*const u8>::AssocTy {} // OK
-impl <Type as Trait>::AssocTy {} // OK
-impl <'a + Trait>::AssocTy {} // OK
-impl <<Type>::AssocTy>::AssocTy {} // OK
-
-FAIL //~ 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
-
-// error-pattern:expected
-use foo::{bar}::baz
+++ /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
-
-// error-pattern:expected
-
-use foo::{bar} as baz;
-
-mod foo {
- pub fn bar() {}
-}
-
-fn main() {
-}
+++ /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
-
-// error-pattern:expected
-use foo::*::bar
+++ /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
-
-// error-pattern:expected
-
-use foo::* as baz;
-
-mod foo {
- pub fn bar() {}
-}
-
-fn main() {
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-#![feature(lang_items)]
-/**
- * My module
- */
-
-#![recursion_limit="100"]
-//~^ ERROR an inner attribute is not permitted following an outer doc comment
-fn main() {}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-#[feature(lang_items)]
-
-#![recursion_limit="100"] //~ ERROR an inner attribute is not permitted following an outer attribute
-fn main() {}
+++ /dev/null
-// Copyright 2014 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
-
-// issue #17123
-
-fn main() {
- 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
- //~^ ERROR int literal is too large
- ; // the span shouldn't point to this.
-}
+++ /dev/null
-// Copyright 2012-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 A { foo: isize }
-
-fn a() -> A { panic!() }
-
-fn main() {
- let A { .., } = a(); //~ ERROR: expected `}`
-}
+++ /dev/null
-// Copyright 2012-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 A { foo: isize }
-
-fn a() -> A { panic!() }
-
-fn main() {
- let A { , } = a(); //~ ERROR: expected ident
-}
+++ /dev/null
-// Copyright 2014 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
-
-enum X<'a, T, 'b> {
-//~^ ERROR lifetime parameters must be declared prior to type parameters
- A(&'a T)
-}
+++ /dev/null
-// Copyright 2014 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<'a, T, 'b>(x: &'a T) {}
-//~^ ERROR lifetime parameters must be declared prior to type parameters
+++ /dev/null
-// Copyright 2014 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() {
- (0..4)
- .map(|x| x * 2)
- .collect::<Vec<'a, usize, 'b>>()
- //~^ ERROR lifetime parameters must be declared prior to type parameters
-}
+++ /dev/null
-// Copyright 2014 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 X { x: isize }
-
-impl<'a, T, 'b> X {}
-//~^ ERROR lifetime parameters must be declared prior to type parameters
+++ /dev/null
-// Copyright 2014 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 bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
-//~^ ERROR lifetime parameters must be declared prior to type parameters
+++ /dev/null
-// Copyright 2014 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 X<'a, T, 'b> {
-//~^ ERROR lifetime parameters must be declared prior to type parameters
- x: &'a T
-}
+++ /dev/null
-// Copyright 2014 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
-
-trait Foo<'a, T, 'b> {}
-//~^ ERROR lifetime parameters must be declared prior to type parameters
+++ /dev/null
-// Copyright 2014 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 ref
- (); //~ ERROR expected identifier, found `(`
-}
+++ /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
-
-// error-pattern:expected `[`, found `vec`
-mod blade_runner {
- #vec[doc(
- brief = "Blade Runner is probably the best movie ever",
- desc = "I like that in the world of Blade Runner it is always
- raining, and that it's always night time. And Aliens
- was also a really good movie.
-
- Alien 3 was crap though."
- )]
-}
+++ /dev/null
-// Copyright 2014 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
-
-enum X {
- A =
- b'a' //~ ERROR discriminator values can only be used with a field-less enum
- ,
- B(isize)
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2014 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
-
-const
-mut //~ ERROR: const globals cannot be mutable
-//~^ HELP did you mean to declare a static?
-FOO: usize = 3;
-
-fn main() {
-}
+++ /dev/null
-// Copyright 2014 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
-
-struct Bar<T> { x: T } where T: Copy //~ ERROR expected item, found `where`
-
-fn main() {}
+++ /dev/null
-// Copyright 2014 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
-
-struct Baz<U> where U: Eq(U); //This is parsed as the new Fn* style parenthesis syntax.
-struct Baz<U> where U: Eq(U) -> R; // Notice this parses as well.
-struct Baz<U>(U) where U: Eq; // This rightfully signals no error as well.
-struct Foo<T> where T: Copy, (T); //~ ERROR expected one of `:`, `==`, or `=`, found `;`
-
-fn main() {}
+++ /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
-
-// error-pattern:no valid digits found for number
-fn main() {
- log(error, 0b);
-}
+++ /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
-
-// error-pattern:no valid digits found for number
-fn main() {
- log(error, 0b_usize);
-}
+++ /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 main() {
- let t = (42, 42);
- t.0::<isize>; //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `::`
-}
+++ /dev/null
-// Copyright 2014 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
-
-trait T {
- extern "Rust" unsafe fn foo(); //~ ERROR expected `fn`, found `unsafe`
-}
-
-fn main() {}
+++ /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
-// ignore-tidy-linelength
-
-struct Foo;
-
-impl Foo {
- fn foo() {}
-
- #[stable(feature = "rust1", since = "1.0.0")]
-} //~ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or
-
-fn main() {}
+++ /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
-// ignore-tidy-linelength
-
-struct Foo;
-
-impl Foo {
- #[stable(feature = "rust1", since = "1.0.0")]
-} //~ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or
-
-fn main() {}
+++ /dev/null
-// Copyright 2014 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
-
-trait MyTrait<T>: Iterator { //~ ERROR missing `fn`, `type`, or `const`
- Item = T;
-}
+++ /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.
-
-fn main() {
- let caller<F> = |f: F| //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
- where F: Fn() -> i32
- {
- let x = f();
- println!("Y {}",x);
- return x;
- };
-
- caller(bar_handler);
-}
-
-fn bar_handler() -> i32 {
- 5
-}
+++ /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.
-
-struct Foo<B> {
- buffer: B
-}
-
-fn bar() {
- let Foo<Vec<u8>> //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
-}
-
-fn main() {}
+++ /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
-
-static foo: isize = 2; } //~ ERROR unexpected close delimiter:
+++ /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 -Z continue-parse-after-error
-
-fn main() {
- let _ = b"\u{a66e}";
- //~^ ERROR unicode escape sequences cannot be used as a byte or in a byte string
-
- let _ = b'\u{a66e}';
- //~^ ERROR unicode escape sequences cannot be used as a byte or in a byte string
-
- let _ = b'\u';
- //~^ ERROR incorrect unicode escape sequence
- //~^^ ERROR unicode escape sequences cannot be used as a byte or in a byte string
-
- let _ = b'\x5';
- //~^ ERROR numeric character escape is too short
-
- let _ = b'\xxy';
- //~^ ERROR invalid character in numeric character escape: x
- //~^^ ERROR invalid character in numeric character escape: y
-
- let _ = '\x5';
- //~^ ERROR numeric character escape is too short
-
- let _ = '\xxy';
- //~^ ERROR invalid character in numeric character escape: x
- //~^^ ERROR invalid character in numeric character escape: y
-
- let _ = b"\u{a4a4} \xf \u";
- //~^ ERROR unicode escape sequences cannot be used as a byte or in a byte string
- //~^^ ERROR invalid character in numeric character escape:
- //~^^^ ERROR incorrect unicode escape sequence
- //~^^^^ ERROR unicode escape sequences cannot be used as a byte or in a byte string
-
- let _ = "\xf \u";
- //~^ ERROR invalid character in numeric character escape:
- //~^^ ERROR form of character escape may only be used with characters in the range [\x00-\x7f]
- //~^^^ ERROR incorrect unicode escape sequence
-}
+++ /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.
-
-fn main() {
- let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
-}
+++ /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.
-
-static tmp : [&'static str; 2] = ["hello", "he"];
-
-fn main() {
- let z = "hello";
- match z {
- tmp[0] => {} //~ ERROR expected one of `=>`, `@`, `if`, or `|`, found `[`
- _ => {}
- }
-}
+++ /dev/null
-// Copyright 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.
-
-// Verify that '>' is not both expected and found at the same time, as it used
-// to happen in #24780. For example, following should be an error:
-// expected one of ..., `>`, ... found `>`
-//
-// compile-flags: -Z parse-only
-
-fn foo() -> Vec<usize>> {
- //~^ ERROR expected one of `!`, `+`, `::`, `where`, or `{`, found `>`
- Vec::new()
-}
+++ /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
-
-impl A .. {} //~ ERROR
-
-fn main() {}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-fn foo() { }
-
-//! Misplaced comment...
-//~^ ERROR expected outer doc comment
-//~| NOTE inner doc comments like this (starting with `//!` or `/*!`) can only appear before items
-
-fn main() { }
+++ /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
-
-// Testing that semicolon tokens are printed correctly in errors
-
-fn main()
-{
- let x = 3
-} //~ ERROR: expected one of `.`, `;`, `?`, or an operator, found `}`
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only -Z continue-parse-after-error
-
-pub fn test<W, I: Iterator<Item=(), W> >() {}
-//~^ ERROR type parameters must be declared prior to associated type bindings
-
-fn main() { }
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-fn main() {}
-
-// This used to end up in an infite loop trying to bump past EOF.
-trait T { ... } //~ ERROR
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-fn main() {
- let a = 0;
- let _b = 0;
- let _ = 0;
- let mut b = 0;
- let mut _b = 0;
- let mut _ = 0; //~ ERROR expected identifier, found reserved identifier `_`
-}
+++ /dev/null
-// Copyright 2014 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
-
-pub fn test() {
- foo(|_|) //~ ERROR expected expression, found `)`
-}
-
-fn main() { }
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// Issue #33262
-
-pub fn main() {
- for i in 0..a as { }
- //~^ ERROR expected type, found `{`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-impl S {
- fn f(*, a: u8) -> u8 {} //~ ERROR expected pattern, found `*`
-}
+++ /dev/null
-// Copyright 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.
-
-use foo.bar; //~ ERROR expected one of `::`, `;`, or `as`, found `.`
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z no-analysis
-
-macro_rules! foo {
- { $+ } => { //~ ERROR expected identifier, found `+`
- //~^ ERROR missing fragment specifier
- $(x)(y) //~ ERROR expected `*` or `+`
- }
-}
-
-foo!();
+++ /dev/null
-// Copyright 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.
-
-macro_rules! test_macro {
- ( $( $t:ty ),* $(),*) => {
- enum SomeEnum {
- $( $t, )* //~ ERROR expected identifier, found `String`
- };
- };
-}
-
-fn main() {
- test_macro!(String,);
-}
+++ /dev/null
-// Copyright 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.
-
-macro_rules! failed {
- () => {{
- let x = 5 ""; //~ ERROR found `""`
- }}
-}
-
-fn main() {
- failed!();
-}
+++ /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
-
-fn main() {
- '\u{_10FFFF}'; //~ ERROR invalid start of unicode escape
-}
+++ /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
-
-fn main() {
- let __isize = 340282366920938463463374607431768211456; // 2^128
- //~^ ERROR int literal is too large
-}
+++ /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
-
-fn main() {
- let __isize = 0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ff;
- //~^ ERROR int literal is too large
-}
+++ /dev/null
-// Copyright 2014 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.
-
-// ignore-windows
-// ignore-freebsd
-// ignore-openbsd
-// ignore-netbsd
-// ignore-bitrig
-
-// compile-flags: -Z parse-only
-
-#[path = "../compile-fail"]
-mod foo; //~ ERROR: a directory
-
-fn main() {}
+++ /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
-
-trait Foo { fn a() } //~ ERROR expected `;` or `{`, found `}`
-
-fn main() {}
+++ /dev/null
-// Copyright 2014 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
-
-pub extern
- "invalid-ab_isize" //~ ERROR invalid ABI
-fn foo() {}
-
-fn main() {}
+++ /dev/null
-// Copyright 2014 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 abstract = (); //~ ERROR expected pattern, found reserved keyword `abstract`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py as'
-
-fn main() {
- let as = "foo"; //~ error: expected pattern, found keyword `as`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-fn main() {
- let box = "foo"; //~ error: expected pattern, found `=`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py break'
-
-fn main() {
- let break = "foo"; //~ error: expected pattern, found keyword `break`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py const'
-
-fn main() {
- let const = "foo"; //~ error: expected pattern, found keyword `const`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py continue'
-
-fn main() {
- let continue = "foo"; //~ error: expected pattern, found keyword `continue`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py else'
-
-fn main() {
- let else = "foo"; //~ error: expected pattern, found keyword `else`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py enum'
-
-fn main() {
- let enum = "foo"; //~ error: expected pattern, found keyword `enum`
-}
+++ /dev/null
-// Copyright 2014 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 final = (); //~ ERROR expected pattern, found reserved keyword `final`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py fn'
-
-fn main() {
- let fn = "foo"; //~ error: expected pattern, found keyword `fn`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py for'
-
-fn main() {
- let for = "foo"; //~ error: expected pattern, found keyword `for`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py if'
-
-fn main() {
- let if = "foo"; //~ error: expected pattern, found keyword `if`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py impl'
-
-fn main() {
- let impl = "foo"; //~ error: expected pattern, found keyword `impl`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py in'
-
-fn main() {
- let in = "foo"; //~ error: expected pattern, found keyword `in`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py let'
-
-fn main() {
- let let = "foo"; //~ error: expected pattern, found keyword `let`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py loop'
-
-fn main() {
- let loop = "foo"; //~ error: expected pattern, found keyword `loop`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py match'
-
-fn main() {
- let match = "foo"; //~ error: expected pattern, found keyword `match`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py mod'
-
-fn main() {
- let mod = "foo"; //~ error: expected pattern, found keyword `mod`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py move'
-
-fn main() {
- let move = "foo"; //~ error: expected pattern, found keyword `move`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-fn main() {
- let mut = "foo"; //~ error: expected identifier, found `=`
-}
+++ /dev/null
-// Copyright 2014 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 override = (); //~ ERROR expected pattern, found reserved keyword `override`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py pub'
-
-fn main() {
- let pub = "foo"; //~ error: expected pattern, found keyword `pub`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-fn main() {
- let ref = "foo"; //~ error: expected identifier, found `=`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py return'
-
-fn main() {
- let return = "foo"; //~ error: expected pattern, found keyword `return`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py static'
-
-fn main() {
- let static = "foo"; //~ error: expected pattern, found keyword `static`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py struct'
-
-fn main() {
- let struct = "foo"; //~ error: expected pattern, found keyword `struct`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py trait'
-
-fn main() {
- let trait = "foo"; //~ error: expected pattern, found keyword `trait`
-}
+++ /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 --edition 2018
-
-fn main() {
- let try = "foo"; //~ error: expected pattern, found reserved keyword `try`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py type'
-
-fn main() {
- let type = "foo"; //~ error: expected pattern, found keyword `type`
-}
+++ /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
-
-fn main() {
- let typeof = (); //~ ERROR expected pattern, found reserved keyword `typeof`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py unsafe'
-
-fn main() {
- let unsafe = "foo"; //~ error: expected pattern, found keyword `unsafe`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py use'
-
-fn main() {
- let use = "foo"; //~ error: expected pattern, found keyword `use`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py where'
-
-fn main() {
- let where = "foo"; //~ error: expected pattern, found keyword `where`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py while'
-
-fn main() {
- let while = "foo"; //~ error: expected pattern, found keyword `while`
-}
+++ /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
-
-pub mod break {
- //~^ ERROR expected identifier, found keyword `break`
-}
+++ /dev/null
-// Copyright 2014 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() {
- struct::foo();
- //~^ ERROR expected identifier
-}
-fn bar() {
- mut::baz();
- //~^ ERROR expected expression, found keyword `mut`
-}
+++ /dev/null
-// Copyright 2014 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
-
-fn main() {
- 0b121; //~ ERROR invalid digit for a base 2 literal
- 0b10_10301; //~ ERROR invalid digit for a base 2 literal
- 0b30; //~ ERROR invalid digit for a base 2 literal
- 0b41; //~ ERROR invalid digit for a base 2 literal
- 0b5; //~ ERROR invalid digit for a base 2 literal
- 0b6; //~ ERROR invalid digit for a base 2 literal
- 0b7; //~ ERROR invalid digit for a base 2 literal
- 0b8; //~ ERROR invalid digit for a base 2 literal
- 0b9; //~ ERROR invalid digit for a base 2 literal
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only -Z continue-parse-after-error
-static c3: char =
- '\x1' //~ ERROR: numeric character escape is too short
-;
-
-static s: &'static str =
- "\x1" //~ ERROR: numeric character escape is too short
-;
-
-static c: char =
- '\●' //~ ERROR: unknown character escape
-;
-
-static s: &'static str =
- "\●" //~ ERROR: unknown character escape
-;
-
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This test needs to the last one appearing in this file as it kills the parser
-static c: char =
- 'nope' //~ ERROR: character literal may only contain one codepoint: 'nope'
-;
-
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-// This test needs to the last one appearing in this file as it kills the parser
-static c: char =
- '●●' //~ ERROR: character literal may only contain one codepoint
-;
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-//
-// This test needs to the last one appearing in this file as it kills the parser
-static c: char =
- '● //~ ERROR: character literal may only contain one codepoint: '●
-;
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-//
-// This test needs to the last one appearing in this file as it kills the parser
-static c: char =
- '\x10\x10' //~ ERROR: character literal may only contain one codepoint
-;
+++ /dev/null
-// Copyright 2014 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
-
-fn main() {
- 0o1.0; //~ ERROR: octal float literal is not supported
- 0o2f32; //~ ERROR: octal float literal is not supported
- 0o3.0f32; //~ ERROR: octal float literal is not supported
- 0o4e4; //~ ERROR: octal float literal is not supported
- 0o5.0e5; //~ ERROR: octal float literal is not supported
- 0o6e6f32; //~ ERROR: octal float literal is not supported
- 0o7.0e7f64; //~ ERROR: octal float literal is not supported
- 0x8.0e+9; //~ ERROR: hexadecimal float literal is not supported
- 0x9.0e-9; //~ ERROR: hexadecimal float literal is not supported
- 0o; //~ ERROR: no valid digits
- 1e+; //~ ERROR: expected at least one digit in exponent
- 0x539.0; //~ ERROR: hexadecimal float literal is not supported
- 9900000000000000000000000000999999999999999999999999999999; //~ ERROR: int literal is too large
- 9900000000000000000000000000999999999999999999999999999999; //~ ERROR: int literal is too large
- 0x; //~ ERROR: no valid digits
- 0xu32; //~ ERROR: no valid digits
- 0ou32; //~ ERROR: no valid digits
- 0bu32; //~ ERROR: no valid digits
- 0b; //~ ERROR: no valid digits
- 0o123f64; //~ ERROR: octal float literal is not supported
- 0o123.456; //~ ERROR: octal float literal is not supported
- 0b101f64; //~ ERROR: binary float literal is not supported
- 0b111.101; //~ ERROR: binary float literal is not supported
-}
+++ /dev/null
-// Copyright 2014 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
-
-fn main() {
- 0o18; //~ ERROR invalid digit for a base 8 literal
- 0o1234_9_5670; //~ ERROR invalid digit for a base 8 literal
-}
+++ /dev/null
-// Copyright 2014 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
-
-● //~ ERROR: unknown start of token
+++ /dev/null
-// Copyright 2014 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
-
-// ignore-tidy-cr
-
-/// doc comment with bare CR: '\r'
-pub fn foo() {}
-//~^^ ERROR: bare CR not allowed in doc-comment
-
-/** block doc comment with bare CR: '\r' */
-pub fn bar() {}
-//~^^ ERROR: bare CR not allowed in block doc-comment
-
-fn main() {
- //! doc comment with bare CR: '\r'
- //~^ ERROR: bare CR not allowed in doc-comment
-
- /*! block doc comment with bare CR: '\r' */
- //~^ ERROR: bare CR not allowed in block doc-comment
-
- // the following string literal has a bare CR in it
- let _s = "foo\rbar"; //~ ERROR: bare CR not allowed in string
-
- // the following string literal has a bare CR in it
- let _s = r"bar\rfoo"; //~ ERROR: bare CR not allowed in raw string
-
- // the following string literal has a bare CR in it
- let _s = "foo\\rbar"; //~ ERROR: unknown character escape: \r
-}
+++ /dev/null
-// Copyright 2014 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
-
-\ //~ ERROR: unknown start of token: \
+++ /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.
-
-fn test(&'a str) {
- //~^ ERROR unexpected lifetime `'a` in pattern
-}
-
-fn main() {
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-struct Foo<'a, 'b> {
- a: &'a &'b i32
-}
-
-fn foo<'a, 'b>(x: &mut Foo<'a; 'b>) {}
-//~^ ERROR expected one of `,` or `>`, found `;`
+++ /dev/null
-// Copyright 2014 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() {
- foo! bar < //~ ERROR expected `(` or `{`, found `<`
-}
+++ /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.
-
-macro_rules! outer {
- (#[$outer:meta]) => ()
-}
-
-outer! {
- //! Inner
-} //~^ ERROR no rules expected the token `!`
-
-fn main() { }
+++ /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.
-
-macro_rules! inner {
- (#![$inner:meta]) => ()
-}
-
-inner! {
- /// Outer
-} //~^ ERROR no rules expected the token `[`
-
-fn main() { }
+++ /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 macro() { //~ ERROR expected identifier, found reserved keyword `macro`
-}
-
-pub fn main() {
-}
+++ /dev/null
-// Copyright 2014 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() {
- foo! {
- bar, "baz", 1, 2.0
- ) //~ ERROR incorrect close delimiter
-}
+++ /dev/null
-// Copyright 2014 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() {
- foo! (
- bar, "baz", 1, 2.0
- } //~ ERROR incorrect close delimiter
-} //~ ERROR unexpected close delimiter: `}`
+++ /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.
-
-macro_rules! mac {
- ( $($v:tt)* ) => (
- $v //~ ERROR still repeating at this depth
- )
-}
-
-fn main() {
- mac!(0);
-}
+++ /dev/null
-// Copyright 2014 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
-
-macro_rules! foo() //~ ERROR semicolon
-
-fn main() {
-}
+++ /dev/null
-// Copyright 2014 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() {
- assert_eq!(1, 2)
- assert_eq!(3, 4) //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `assert_eq`
- println!("hello");
-}
+++ /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 main() {
-
- match 0 {
- 0 => {
- } + 5 //~ ERROR expected pattern, found `+`
- }
-}
+++ /dev/null
-// Copyright 2014 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 a = Vec::new();
- match a {
- [1, tail.., tail..] => {}, //~ ERROR: expected one of `,` or `@`, found `..`
- _ => ()
- }
-}
+++ /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.
-
-// ignore-windows
-
-// compile-flags: -Z parse-only
-
-mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
-//~^ HELP name the file either not_a_real_file.rs or not_a_real_file/mod.rs inside the directory
-
-fn main() {
- assert_eq!(mod_file_aux::bar(), 10);
-}
+++ /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.
-
-// ignore-android
-// ignore-bitrig
-// ignore-cloudabi
-// ignore-dragonfly
-// ignore-emscripten
-// ignore-freebsd
-// ignore-gnu
-// ignore-haiku
-// ignore-ios
-// ignore-linux
-// ignore-macos
-// ignore-netbsd
-// ignore-openbsd
-// ignore-solaris
-
-// compile-flags: -Z parse-only
-
-mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
-//~^ HELP name the file either not_a_real_file.rs or not_a_real_file\mod.rs inside the directory
-
-fn main() {
- assert_eq!(mod_file_aux::bar(), 10);
-}
+++ /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
-
-#[path = "not_a_real_file.rs"]
-mod m; //~ ERROR not_a_real_file.rs
-
-fn main() {
- assert_eq!(m::foo(), 10);
-}
+++ /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.
-
-// error-pattern:18:3
-
-/* 1
- * 2
- * 3
- */
-fn main() {
- %; // parse error on line 18, but is reported on line 6 instead.
-}
+++ /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
-
-struct S {
- y: isize
-}
-
-impl Cmp, ToString for S {
-//~^ ERROR: expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `,`
- fn eq(&&other: S) { false }
- fn to_string(&self) -> String { "hi".to_string() }
-}
+++ /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
-
-// Can't put mut in non-ident pattern
-
-pub fn main() {
- struct Foo { x: isize }
- let mut Foo { x: x } = Foo { x: 3 }; //~ ERROR: expected one of `:`, `;`, `=`, or `@`, found `{`
-}
+++ /dev/null
-// Copyright 2014 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
-
-pub fn main() {
- let s = "\u{2603"; //~ ERROR unterminated unicode escape (needed a `}`)
-}
+++ /dev/null
-// Copyright 2014 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
-
-pub fn main() {
- let s = "\u{260311111111}"; //~ ERROR overlong unicode escape (must have at most 6 hex digits)
-}
+++ /dev/null
-// Copyright 2014 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
-
-pub fn main() {
- let s1 = "\u{d805}"; //~ ERROR invalid unicode character escape
- let s2 = "\u{ffffff}"; //~ ERROR invalid unicode character escape
-}
+++ /dev/null
-// Copyright 2014 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
-
-pub fn main() {
- let s = "\u{lol}";
- //~^ ERROR invalid character in unicode escape: l
-}
+++ /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
-
-// error-pattern:binary float literal is not supported
-
-fn main() {
- 0b101010f64;
- 0b101.010;
- 0b101p4f64;
-}
+++ /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
-
-// error-pattern:hexadecimal float literal is not supported
-
-fn main() {
- 0xABC.Df;
- 0x567.89;
- 0xDEAD.BEEFp-2f;
-}
+++ /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 -Z continue-parse-after-error
-
-trait A {
- fn foo(*mut self); //~ ERROR cannot pass `self` by raw pointer
- fn baz(*const self); //~ ERROR cannot pass `self` by raw pointer
- fn bar(*self); //~ ERROR cannot pass `self` by raw pointer
-}
-
-struct X;
-impl A for X {
- fn foo(*mut self) { } //~ ERROR cannot pass `self` by raw pointer
- fn baz(*const self) { } //~ ERROR cannot pass `self` by raw pointer
- fn bar(*self) { } //~ ERROR cannot pass `self` by raw pointer
-}
-
-fn main() { }
+++ /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
-
-// error-pattern: lt
-
-fn f(a: isize, b: isize) : lt(a, b) { }
-
-fn lt(a: isize, b: isize) { }
-
-fn main() { let a: isize = 10; let b: isize = 23; check (lt(a, b)); f(a, b); }
+++ /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(x) { //~ ERROR expected one of `:` or `@`, found `)`
-}
+++ /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
-
-// http://phpsadness.com/sad/1
-
-fn main() {
- ::; //~ ERROR expected identifier, found `;`
-}
+++ /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 foo() {
- match x {
- <T as Trait>::Type(2) => (),
- //~^ ERROR unexpected `(` after qualified path
- _ => (),
- }
-}
+++ /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.
-
-fn main() {
- match 42 {
- x < 7 => (),
- //~^ error: expected one of `=>`, `@`, `if`, or `|`, found `<`
- _ => ()
- }
-}
+++ /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.
-
-fn a(B<) {}
- //~^ error: expected one of `:` or `@`, found `<`
+++ /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.
-
-struct Foo<T>(T, T);
-
-impl<T> Foo<T> {
- fn foo(&self) {
- match *self {
- Foo<T>(x, y) => {
- //~^ error: expected one of `=>`, `@`, `if`, or `|`, found `<`
- println!("Goodbye, World!")
- }
- }
- }
-}
+++ /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
-
-enum BtNode {
- Node(u32,Box<BtNode>,Box<BtNode>),
- Leaf(u32),
-}
-
-fn main() {
- let y = match x {
- Foo<T>::A(value) => value, //~ error: expected one of `=>`, `@`, `if`, or `|`, found `<`
- Foo<T>::B => 7,
- };
-}
+++ /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.
-
-fn main() {
- let v[0] = v[1]; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
-}
+++ /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.
-
-fn main() {
- let Test(&desc[..]) = x; //~ ERROR: expected one of `)`, `,`, or `@`, found `[`
-}
+++ /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.
-
-fn main() {
- for thing(x[]) in foo {} //~ ERROR: expected one of `)`, `,`, or `@`, found `[`
-}
+++ /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.
-
-// Parsing of range patterns
-
-fn main() {
- let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, or `=`, found `..=`
-}
+++ /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.
-
-// Parsing of range patterns
-
-fn main() {
- let 10 ..= makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, or `=`, found `!`
-}
+++ /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.
-
-// Parsing of range patterns
-
-fn main() {
- let 10 ..= 10 + 3 = 12; //~ expected one of `:`, `;`, or `=`, found `+`
-}
+++ /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.
-
-// Parsing of range patterns
-
-fn main() {
- let 10 - 3 ..= 10 = 8;
- //~^ error: expected one of `...`, `..=`, `..`, `:`, `;`, or `=`, found `-`
-}
+++ /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 matcher(x: Option<isize>) {
- match x {
- ref Some(i) => {} //~ ERROR expected identifier, found enum pattern
- None => {}
- }
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-fn main() {
- match 0 {
- (, ..) => {} //~ ERROR expected pattern, found `,`
- }
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-fn main() {
- match 0 {
- (pat, ..,) => {} //~ ERROR trailing comma is not permitted after `..`
- }
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-fn main() {
- match 0 {
- (.., pat, ..) => {} //~ ERROR `..` can only be used once per tuple or tuple struct pattern
- }
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-fn main() {
- match 0 {
- (.. pat) => {} //~ ERROR expected one of `)` or `,`, found `pat`
- }
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-fn main() {
- match 0 {
- (pat ..) => {} //~ ERROR unexpected token: `)`
- }
-}
+++ /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.
-
-// Issue #14660
-
-macro_rules! priv_x { () => {
- static x: u32 = 0;
-}}
-
-macro_rules! pub_x { () => {
- pub priv_x!(); //~ ERROR can't qualify macro invocation with `pub`
- //~^ HELP try adjusting the macro to put `pub` inside the invocation
-}}
-
-mod foo {
- pub_x!();
-}
-
-fn main() {
- let y: u32 = foo::x;
-}
+++ /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.
-
-// Issue #18317
-
-mod bleh {
- macro_rules! defn {
- ($n:ident) => (
- fn $n (&self) -> i32 {
- println!("{}", stringify!($n));
- 1
- }
- )
- }
-
- #[derive(Copy, Clone)]
- pub struct S;
-
- impl S {
- pub defn!(f); //~ ERROR can't qualify macro invocation with `pub`
- //~^ HELP try adjusting the macro to put `pub` inside the invocation
- }
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2014 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
-
-// Test range syntax - syntax errors.
-
-pub fn main() {
- let r = 1..2..3;
- //~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..`
-}
+++ /dev/null
-// Copyright 2014 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
-
-// Test range syntax - syntax errors.
-
-pub fn main() {
- let r = ..1..2;
- //~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..`
-}
+++ /dev/null
-// Copyright 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.
-
-// Make sure that inclusive ranges with no end point don't parse.
-
-pub fn main() {
- for _ in 1..= {} //~ERROR inclusive range with no end
- //~^HELP bounded at the end
-}
-
+++ /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
-
-// Make sure that inclusive ranges with `...` syntax don't parse.
-
-use std::ops::RangeToInclusive;
-
-fn return_range_to() -> RangeToInclusive<i32> {
- return ...1; //~ERROR unexpected token: `...`
- //~^HELP use `..` for an exclusive range
- //~^^HELP or `..=` for an inclusive range
-}
-
-pub fn main() {
- let x = ...0; //~ERROR unexpected token: `...`
- //~^HELP use `..` for an exclusive range
- //~^^HELP or `..=` for an inclusive range
-
- let x = 5...5; //~ERROR unexpected token: `...`
- //~^HELP use `..` for an exclusive range
- //~^^HELP or `..=` for an inclusive range
-
- for _ in 0...1 {} //~ERROR unexpected token: `...`
- //~^HELP use `..` for an exclusive range
- //~^^HELP or `..=` for an inclusive range
-}
+++ /dev/null
-// Copyright 2014 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
-
-
-pub fn main() {
- br##"a"#; //~ unterminated raw string
-}
+++ /dev/null
-// Copyright 2014 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
-
-
-pub fn main() {
- br"é"; //~ ERROR raw byte string must be ASCII
- br##~"a"~##; //~ ERROR only `#` is allowed in raw string delimitation
-}
+++ /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
-
-static s: &'static str =
- r#~"#"~# //~ ERROR found invalid character; only `#` is allowed in raw string delimitation
-;
+++ /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
-
-static s: &'static str =
- r#"
- "## //~ ERROR expected one of `.`, `;`, `?`, or an operator, found `#`
-;
+++ /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
-
-static s: &'static str =
- r#" string literal goes on
- and on
- //~^^ ERROR unterminated raw string
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only -Z continue-parse-after-error
-
-fn main() {
- enum Test {
- Very
- Bad //~ ERROR found `Bad`
- Stuff
- }
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only -Z continue-parse-after-error
-
-fn main() {
- enum Test {
- Var1,
- Var2(String),
- Var3 {
- abc: {}, //~ ERROR: expected type, found `{`
- },
- }
-
- // recover...
- let a = 1;
- enum Test2 {
- Fine,
- }
-
- enum Test3 {
- StillFine {
- def: i32,
- },
- }
-
- {
- // fail again
- enum Test4 {
- Nope(i32 {}) //~ ERROR: found `{`
- //~^ ERROR: found `{`
- }
- }
- // still recover later
- let bad_syntax = _; //~ ERROR: expected expression, found reserved identifier `_`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only -Z continue-parse-after-error
-
-fn main() {
- struct Test {
- Very
- Bad //~ ERROR found `Bad`
- Stuff
- }
-}
+++ /dev/null
-// Copyright 2012-2014 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
-
-// ignore-test blk region isn't supported in the front-end
-
-fn foo(cond: bool) {
- // Here we will infer a type that uses the
- // region of the if stmt then block, but in the scope:
- let mut x; //~ ERROR foo
-
- if cond {
- x = &'blk [1,2,3];
- }
-}
-
-fn main() {}
+++ /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
-
-type closure = Box<lt/fn()>;
-//~^ ERROR expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `/`
+++ /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
-
-enum e = isize; //~ ERROR expected one of `<`, `where`, or `{`, found `=`
+++ /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
-
-extern {
- const i: isize;
- //~^ ERROR extern items cannot be `const`
-}
+++ /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 -Z continue-parse-after-error
-
-struct s {
- let foo: (),
- //~^ ERROR expected identifier, found keyword `let`
- //~^^ ERROR expected `:`, found `foo`
-}
+++ /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 s {
- bar: ();
- //~^ ERROR expected `,`, or `}`, found `;`
-}
+++ /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
-
-type v = [isize * 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `*`
+++ /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
-
-fn f() {
- let x: fn~() = || (); //~ ERROR expected `(`, found `~`
-}
+++ /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
-
-fn f(+x: isize) {} //~ ERROR expected pattern, found `+`
+++ /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
-
-fn f() {
- let v = [mut 1, 2, 3, 4]; //~ ERROR expected expression, found keyword `mut`
-}
+++ /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
-
-type v = [mut isize]; //~ ERROR expected type, found keyword `mut`
+++ /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
-
-type bptr = &lifetime/isize; //~ ERROR expected one of `!`, `(`, `::`, `;`, or `<`, found `/`
+++ /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
-
-type t = { f: () }; //~ ERROR expected type, found `{`
+++ /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
-// ignore-tidy-linelength
-
-struct S;
-
-impl S {
- static fn f() {}
-}
-//~^^ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`,
+++ /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
-
-fn f() {
- let a_box = box mut 42; //~ ERROR expected expression, found keyword `mut`
-}
+++ /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
-
-type mut_box = Box<mut isize>; //~ ERROR expected one of `>`, lifetime, or type, found `mut`
+++ /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
-
-fn removed_with() {
- struct S {
- foo: (),
- bar: (),
- }
-
- let a = S { foo: (), bar: () };
- let b = S { foo: () with a };
- //~^ ERROR expected one of `,`, `.`, `?`, `}`, or an operator, found `with`
-}
+++ /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
-
-fn removed_with() {
- struct S {
- foo: (),
- bar: (),
- }
-
- let a = S { foo: (), bar: () };
- let b = S { foo: (), with a };
- //~^ ERROR expected one of `,` or `}`, found `a`
-}
+++ /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 f<T>() {}
-
-fn main() {
- false == false == false;
- //~^ ERROR: chained comparison operators require parentheses
-
- false == 0 < 2;
- //~^ ERROR: chained comparison operators require parentheses
-
- f<X>();
- //~^ ERROR: chained comparison operators require parentheses
- //~| HELP: use `::<...>` instead of `<...>`
- //~| HELP: or use `(...)`
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-struct Rgb(u8, u8, u8);
-
-fn main() {
- let _ = Rgb { 0, 1, 2 }; //~ ERROR expected identifier, found `0`
-}
+++ /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
-
-struct Foo {
- x: isize,
-}
-
-impl Foo {
- fn hi(&self) -> bool {
- true
- }
-}
-
-fn main() {
- for x in Foo {
- x: 3 //~ ERROR expected type, found `3`
- }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
- println!("yo");
- }
-}
+++ /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
-
-struct Foo {
- x: isize,
-}
-
-impl Foo {
- fn hi(&self) -> bool {
- true
- }
-}
-
-fn main() {
- if Foo {
- x: 3 //~ ERROR expected type, found `3`
- }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
- println!("yo");
- }
-}
+++ /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
-
-struct Foo {
- x: isize,
-}
-
-fn main() {
- match Foo {
- x: 3 //~ ERROR expected one of `=>`, `@`, `if`, or `|`, found `:`
- } {
- Foo {
- x: x
- } => {} //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `=>`
- }
-}
+++ /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
-
-struct Foo {
- x: isize,
-}
-
-impl Foo {
- fn hi(&self) -> bool {
- true
- }
-}
-
-fn main() {
- while Foo {
- x: 3 //~ ERROR expected type, found `3`
- }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
- println!("yo");
- }
-}
+++ /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
-
-struct Foo {
- x: isize,
-}
-
-impl Foo {
- fn hi(&self) -> bool {
- true
- }
-}
-
-fn main() {
- while || Foo {
- x: 3 //~ ERROR expected type, found `3`
- }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
- println!("yo");
- }
-}
+++ /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
-
-//error-pattern: discriminator values can only be used with a field-less enum
-
-enum color {
- red = 0xff0000,
- green = 0x00ff00,
- blue = 0x0000ff,
- black = 0x000000,
- white = 0xffffff,
- other (str),
-}
+++ /dev/null
-// Copyright 2014 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
-
-// ignore-tidy-cr
-// Issue #11669
-
-fn main() {
- // \r\n
- let ok = "This is \
- a test";
- // \r only
- let bad = "This is \\r a test";
- //~^ ERROR unknown character escape: \r
- //~^^ HELP this is an isolated carriage return
-
-}
+++ /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 -Z continue-parse-after-error
-
-trait Foo {
-}
-
-struct Bar;
-
-impl Foo + Owned for Bar { //~ ERROR expected a trait, found type
-}
-
-fn main() { }
+++ /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.
-
-macro_rules! bah {
- ($a:expr) => ($a)
- //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, or `unsafe`, found `2`
-}
-
-trait bar {
- bah!(2);
-}
-
-fn main() {}
+++ /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
-
-fn main() {
- let _: Box<((Copy)) + Copy>;
- //~^ ERROR expected a path on the left-hand side of `+`, not `((Copy))`
- let _: Box<(Copy + Copy) + Copy>;
- //~^ ERROR expected a path on the left-hand side of `+`, not `(Copy + Copy)`
- let _: Box<(Copy +) + Copy>;
- //~^ ERROR expected a path on the left-hand side of `+`, not `(Copy)`
- let _: Box<(dyn Copy) + Copy>;
- //~^ ERROR expected a path on the left-hand side of `+`, not `(dyn Copy)`
-}
+++ /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
-
-fn f<T: Copy + ('a)>() {} //~ ERROR parenthesized lifetime bounds are not supported
-
-fn main() {
- let _: Box<Copy + ('a)>; //~ ERROR parenthesized lifetime bounds are not supported
- let _: Box<('a) + Copy>; //~ ERROR expected type, found `'a`
-}
+++ /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.
-
-// A single lifetime is not parsed as a type.
-// `ty` matcher in particular doesn't accept a single lifetime
-
-macro_rules! m {
- ($t: ty) => ( let _: $t; )
-}
-
-fn main() {
- m!('static); //~ ERROR expected type, found `'static`
-}
+++ /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.
-
-trait Trait<'a> {}
-
-fn main() {
- let _: &for<'a> Trait<'a> + 'static;
- //~^ ERROR expected a path on the left-hand side of `+`, not `&for<'a> Trait<'a>`
- //~| HELP try adding parentheses
- //~| SUGGESTION &(for<'a> Trait<'a> + 'static)
-}
+++ /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
-
-fn f<T: (Copy) + (?Sized) + (for<'a> Trait<'a>)>() {}
-
-fn main() {
- let _: Box<(Copy) + (?Sized) + (for<'a> Trait<'a>)>;
- let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Copy)>;
- let _: Box<(for<'a> Trait<'a>) + (Copy) + (?Sized)>;
-}
-
-FAIL //~ 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
-// Fixes issue where `+` in generics weren't parsed if they were part of a `+=`.
-
-struct Whitespace<T: Clone + = ()> { t: T }
-struct TokenSplit<T: Clone += ()> { t: T }
-
-fn main() {
-}
-
-FAIL //~ ERROR
+++ /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.
-
-trait Foo {
- pub const Foo: u32;
- //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found
-}
-
-fn main() {}
+++ /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.
-
-trait Foo {
- pub type Foo;
- //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found
-}
-
-fn main() {}
+++ /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.
-
-trait Foo {
- pub fn foo();
- //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2014 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
-
-struct Foo {
- x: isize,
- y: isize,
-}
-
-fn main() {
- let f = Foo {
- x: 1,
- y: 2,
- };
- f.x::<isize>;
- //~^ ERROR field expressions may not have generic arguments
- f.x::<>;
- //~^ ERROR field expressions may not have generic arguments
- f.x::();
- //~^ ERROR field expressions may not have generic arguments
-}
+++ /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
-
-
-// error-pattern: unterminated double quote string
-
-
-fn main() {
- "
-}
+++ /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.
-
-fn main() {
- let a = 42._; //~ ERROR expected identifier, found reserved identifier `_`
- //~^ ERROR `{integer}` is a primitive type and therefore doesn't have fields
-}
+++ /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.
-
-fn main() {
- let _ = "Foo"_;
- //~^ WARNING underscore literal suffix is not allowed
- //~| WARNING this was previously accepted
- //~| NOTE issue #42326
-}
-
-FAIL
-//~^ ERROR
-//~| NOTE
+++ /dev/null
-// Copyright 2014 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 y = 0;
- //~^ ERROR unknown start of token: \u{37e}
- //~^^ HELP Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not
-}
+++ /dev/null
-// Copyright 2014 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
-
-// Test syntax checks for `type` keyword.
-
-struct S1 for type; //~ ERROR expected `where`, `{`, `(`, or `;` after struct name, found `for`
-
-pub fn main() {
-}
+++ /dev/null
-// Copyright 2014 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
-
-// Test syntax checks for `type` keyword.
-
-fn f<X>() {}
-
-pub fn main() {
- f<type>(); //~ ERROR expected expression, found keyword `type`
-}
+++ /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 -Z continue-parse-after-error
-
-use std::any:: as foo; //~ ERROR expected identifier, found keyword `as`
-//~^ ERROR: expected one of `::`, `;`, or `as`, found `foo`
+++ /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
-
-use std::any::; //~ ERROR expected identifier, found `;`
+++ /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
-
-fn foo(x: isize, ...) {
- //~^ ERROR: only foreign functions are allowed to be variadic
-}
-
-fn main() {}
+++ /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
-
-extern "C" fn foo(x: isize, ...) {
- //~^ ERROR: only foreign functions are allowed to be variadic
-}
-
-fn main() {}
+++ /dev/null
-// Copyright 2014 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
-
-// Test diagnostics for the removed struct inheritance feature.
-
-virtual struct SuperStruct { //~ ERROR expected item, found `virtual`
- f1: isize,
-}
-
-struct Struct : SuperStruct;
-
-pub fn main() {}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only -Z continue-parse-after-error
-
-// Empty predicate list is OK
-fn equal1<T>(_: &T, _: &T) -> bool where {
- true
-}
-
-// Empty bound list is OK
-fn equal2<T>(_: &T, _: &T) -> bool where T: {
- true
-}
-
-fn foo<'a>() where 'a {}
-//~^ ERROR expected `:`, found `{`
-
-fn main() {
-}
+++ /dev/null
-// Copyright 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.
-
-// compile-flags: -Z parse-only
-
-fn foo<T>() where <T>::Item: ToString, T: Iterator { }
-//~^ ERROR generic parameters on `where` clauses are reserved for future use
-
-fn main() {}
+++ /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.
-
-fn f() {
- let ok = "{{everything fine}}";
- let bad = "\{it is wrong\}";
- //~^ ERROR unknown character escape: {
- //~^^ HELP if used in a formatting string, curly braces are escaped with `{{` and `}}`
- //~^^^ ERROR unknown character escape: }
- //~^^^^ HELP if used in a formatting string, curly braces are escaped with `{{` and `}}`
-}
--- /dev/null
+// Copyright 2014 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
+
+fn main() {
+ let x = "\x80"; //~ ERROR may only be used
+ let y = "\xff"; //~ ERROR may only be used
+ let z = "\xe2"; //~ ERROR may only be used
+ let a = b"\x00e2"; // ok because byte literal
+}
--- /dev/null
+error: this form of character escape may only be used with characters in the range [/x00-/x7f]
+ --> $DIR/ascii-only-character-escape.rs:14:16
+ |
+LL | let x = "/x80"; //~ ERROR may only be used
+ | ^^
+
+error: this form of character escape may only be used with characters in the range [/x00-/x7f]
+ --> $DIR/ascii-only-character-escape.rs:15:16
+ |
+LL | let y = "/xff"; //~ ERROR may only be used
+ | ^^
+
+error: this form of character escape may only be used with characters in the range [/x00-/x7f]
+ --> $DIR/ascii-only-character-escape.rs:16:16
+ |
+LL | let z = "/xe2"; //~ ERROR may only be used
+ | ^^
+
+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 that_odd_parse() {
+ // following lines below parse and must not fail
+ x = if c { a } else { b }();
+ x = if true { 1 } else { 0 } as *mut _;
+ // however this does not parse and probably should fail to retain compat?
+ // NB: `..` here is arbitrary, failure happens/should happen ∀ops that aren’t `=`
+ // see assoc-oddities-2 and assoc-oddities-3
+ ..if c { a } else { b }[n]; //~ ERROR expected one of
+}
--- /dev/null
+error: expected one of `.`, `;`, `?`, or `}`, found `[`
+ --> $DIR/assoc-oddities-1.rs:20:28
+ |
+LL | ..if c { a } else { b }[n]; //~ ERROR expected one of
+ | ^ expected one of `.`, `;`, `?`, or `}` here
+
+error: aborting due to previous error
+
--- /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 that_odd_parse() {
+ // see assoc-oddities-1 for explanation
+ x..if c { a } else { b }[n]; //~ ERROR expected one of
+}
--- /dev/null
+error: expected one of `.`, `;`, `?`, or `}`, found `[`
+ --> $DIR/assoc-oddities-2.rs:15:29
+ |
+LL | x..if c { a } else { b }[n]; //~ ERROR expected one of
+ | ^ expected one of `.`, `;`, `?`, or `}` here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+// Test you can't use a higher-ranked trait bound inside of a qualified
+// path (just won't parse).
+
+pub trait Foo<T> {
+ type A;
+
+ fn get(&self, t: T) -> Self::A;
+}
+
+fn foo2<I>(x: <I as for<'x> Foo<&'x isize>>::A)
+ //~^ ERROR expected identifier, found keyword `for`
+ //~| ERROR expected one of `::` or `>`
+{
+}
+
+pub fn main() {}
--- /dev/null
+error: expected identifier, found keyword `for`
+ --> $DIR/associated-types-project-from-hrtb-explicit.rs:22:21
+ |
+LL | fn foo2<I>(x: <I as for<'x> Foo<&'x isize>>::A)
+ | ^^^ expected identifier, found keyword
+
+error: expected one of `::` or `>`, found `Foo`
+ --> $DIR/associated-types-project-from-hrtb-explicit.rs:22:29
+ |
+LL | fn foo2<I>(x: <I as for<'x> Foo<&'x isize>>::A)
+ | ^^^ expected one of `::` or `>` here
+
+error: aborting due to 2 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.
+
+#[path =] //~ ERROR unexpected token: `]`
+mod m {}
--- /dev/null
+error: unexpected token: `]`
+ --> $DIR/attr-bad-meta-2.rs:11:9
+ |
+LL | #[path =] //~ ERROR unexpected token: `]`
+ | ^ unexpected token after this
+
+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.
+
+#[path() token] //~ ERROR expected `]`, found `token`
+mod m {}
--- /dev/null
+error: expected `]`, found `token`
+ --> $DIR/attr-bad-meta-3.rs:11:10
+ |
+LL | #[path() token] //~ ERROR expected `]`, found `token`
+ | ^^^^^ expected `]`
+
+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.
+
+#![feature(unrestricted_attribute_tokens)]
+
+#[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
+mod m {}
--- /dev/null
+error: expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
+ --> $DIR/attr-bad-meta.rs:13:7
+ |
+LL | #[path*] //~ ERROR expected one of `(`, `::`, `=`, `[`, `]`, or `{`, found `*`
+ | ^ expected one of `(`, `::`, `=`, `[`, `]`, or `{` here
+
+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
+
+#[derive(Debug)] //~ERROR expected item after attributes
--- /dev/null
+error: expected item after attributes
+ --> $DIR/attr-before-eof.rs:13:16
+ |
+LL | #[derive(Debug)] //~ERROR expected item after attributes
+ | ^
+
+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
+
+// error-pattern:expected statement
+
+fn f() {
+ #[foo = "bar"]
+}
+
+fn main() {
+}
--- /dev/null
+error: expected statement after outer attribute
+ --> $DIR/attr-dangling-in-fn.rs:17:1
+ |
+LL | }
+ | ^
+
+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
+
+// error-pattern:expected item
+
+fn main() {
+}
+
+#[foo = "bar"]
--- /dev/null
+error: expected item after attributes
+ --> $DIR/attr-dangling-in-mod.rs:18:14
+ |
+LL | #[foo = "bar"]
+ | ^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+#![feature(lang_items)]
+
+fn main() {}
+
+#![lang(foo)] //~ ERROR an inner attribute is not permitted in this context
+fn foo() {}
--- /dev/null
+error: an inner attribute is not permitted in this context
+ --> $DIR/attr.rs:17:3
+ |
+LL | #![lang(foo)] //~ ERROR an inner attribute is not permitted in this context
+ | ^
+ |
+ = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
+
+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
+
+// Constants (static variables) can be used to match in patterns, but mutable
+// statics cannot. This ensures that there's some form of error if this is
+// attempted.
+
+extern crate libc;
+
+extern {
+ static mut rust_dbg_static_mut: libc::c_int;
+ pub fn rust_dbg_static_mut_check_four();
+ #[cfg(stage37)] //~ ERROR expected item after attributes
+}
+
+pub fn main() {}
--- /dev/null
+error: expected item after attributes
+ --> $DIR/attrs-after-extern-mod.rs:22:19
+ |
+LL | #[cfg(stage37)] //~ ERROR expected item after attributes
+ | ^
+
+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 -Z continue-parse-after-error
+
+// ignore-tidy-cr
+// ignore-tidy-tab
+fn main() {
+ // these literals are just silly.
+ ''';
+ //~^ ERROR: character constant must be escaped: '
+
+ // note that this is a literal "\n" byte
+ '
+';
+ //~^^ ERROR: character constant must be escaped: \n
+
+ // note that this is a literal "\r" byte
+ '\r'; //~ ERROR: character constant must be escaped: \r
+
+ // note that this is a literal tab character here
+ ' ';
+ //~^ ERROR: character constant must be escaped: \t
+}
--- /dev/null
+error: character constant must be escaped: '
+ --> $DIR/bad-char-literals.rs:17:6
+ |
+LL | ''';
+ | ^
+
+error: character constant must be escaped: /n
+ --> $DIR/bad-char-literals.rs:21:6
+ |
+LL | '
+ | ______^
+LL | | ';
+ | |_
+
+error: character constant must be escaped: /r
+ --> $DIR/bad-char-literals.rs:26:6
+ |
+LL | '\r'; //~ ERROR: character constant must be escaped: /r
+ | ^
+
+error: character constant must be escaped: /t
+ --> $DIR/bad-char-literals.rs:29:6
+ |
+LL | ' ';
+ | ^^^^
+
+error: aborting due to 4 previous errors
+
--- /dev/null
+// Copyright 2014 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
+
+
+extern
+ "C"suffix //~ ERROR ABI spec with a suffix is invalid
+ fn foo() {}
+
+extern
+ "C"suffix //~ ERROR ABI spec with a suffix is invalid
+{}
+
+fn main() {
+ ""suffix; //~ ERROR string literal with a suffix is invalid
+ b""suffix; //~ ERROR byte string literal with a suffix is invalid
+ r#""#suffix; //~ ERROR string literal with a suffix is invalid
+ br#""#suffix; //~ ERROR byte string literal with a suffix is invalid
+ 'a'suffix; //~ ERROR char literal with a suffix is invalid
+ b'a'suffix; //~ ERROR byte literal with a suffix is invalid
+
+ 1234u1024; //~ ERROR invalid width `1024` for integer literal
+ 1234i1024; //~ ERROR invalid width `1024` for integer literal
+ 1234f1024; //~ ERROR invalid width `1024` for float literal
+ 1234.5f1024; //~ ERROR invalid width `1024` for float literal
+
+ 1234suffix; //~ ERROR invalid suffix `suffix` for numeric literal
+ 0b101suffix; //~ ERROR invalid suffix `suffix` for numeric literal
+ 1.0suffix; //~ ERROR invalid suffix `suffix` for float literal
+ 1.0e10suffix; //~ ERROR invalid suffix `suffix` for float literal
+}
--- /dev/null
+error: ABI spec with a suffix is invalid
+ --> $DIR/bad-lit-suffixes.rs:15:5
+ |
+LL | "C"suffix //~ ERROR ABI spec with a suffix is invalid
+ | ^^^^^^^^^
+
+error: ABI spec with a suffix is invalid
+ --> $DIR/bad-lit-suffixes.rs:19:5
+ |
+LL | "C"suffix //~ ERROR ABI spec with a suffix is invalid
+ | ^^^^^^^^^
+
+error: string literal with a suffix is invalid
+ --> $DIR/bad-lit-suffixes.rs:23:5
+ |
+LL | ""suffix; //~ ERROR string literal with a suffix is invalid
+ | ^^^^^^^^
+
+error: byte string literal with a suffix is invalid
+ --> $DIR/bad-lit-suffixes.rs:24:5
+ |
+LL | b""suffix; //~ ERROR byte string literal with a suffix is invalid
+ | ^^^^^^^^^
+
+error: string literal with a suffix is invalid
+ --> $DIR/bad-lit-suffixes.rs:25:5
+ |
+LL | r#""#suffix; //~ ERROR string literal with a suffix is invalid
+ | ^^^^^^^^^^^
+
+error: byte string literal with a suffix is invalid
+ --> $DIR/bad-lit-suffixes.rs:26:5
+ |
+LL | br#""#suffix; //~ ERROR byte string literal with a suffix is invalid
+ | ^^^^^^^^^^^^
+
+error: char literal with a suffix is invalid
+ --> $DIR/bad-lit-suffixes.rs:27:5
+ |
+LL | 'a'suffix; //~ ERROR char literal with a suffix is invalid
+ | ^^^^^^^^^
+
+error: byte literal with a suffix is invalid
+ --> $DIR/bad-lit-suffixes.rs:28:5
+ |
+LL | b'a'suffix; //~ ERROR byte literal with a suffix is invalid
+ | ^^^^^^^^^^
+
+error: invalid width `1024` for integer literal
+ --> $DIR/bad-lit-suffixes.rs:30:5
+ |
+LL | 1234u1024; //~ ERROR invalid width `1024` for integer literal
+ | ^^^^^^^^^
+ |
+ = help: valid widths are 8, 16, 32, 64 and 128
+
+error: invalid width `1024` for integer literal
+ --> $DIR/bad-lit-suffixes.rs:31:5
+ |
+LL | 1234i1024; //~ ERROR invalid width `1024` for integer literal
+ | ^^^^^^^^^
+ |
+ = help: valid widths are 8, 16, 32, 64 and 128
+
+error: invalid width `1024` for float literal
+ --> $DIR/bad-lit-suffixes.rs:32:5
+ |
+LL | 1234f1024; //~ ERROR invalid width `1024` for float literal
+ | ^^^^^^^^^
+ |
+ = help: valid widths are 32 and 64
+
+error: invalid width `1024` for float literal
+ --> $DIR/bad-lit-suffixes.rs:33:5
+ |
+LL | 1234.5f1024; //~ ERROR invalid width `1024` for float literal
+ | ^^^^^^^^^^^
+ |
+ = help: valid widths are 32 and 64
+
+error: invalid suffix `suffix` for numeric literal
+ --> $DIR/bad-lit-suffixes.rs:35:5
+ |
+LL | 1234suffix; //~ ERROR invalid suffix `suffix` for numeric literal
+ | ^^^^^^^^^^
+ |
+ = help: the suffix must be one of the integral types (`u32`, `isize`, etc)
+
+error: invalid suffix `suffix` for numeric literal
+ --> $DIR/bad-lit-suffixes.rs:36:5
+ |
+LL | 0b101suffix; //~ ERROR invalid suffix `suffix` for numeric literal
+ | ^^^^^^^^^^^
+ |
+ = help: the suffix must be one of the integral types (`u32`, `isize`, etc)
+
+error: invalid suffix `suffix` for float literal
+ --> $DIR/bad-lit-suffixes.rs:37:5
+ |
+LL | 1.0suffix; //~ ERROR invalid suffix `suffix` for float literal
+ | ^^^^^^^^^
+ |
+ = help: valid suffixes are `f32` and `f64`
+
+error: invalid suffix `suffix` for float literal
+ --> $DIR/bad-lit-suffixes.rs:38:5
+ |
+LL | 1.0e10suffix; //~ ERROR invalid suffix `suffix` for float literal
+ | ^^^^^^^^^^^^
+ |
+ = help: valid suffixes are `f32` and `f64`
+
+error: aborting due to 16 previous errors
+
--- /dev/null
+// Copyright 2014 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
+
+// error-pattern: expected
+
+fn main() {
+ let isize x = 5;
+ match x;
+}
+
+fn main() {
+}
--- /dev/null
+error: expected one of `:`, `;`, `=`, or `@`, found `x`
+ --> $DIR/bad-match.rs:16:13
+ |
+LL | let isize x = 5;
+ | ^ expected one of `:`, `;`, `=`, or `@` here
+
+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
+
+// error-pattern: expected
+
+fn main() {
+ let x.y::<isize>.z foo;
+}
--- /dev/null
+error: expected one of `:`, `;`, `=`, or `@`, found `.`
+ --> $DIR/bad-name.rs:16:8
+ |
+LL | let x.y::<isize>.z foo;
+ | ^ expected one of `:`, `;`, `=`, or `@` here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+fn foo(_: *()) {
+ //~^ expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate)
+}
--- /dev/null
+error: expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate)
+ --> $DIR/bad-pointer-type.rs:13:11
+ |
+LL | fn foo(_: *()) {
+ | ^
+
+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 false() { } //~ ERROR expected identifier, found keyword `false`
+fn main() { }
--- /dev/null
+error: expected identifier, found keyword `false`
+ --> $DIR/bad-value-ident-false.rs:13:4
+ |
+LL | fn false() { } //~ ERROR expected identifier, found keyword `false`
+ | ^^^^^ expected identifier, found keyword
+
+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 true() { } //~ ERROR expected identifier, found keyword `true`
+fn main() { }
--- /dev/null
+error: expected identifier, found keyword `true`
+ --> $DIR/bad-value-ident-true.rs:13:4
+ |
+LL | fn true() { } //~ ERROR expected identifier, found keyword `true`
+ | ^^^^ expected identifier, found keyword
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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 x: [isize 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3`
+}
--- /dev/null
+error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3`
+ --> $DIR/better-expected.rs:14:19
+ |
+LL | let x: [isize 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3`
+ | - ^ expected one of 7 possible tokens here
+ | |
+ | while parsing the type for `x`
+
+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
+
+fn main() {
+ struct Foo { x: isize }
+ match (Foo { x: 10 }) {
+ Foo { ref x: ref x } => {}, //~ ERROR expected `,`
+ _ => {}
+ }
+}
--- /dev/null
+error: expected `,`
+ --> $DIR/bind-struct-early-modifiers.rs:16:19
+ |
+LL | Foo { ref x: ref x } => {}, //~ ERROR expected `,`
+ | ^
+
+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
+
+fn f<T: ?>() {} //~ ERROR expected identifier, found `>`
--- /dev/null
+error: expected identifier, found `>`
+ --> $DIR/bound-single-question-mark.rs:13:10
+ |
+LL | fn f<T: ?>() {} //~ ERROR expected identifier, found `>`
+ | ^ expected identifier
+
+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 = for<'a 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `'b`
+
+fn main() {}
--- /dev/null
+error: expected one of `,`, `:`, or `>`, found `'b`
+ --> $DIR/bounds-lifetime-1.rs:13:17
+ |
+LL | type A = for<'a 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `'b`
+ | ^^ 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
+
+type A = for<'a + 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `+`
+
+fn main() {}
--- /dev/null
+error: expected one of `,`, `:`, or `>`, found `+`
+ --> $DIR/bounds-lifetime-2.rs:13:17
+ |
+LL | type A = for<'a + 'b> fn(); //~ ERROR expected one of `,`, `:`, or `>`, found `+`
+ | ^ 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
+
+type A where 'a; //~ ERROR expected `:`, found `;`
+
+fn main() {}
--- /dev/null
+error: expected `:`, found `;`
+ --> $DIR/bounds-lifetime-where-1.rs:13:16
+ |
+LL | type A where 'a; //~ ERROR expected `:`, found `;`
+ | ^ expected `:`
+
+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 where 'a: 'b + 'c = u8; // OK
+type A where 'a: 'b, = u8; // OK
+type A where 'a: = u8; // OK
+type A where 'a:, = u8; // OK
+type A where 'a: 'b + 'c = u8; // OK
+type A where = u8; // OK
+type A where 'a: 'b + = u8; // OK
+type A where , = u8; //~ ERROR expected one of `=`, lifetime, or type, found `,`
+
+fn main() {}
--- /dev/null
+error: expected one of `=`, lifetime, or type, found `,`
+ --> $DIR/bounds-lifetime-where.rs:20:14
+ |
+LL | type A where , = u8; //~ ERROR expected one of `=`, lifetime, or type, found `,`
+ | ^ expected one of `=`, lifetime, or type 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
+
+type A = for<'a:> fn(); // OK
+type A = for<'a:,> fn(); // OK
+type A = for<'a> fn(); // OK
+type A = for<> fn(); // OK
+type A = for<'a: 'b + 'c> fn(); // OK (rejected later by ast_validation)
+type A = for<'a: 'b,> fn(); // OK(rejected later by ast_validation)
+type A = for<'a: 'b +> fn(); // OK (rejected later by ast_validation)
+type A = for<'a, T> fn(); // OK (rejected later by ast_validation)
+type A = for<,> fn(); //~ ERROR expected one of `>`, identifier, or lifetime, found `,`
+
+fn main() {}
--- /dev/null
+error: expected one of `>`, identifier, or lifetime, found `,`
+ --> $DIR/bounds-lifetime.rs:21:14
+ |
+LL | type A = for<,> fn(); //~ ERROR expected one of `>`, identifier, or lifetime, found `,`
+ | ^ expected one of `>`, identifier, or lifetime 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
+
+type A where for<'a> for<'b> Trait1 + ?Trait2: 'a + Trait = u8; // OK
+type A where T: Trait, = u8; // OK
+type A where T: = u8; // OK
+type A where T:, = u8; // OK
+type A where T: Trait + Trait = u8; // OK
+type A where = u8; // OK
+type A where T: Trait + = u8; // OK
+type A where T, = u8;
+//~^ ERROR expected one of `!`, `(`, `+`, `::`, `:`, `<`, `==`, or `=`, found `,`
+
+fn main() {}
--- /dev/null
+error: expected one of `!`, `(`, `+`, `::`, `:`, `<`, `==`, or `=`, found `,`
+ --> $DIR/bounds-type-where.rs:20:15
+ |
+LL | type A where T, = u8;
+ | ^ expected one of 8 possible tokens 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
+
+struct S<
+ T: 'a + Tr, // OK
+ T: Tr + 'a, // OK
+ T: 'a, // OK
+ T:, // OK
+ T: ?for<'a> Trait, // OK
+ T: Tr +, // OK
+ T: ?'a, //~ ERROR `?` may only modify trait bounds, not lifetime bounds
+>;
+
+fn main() {}
--- /dev/null
+error: `?` may only modify trait bounds, not lifetime bounds
+ --> $DIR/bounds-type.rs:20:8
+ |
+LL | T: ?'a, //~ ERROR `?` may only modify trait bounds, not lifetime bounds
+ | ^
+
+error: aborting due to previous error
+
--- /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 foo() {
+ match x {
+ <T as Trait>::Type{key: value} => (),
+ //~^ ERROR unexpected `{` after qualified path
+ _ => (),
+ }
+}
--- /dev/null
+error: unexpected `{` after qualified path
+ --> $DIR/brace-after-qualified-path-in-match.rs:15:27
+ |
+LL | <T as Trait>::Type{key: value} => (),
+ | ^ unexpected `{` after qualified path
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+
+// ignore-tidy-tab
+
+static FOO: u8 = b'\f'; //~ ERROR unknown byte escape
+
+pub fn main() {
+ b'\f'; //~ ERROR unknown byte escape
+ b'\x0Z'; //~ ERROR invalid character in numeric character escape: Z
+ b' '; //~ ERROR byte constant must be escaped
+ b'''; //~ ERROR byte constant must be escaped
+ b'é'; //~ ERROR byte constant must be ASCII
+ b'a //~ ERROR unterminated byte constant
+}
--- /dev/null
+error: unknown byte escape: f
+ --> $DIR/byte-literals.rs:16:21
+ |
+LL | static FOO: u8 = b'/f'; //~ ERROR unknown byte escape
+ | ^
+
+error: unknown byte escape: f
+ --> $DIR/byte-literals.rs:19:8
+ |
+LL | b'/f'; //~ ERROR unknown byte escape
+ | ^
+
+error: invalid character in numeric character escape: Z
+ --> $DIR/byte-literals.rs:20:10
+ |
+LL | b'/x0Z'; //~ ERROR invalid character in numeric character escape: Z
+ | ^
+
+error: byte constant must be escaped: /t
+ --> $DIR/byte-literals.rs:21:7
+ |
+LL | b' '; //~ ERROR byte constant must be escaped
+ | ^^^^
+
+error: byte constant must be escaped: '
+ --> $DIR/byte-literals.rs:22:7
+ |
+LL | b'''; //~ ERROR byte constant must be escaped
+ | ^
+
+error: byte constant must be ASCII. Use a /xHH escape for a non-ASCII byte
+ --> $DIR/byte-literals.rs:23:7
+ |
+LL | b'é'; //~ ERROR byte constant must be ASCII
+ | ^
+
+error: unterminated byte constant: b'a
+ --> $DIR/byte-literals.rs:24:5
+ |
+LL | b'a //~ ERROR unterminated byte constant
+ | ^^^
+
+error: aborting due to 7 previous errors
+
--- /dev/null
+// Copyright 2014 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
+
+
+// ignore-tidy-tab
+
+static FOO: &'static [u8] = b"\f"; //~ ERROR unknown byte escape
+
+pub fn main() {
+ b"\f"; //~ ERROR unknown byte escape
+ b"\x0Z"; //~ ERROR invalid character in numeric character escape: Z
+ b"é"; //~ ERROR byte constant must be ASCII
+ b"a //~ ERROR unterminated double quote byte string
+}
--- /dev/null
+error: unknown byte escape: f
+ --> $DIR/byte-string-literals.rs:16:32
+ |
+LL | static FOO: &'static [u8] = b"/f"; //~ ERROR unknown byte escape
+ | ^
+
+error: unknown byte escape: f
+ --> $DIR/byte-string-literals.rs:19:8
+ |
+LL | b"/f"; //~ ERROR unknown byte escape
+ | ^
+
+error: invalid character in numeric character escape: Z
+ --> $DIR/byte-string-literals.rs:20:10
+ |
+LL | b"/x0Z"; //~ ERROR invalid character in numeric character escape: Z
+ | ^
+
+error: byte constant must be ASCII. Use a /xHH escape for a non-ASCII byte
+ --> $DIR/byte-string-literals.rs:21:7
+ |
+LL | b"é"; //~ ERROR byte constant must be ASCII
+ | ^
+
+error: unterminated double quote byte string
+ --> $DIR/byte-string-literals.rs:22:7
+ |
+LL | b"a //~ ERROR unterminated double quote byte string
+ | _______^
+LL | | }
+ | |__^
+
+error: aborting due to 5 previous errors
+
--- /dev/null
+// Copyright 2013-2014 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
+
+// ignore-test: this is an auxiliary file for circular-modules-main.rs
+
+#[path = "circular_modules_main.rs"]
+mod circular_modules_main;
+
+pub fn say_hello() {
+ println!("{}", circular_modules_main::hi_str());
+}
--- /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
+
+#[path = "circular_modules_hello.rs"]
+mod circular_modules_hello; //~ ERROR: circular modules
+
+pub fn hi_str() -> String {
+ "Hi!".to_string()
+}
+
+fn main() {
+ circular_modules_hello::say_hello();
+}
--- /dev/null
+error: circular modules: $DIR/circular_modules_hello.rs -> $DIR/circular_modules_main.rs -> $DIR/circular_modules_hello.rs
+ --> $DIR/circular_modules_main.rs:14:5
+ |
+LL | mod circular_modules_hello; //~ ERROR: circular modules
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+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
+
+// error-pattern:nonexistent
+class cat : nonexistent {
+ let meows: usize;
+ new(in_x : usize) { self.meows = in_x; }
+}
+
+fn main() {
+ let nyan = cat(0);
+}
--- /dev/null
+error: expected one of `!` or `::`, found `cat`
+ --> $DIR/class-implements-bad-trait.rs:14:7
+ |
+LL | class cat : nonexistent {
+ | ^^^ expected one of `!` or `::` here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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.
+
+// Test that we cannot parse a closure with an explicit return type
+// unless it uses braces.
+
+fn main() {
+ let x = || -> i32 22;
+ //~^ ERROR expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22`
+}
--- /dev/null
+error: expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22`
+ --> $DIR/closure-return-syntax.rs:15:23
+ |
+LL | let x = || -> i32 22;
+ | ^^ expected one of `!`, `(`, `+`, `::`, `<`, or `{` here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+# //~ ERROR 13:1: 13:2: expected `[`, found `<eof>`
--- /dev/null
+error: expected `[`, found `<eof>`
+ --> $DIR/column-offset-1-based.rs:13:1
+ |
+LL | # //~ ERROR 13:1: 13:2: expected `[`, found `<eof>`
+ | ^ expected `[`
+
+error: aborting due to previous error
+
--- /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
+
+// Test successful and unsuccessful parsing of the `default` contextual keyword
+
+trait Foo {
+ fn foo<T: Default>() -> T;
+}
+
+impl Foo for u8 {
+ default fn foo<T: Default>() -> T {
+ T::default()
+ }
+}
+
+impl Foo for u16 {
+ pub default fn foo<T: Default>() -> T {
+ T::default()
+ }
+}
+
+impl Foo for u32 {
+ default pub fn foo<T: Default>() -> T { T::default() } //~ ERROR expected one of
+}
+
+fn main() {}
--- /dev/null
+error: expected one of `async`, `const`, `existential`, `extern`, `fn`, `type`, or `unsafe`, found `pub`
+ --> $DIR/default.rs:32:13
+ |
+LL | default pub fn foo<T: Default>() -> T { T::default() } //~ ERROR expected one of
+ | ^^^ expected one of 7 possible tokens 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 main() {
+ let _: Option<()> = do catch {};
+ //~^ ERROR found removed `do catch` syntax
+ //~^^ HELP Following RFC #2388, the new non-placeholder syntax is `try`
+}
--- /dev/null
+error: found removed `do catch` syntax
+ --> $DIR/do-catch-suggests-try.rs:14:25
+ |
+LL | let _: Option<()> = do catch {};
+ | ^^
+ |
+ = help: Following RFC #2388, the new non-placeholder syntax is `try`
+
+error: aborting due to previous error
+
--- /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 continue-parse-after-error
+
+struct X {
+ a: u8 /** document a */,
+ //~^ ERROR found a documentation comment that doesn't document anything
+ //~| HELP maybe a comment was intended
+}
+
+struct Y {
+ a: u8 /// document a
+ //~^ ERROR found a documentation comment that doesn't document anything
+ //~| HELP maybe a comment was intended
+}
+
+fn main() {
+ let x = X { a: 1 };
+ let y = Y { a: 1 };
+}
--- /dev/null
+error[E0585]: found a documentation comment that doesn't document anything
+ --> $DIR/doc-after-struct-field.rs:14:11
+ |
+LL | a: u8 /** document a */,
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+
+error[E0585]: found a documentation comment that doesn't document anything
+ --> $DIR/doc-after-struct-field.rs:20:11
+ |
+LL | a: u8 /// document a
+ | ^^^^^^^^^^^^^^
+ |
+ = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0585`.
--- /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
+
+/// hi
+#[derive(Debug)] //~ERROR expected item after attributes
--- /dev/null
+error: expected item after attributes
+ --> $DIR/doc-before-attr.rs:14:16
+ |
+LL | #[derive(Debug)] //~ERROR expected item after attributes
+ | ^
+
+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
+
+/// hi //~ERROR expected item after doc comment
--- /dev/null
+error: expected item after doc comment
+ --> $DIR/doc-before-eof.rs:13:1
+ |
+LL | /// hi //~ERROR expected item after doc comment
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+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
+
+extern {
+ /// hi
+ //~^ ERROR expected item after doc comment
+}
--- /dev/null
+error: expected item after doc comment
+ --> $DIR/doc-before-extern-rbrace.rs:14:5
+ |
+LL | /// hi
+ | ^^^^^^
+
+error: aborting due to previous error
+
--- /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 continue-parse-after-error
+fn main() {
+ /// document
+ //~^ ERROR found a documentation comment that doesn't document anything
+ //~| HELP maybe a comment was intended
+}
--- /dev/null
+error[E0585]: found a documentation comment that doesn't document anything
+ --> $DIR/doc-before-fn-rbrace.rs:13:5
+ |
+LL | /// document
+ | ^^^^^^^^^^^^
+ |
+ = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0585`.
--- /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 continue-parse-after-error
+fn /// document
+foo() {}
+//~^^ ERROR expected identifier, found `/// document`
+
+fn main() {
+ foo();
+}
--- /dev/null
+error: expected identifier, found `/// document`
+ --> $DIR/doc-before-identifier.rs:12:4
+ |
+LL | fn /// document
+ | ^^^^^^^^^^^^ expected identifier
+
+error: aborting due to previous error
+
--- /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 continue-parse-after-error
+mod Foo {
+ /// document
+ //~^ ERROR expected item after doc comment
+}
--- /dev/null
+error: expected item after doc comment
+ --> $DIR/doc-before-mod-rbrace.rs:13:5
+ |
+LL | /// document
+ | ^^^^^^^^^^^^
+
+error[E0601]: `main` function not found in crate `doc_before_mod_rbrace`
+ |
+ = note: consider adding a `main` function to `$DIR/doc-before-mod-rbrace.rs`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0601`.
--- /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 main() {
+ println!("Hi"); /// hi
+ //~^ ERROR found a documentation comment that doesn't document anything
+ //~| HELP maybe a comment was intended
+}
--- /dev/null
+error[E0585]: found a documentation comment that doesn't document anything
+ --> $DIR/doc-before-rbrace.rs:14:21
+ |
+LL | println!("Hi"); /// hi
+ | ^^^^^^
+ |
+ = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0585`.
--- /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 main() {
+ /// hi
+ //~^ ERROR found a documentation comment that doesn't document anything
+ //~| HELP maybe a comment was intended
+ ;
+}
--- /dev/null
+error[E0585]: found a documentation comment that doesn't document anything
+ --> $DIR/doc-before-semi.rs:14:5
+ |
+LL | /// hi
+ | ^^^^^^
+ |
+ = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0585`.
--- /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 continue-parse-after-error
+struct X {
+ a: u8,
+ /// document
+ //~^ ERROR found a documentation comment that doesn't document anything
+ //~| HELP maybe a comment was intended
+}
+
+fn main() {
+ let y = X {a: 1};
+}
--- /dev/null
+error[E0585]: found a documentation comment that doesn't document anything
+ --> $DIR/doc-before-struct-rbrace-1.rs:14:5
+ |
+LL | /// document
+ | ^^^^^^^^^^^^
+ |
+ = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0585`.
--- /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 continue-parse-after-error
+struct X {
+ a: u8 /// document
+ //~^ ERROR found a documentation comment that doesn't document anything
+ //~| HELP maybe a comment was intended
+}
+
+fn main() {
+ let y = X {a: 1};
+}
--- /dev/null
+error[E0585]: found a documentation comment that doesn't document anything
+ --> $DIR/doc-before-struct-rbrace-2.rs:13:11
+ |
+LL | a: u8 /// document
+ | ^^^^^^^^^^^^
+ |
+ = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0585`.
--- /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
+
+// error-pattern:expected one of `(`, `fn`, `static`, or `type`
+extern {
+ pub pub fn foo();
+}
--- /dev/null
+error: expected one of `(`, `fn`, `static`, or `type`, found `pub`
+ --> $DIR/duplicate-visibility.rs:15:9
+ |
+LL | pub pub fn foo();
+ | ^^^ expected one of `(`, `fn`, `static`, or `type` here
+
+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
+
+impl Foo; //~ ERROR expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;`
--- /dev/null
+error: expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;`
+ --> $DIR/empty-impl-semicolon.rs:13:9
+ |
+LL | impl Foo; //~ ERROR expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;`
+ | ^ expected one of 8 possible tokens here
+
+error: aborting due to previous error
+
--- /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.
+
+extern crte foo; //~ ERROR expected one of `crate`, `fn`, or `{`, found `crte`
--- /dev/null
+error: expected one of `crate`, `fn`, or `{`, found `crte`
+ --> $DIR/extern-crate-unexpected-token.rs:11:8
+ |
+LL | extern crte foo; //~ ERROR expected one of `crate`, `fn`, or `{`, found `crte`
+ | ^^^^ expected one of `crate`, `fn`, or `{` here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+// Verifies that the expected token errors for `extern crate` are
+// raised
+
+extern "C" mod foo; //~ERROR expected one of `fn` or `{`, found `mod`
--- /dev/null
+error: expected one of `fn` or `{`, found `mod`
+ --> $DIR/extern-expected-fn-or-brace.rs:16:12
+ |
+LL | extern "C" mod foo; //~ERROR expected one of `fn` or `{`, found `mod`
+ | ^^^ expected one of `fn` or `{` here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+// Verifies that the expected token errors for `extern crate` are
+// raised
+
+extern crate foo {} //~ERROR expected one of `;` or `as`, found `{`
--- /dev/null
+error: expected one of `;` or `as`, found `{`
+ --> $DIR/extern-foreign-crate.rs:16:18
+ |
+LL | extern crate foo {} //~ERROR expected one of `;` or `as`, found `{`
+ | ^ expected one of `;` or `as` here
+
+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
+
+extern { //~ ERROR missing `fn`, `type`, or `static` for extern-item declaration
+ f();
+}
+
+fn main() {
+}
--- /dev/null
+error: missing `fn`, `type`, or `static` for extern-item declaration
+ --> $DIR/extern-no-fn.rs:13:9
+ |
+LL | extern { //~ ERROR missing `fn`, `type`, or `static` for extern-item declaration
+ | _________^
+LL | | f();
+ | |____^ missing `fn`, `type`, or `static`
+
+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
+
+impl <*const u8>::AssocTy {} // OK
+impl <Type as Trait>::AssocTy {} // OK
+impl <'a + Trait>::AssocTy {} // OK
+impl <<Type>::AssocTy>::AssocTy {} // OK
+
+FAIL //~ ERROR
--- /dev/null
+error: expected one of `!` or `::`, found `<eof>`
+ --> $DIR/impl-qpath.rs:18:1
+ |
+LL | FAIL //~ ERROR
+ | ^^^^ expected one of `!` or `::` here
+
+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
+
+// error-pattern:expected
+use foo::{bar}::baz
--- /dev/null
+error: expected `;`, found `::`
+ --> $DIR/import-from-path.rs:14:15
+ |
+LL | use foo::{bar}::baz
+ | ^^ expected `;`
+
+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
+
+// error-pattern:expected
+
+use foo::{bar} as baz;
+
+mod foo {
+ pub fn bar() {}
+}
+
+fn main() {
+}
--- /dev/null
+error: expected `;`, found `as`
+ --> $DIR/import-from-rename.rs:15:16
+ |
+LL | use foo::{bar} as baz;
+ | ^^ expected `;`
+
+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
+
+// error-pattern:expected
+use foo::*::bar
--- /dev/null
+error: expected `;`, found `::`
+ --> $DIR/import-glob-path.rs:14:11
+ |
+LL | use foo::*::bar
+ | ^^ expected `;`
+
+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
+
+// error-pattern:expected
+
+use foo::* as baz;
+
+mod foo {
+ pub fn bar() {}
+}
+
+fn main() {
+}
--- /dev/null
+error: expected `;`, found `as`
+ --> $DIR/import-glob-rename.rs:15:12
+ |
+LL | use foo::* as baz;
+ | ^^ expected `;`
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+#![feature(lang_items)]
+/**
+ * My module
+ */
+
+#![recursion_limit="100"]
+//~^ ERROR an inner attribute is not permitted following an outer doc comment
+fn main() {}
--- /dev/null
+error: an inner attribute is not permitted following an outer doc comment
+ --> $DIR/inner-attr-after-doc-comment.rs:18:3
+ |
+LL | #![recursion_limit="100"]
+ | ^
+ |
+ = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+#[feature(lang_items)]
+
+#![recursion_limit="100"] //~ ERROR an inner attribute is not permitted following an outer attribute
+fn main() {}
--- /dev/null
+error: an inner attribute is not permitted following an outer attribute
+ --> $DIR/inner-attr.rs:15:3
+ |
+LL | #![recursion_limit="100"] //~ ERROR an inner attribute is not permitted following an outer attribute
+ | ^
+ |
+ = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+// issue #17123
+
+fn main() {
+ 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
+ //~^ ERROR int literal is too large
+ ; // the span shouldn't point to this.
+}
--- /dev/null
+error: int literal is too large
+ --> $DIR/int-literal-too-large-span.rs:16:5
+ |
+LL | 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2012-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 A { foo: isize }
+
+fn a() -> A { panic!() }
+
+fn main() {
+ let A { .., } = a(); //~ ERROR: expected `}`
+}
--- /dev/null
+error: expected `}`, found `,`
+ --> $DIR/issue-10392-2.rs:18:15
+ |
+LL | let A { .., } = a(); //~ ERROR: expected `}`
+ | --^
+ | | |
+ | | expected `}`
+ | | help: remove this comma
+ | `..` must be at the end and cannot have a trailing comma
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2012-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 A { foo: isize }
+
+fn a() -> A { panic!() }
+
+fn main() {
+ let A { , } = a(); //~ ERROR: expected ident
+}
--- /dev/null
+error: expected identifier, found `,`
+ --> $DIR/issue-10392.rs:18:13
+ |
+LL | let A { , } = a(); //~ ERROR: expected ident
+ | ^ expected identifier
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+enum X<'a, T, 'b> {
+//~^ ERROR lifetime parameters must be declared prior to type parameters
+ A(&'a T)
+}
--- /dev/null
+error: lifetime parameters must be declared prior to type parameters
+ --> $DIR/issue-14303-enum.rs:13:15
+ |
+LL | enum X<'a, T, 'b> {
+ | ^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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<'a, T, 'b>(x: &'a T) {}
+//~^ ERROR lifetime parameters must be declared prior to type parameters
--- /dev/null
+error: lifetime parameters must be declared prior to type parameters
+ --> $DIR/issue-14303-fn-def.rs:13:15
+ |
+LL | fn foo<'a, T, 'b>(x: &'a T) {}
+ | ^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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() {
+ (0..4)
+ .map(|x| x * 2)
+ .collect::<Vec<'a, usize, 'b>>()
+ //~^ ERROR lifetime parameters must be declared prior to type parameters
+}
--- /dev/null
+error: lifetime parameters must be declared prior to type parameters
+ --> $DIR/issue-14303-fncall.rs:16:31
+ |
+LL | .collect::<Vec<'a, usize, 'b>>()
+ | ^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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 X { x: isize }
+
+impl<'a, T, 'b> X {}
+//~^ ERROR lifetime parameters must be declared prior to type parameters
--- /dev/null
+error: lifetime parameters must be declared prior to type parameters
+ --> $DIR/issue-14303-impl.rs:15:13
+ |
+LL | impl<'a, T, 'b> X {}
+ | ^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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 bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
+//~^ ERROR lifetime parameters must be declared prior to type parameters
--- /dev/null
+error: lifetime parameters must be declared prior to type parameters
+ --> $DIR/issue-14303-path.rs:13:37
+ |
+LL | fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
+ | ^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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 X<'a, T, 'b> {
+//~^ ERROR lifetime parameters must be declared prior to type parameters
+ x: &'a T
+}
--- /dev/null
+error: lifetime parameters must be declared prior to type parameters
+ --> $DIR/issue-14303-struct.rs:13:17
+ |
+LL | struct X<'a, T, 'b> {
+ | ^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+trait Foo<'a, T, 'b> {}
+//~^ ERROR lifetime parameters must be declared prior to type parameters
--- /dev/null
+error: lifetime parameters must be declared prior to type parameters
+ --> $DIR/issue-14303-trait.rs:13:18
+ |
+LL | trait Foo<'a, T, 'b> {}
+ | ^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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 ref
+ (); //~ ERROR expected identifier, found `(`
+}
--- /dev/null
+error: expected identifier, found `(`
+ --> $DIR/issue-15914.rs:15:9
+ |
+LL | (); //~ ERROR expected identifier, found `(`
+ | ^ expected identifier
+
+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
+
+// error-pattern:expected `[`, found `vec`
+mod blade_runner {
+ #vec[doc(
+ brief = "Blade Runner is probably the best movie ever",
+ desc = "I like that in the world of Blade Runner it is always
+ raining, and that it's always night time. And Aliens
+ was also a really good movie.
+
+ Alien 3 was crap though."
+ )]
+}
--- /dev/null
+error: expected `[`, found `vec`
+ --> $DIR/issue-1655.rs:15:6
+ |
+LL | #vec[doc(
+ | ^^^ expected `[`
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+enum X {
+ A =
+ b'a' //~ ERROR discriminator values can only be used with a field-less enum
+ ,
+ B(isize)
+}
+
+fn main() {}
--- /dev/null
+error: discriminator values can only be used with a field-less enum
+ --> $DIR/issue-17383.rs:15:9
+ |
+LL | b'a' //~ ERROR discriminator values can only be used with a field-less enum
+ | ^^^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+const
+mut //~ ERROR: const globals cannot be mutable
+//~^ HELP did you mean to declare a static?
+FOO: usize = 3;
+
+fn main() {
+}
--- /dev/null
+error: const globals cannot be mutable
+ --> $DIR/issue-17718-const-mut.rs:14:1
+ |
+LL | mut //~ ERROR: const globals cannot be mutable
+ | ^^^
+ |
+ = help: did you mean to declare a static?
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+struct Bar<T> { x: T } where T: Copy //~ ERROR expected item, found `where`
+
+fn main() {}
--- /dev/null
+error: expected item, found `where`
+ --> $DIR/issue-17904-2.rs:13:24
+ |
+LL | struct Bar<T> { x: T } where T: Copy //~ ERROR expected item, found `where`
+ | ^^^^^ expected item
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+struct Baz<U> where U: Eq(U); //This is parsed as the new Fn* style parenthesis syntax.
+struct Baz<U> where U: Eq(U) -> R; // Notice this parses as well.
+struct Baz<U>(U) where U: Eq; // This rightfully signals no error as well.
+struct Foo<T> where T: Copy, (T); //~ ERROR expected one of `:`, `==`, or `=`, found `;`
+
+fn main() {}
--- /dev/null
+error: expected one of `:`, `==`, or `=`, found `;`
+ --> $DIR/issue-17904.rs:16:33
+ |
+LL | struct Foo<T> where T: Copy, (T); //~ ERROR expected one of `:`, `==`, or `=`, found `;`
+ | ^ expected one of `:`, `==`, or `=` here
+
+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
+
+// error-pattern:no valid digits found for number
+fn main() {
+ log(error, 0b);
+}
--- /dev/null
+error: no valid digits found for number
+ --> $DIR/issue-1802-1.rs:15:16
+ |
+LL | log(error, 0b);
+ | ^^
+
+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
+
+// error-pattern:no valid digits found for number
+fn main() {
+ log(error, 0b_usize);
+}
--- /dev/null
+error: no valid digits found for number
+ --> $DIR/issue-1802-2.rs:15:16
+ |
+LL | log(error, 0b_usize);
+ | ^^^
+
+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 main() {
+ let t = (42, 42);
+ t.0::<isize>; //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `::`
+}
--- /dev/null
+error: expected one of `.`, `;`, `?`, `}`, or an operator, found `::`
+ --> $DIR/issue-19096.rs:15:8
+ |
+LL | t.0::<isize>; //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `::`
+ | ^^ expected one of `.`, `;`, `?`, `}`, or an operator here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+trait T {
+ extern "Rust" unsafe fn foo(); //~ ERROR expected `fn`, found `unsafe`
+}
+
+fn main() {}
--- /dev/null
+error: expected `fn`, found `unsafe`
+ --> $DIR/issue-19398.rs:14:19
+ |
+LL | extern "Rust" unsafe fn foo(); //~ ERROR expected `fn`, found `unsafe`
+ | ^^^^^^ expected `fn` here
+
+error: aborting due to previous error
+
--- /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
+// ignore-tidy-linelength
+
+struct Foo;
+
+impl Foo {
+ fn foo() {}
+
+ #[stable(feature = "rust1", since = "1.0.0")]
+} //~ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or
+
+fn main() {}
--- /dev/null
+error: expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}`
+ --> $DIR/issue-20711-2.rs:20:1
+ |
+LL | #[stable(feature = "rust1", since = "1.0.0")]
+ | - expected one of 10 possible tokens here
+LL | } //~ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or
+ | ^ unexpected token
+
+error: aborting due to previous error
+
--- /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
+// ignore-tidy-linelength
+
+struct Foo;
+
+impl Foo {
+ #[stable(feature = "rust1", since = "1.0.0")]
+} //~ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or
+
+fn main() {}
--- /dev/null
+error: expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}`
+ --> $DIR/issue-20711.rs:18:1
+ |
+LL | #[stable(feature = "rust1", since = "1.0.0")]
+ | - expected one of 10 possible tokens here
+LL | } //~ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or
+ | ^ unexpected token
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+trait MyTrait<T>: Iterator { //~ ERROR missing `fn`, `type`, or `const`
+ Item = T;
+}
--- /dev/null
+error: missing `fn`, `type`, or `const` for trait-item declaration
+ --> $DIR/issue-21153.rs:13:29
+ |
+LL | trait MyTrait<T>: Iterator { //~ ERROR missing `fn`, `type`, or `const`
+ | _____________________________^
+LL | | Item = T;
+ | |____^ missing `fn`, `type`, or `const`
+
+error: aborting due to previous error
+
--- /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.
+
+fn main() {
+ let caller<F> = |f: F| //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
+ where F: Fn() -> i32
+ {
+ let x = f();
+ println!("Y {}",x);
+ return x;
+ };
+
+ caller(bar_handler);
+}
+
+fn bar_handler() -> i32 {
+ 5
+}
--- /dev/null
+error: expected one of `:`, `;`, `=`, or `@`, found `<`
+ --> $DIR/issue-22647.rs:12:15
+ |
+LL | let caller<F> = |f: F| //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
+ | ^ expected one of `:`, `;`, `=`, or `@` here
+
+error: aborting due to previous error
+
--- /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.
+
+struct Foo<B> {
+ buffer: B
+}
+
+fn bar() {
+ let Foo<Vec<u8>> //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
+}
+
+fn main() {}
--- /dev/null
+error: expected one of `:`, `;`, `=`, or `@`, found `<`
+ --> $DIR/issue-22712.rs:16:12
+ |
+LL | let Foo<Vec<u8>> //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `<`
+ | ^ expected one of `:`, `;`, `=`, or `@` here
+
+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
+
+static foo: isize = 2; } //~ ERROR unexpected close delimiter:
--- /dev/null
+error: unexpected close delimiter: `}`
+ --> $DIR/issue-2354-1.rs:13:24
+ |
+LL | static foo: isize = 2; } //~ ERROR unexpected close delimiter:
+ | ^ unexpected close delimiter
+
+error: aborting due to previous error
+
--- /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 -Z continue-parse-after-error
+
+fn main() {
+ let _ = b"\u{a66e}";
+ //~^ ERROR unicode escape sequences cannot be used as a byte or in a byte string
+
+ let _ = b'\u{a66e}';
+ //~^ ERROR unicode escape sequences cannot be used as a byte or in a byte string
+
+ let _ = b'\u';
+ //~^ ERROR incorrect unicode escape sequence
+ //~^^ ERROR unicode escape sequences cannot be used as a byte or in a byte string
+
+ let _ = b'\x5';
+ //~^ ERROR numeric character escape is too short
+
+ let _ = b'\xxy';
+ //~^ ERROR invalid character in numeric character escape: x
+ //~^^ ERROR invalid character in numeric character escape: y
+
+ let _ = '\x5';
+ //~^ ERROR numeric character escape is too short
+
+ let _ = '\xxy';
+ //~^ ERROR invalid character in numeric character escape: x
+ //~^^ ERROR invalid character in numeric character escape: y
+
+ let _ = b"\u{a4a4} \xf \u";
+ //~^ ERROR unicode escape sequences cannot be used as a byte or in a byte string
+ //~^^ ERROR invalid character in numeric character escape:
+ //~^^^ ERROR incorrect unicode escape sequence
+ //~^^^^ ERROR unicode escape sequences cannot be used as a byte or in a byte string
+
+ let _ = "\xf \u";
+ //~^ ERROR invalid character in numeric character escape:
+ //~^^ ERROR form of character escape may only be used with characters in the range [\x00-\x7f]
+ //~^^^ ERROR incorrect unicode escape sequence
+}
--- /dev/null
+error: unicode escape sequences cannot be used as a byte or in a byte string
+ --> $DIR/issue-23620-invalid-escapes.rs:14:15
+ |
+LL | let _ = b"/u{a66e}";
+ | ^^^^^^^^
+
+error: unicode escape sequences cannot be used as a byte or in a byte string
+ --> $DIR/issue-23620-invalid-escapes.rs:17:15
+ |
+LL | let _ = b'/u{a66e}';
+ | ^^^^^^^^
+
+error: incorrect unicode escape sequence
+ --> $DIR/issue-23620-invalid-escapes.rs:20:15
+ |
+LL | let _ = b'/u';
+ | ^^
+ |
+help: format of unicode escape sequences is `/u{…}`
+ --> $DIR/issue-23620-invalid-escapes.rs:20:15
+ |
+LL | let _ = b'/u';
+ | ^^
+
+error: unicode escape sequences cannot be used as a byte or in a byte string
+ --> $DIR/issue-23620-invalid-escapes.rs:20:15
+ |
+LL | let _ = b'/u';
+ | ^^
+
+error: numeric character escape is too short
+ --> $DIR/issue-23620-invalid-escapes.rs:24:17
+ |
+LL | let _ = b'/x5';
+ | ^
+
+error: invalid character in numeric character escape: x
+ --> $DIR/issue-23620-invalid-escapes.rs:27:17
+ |
+LL | let _ = b'/xxy';
+ | ^
+
+error: invalid character in numeric character escape: y
+ --> $DIR/issue-23620-invalid-escapes.rs:27:18
+ |
+LL | let _ = b'/xxy';
+ | ^
+
+error: numeric character escape is too short
+ --> $DIR/issue-23620-invalid-escapes.rs:31:16
+ |
+LL | let _ = '/x5';
+ | ^
+
+error: invalid character in numeric character escape: x
+ --> $DIR/issue-23620-invalid-escapes.rs:34:16
+ |
+LL | let _ = '/xxy';
+ | ^
+
+error: invalid character in numeric character escape: y
+ --> $DIR/issue-23620-invalid-escapes.rs:34:17
+ |
+LL | let _ = '/xxy';
+ | ^
+
+error: unicode escape sequences cannot be used as a byte or in a byte string
+ --> $DIR/issue-23620-invalid-escapes.rs:38:15
+ |
+LL | let _ = b"/u{a4a4} /xf /u";
+ | ^^^^^^^^
+
+error: invalid character in numeric character escape:
+ --> $DIR/issue-23620-invalid-escapes.rs:38:27
+ |
+LL | let _ = b"/u{a4a4} /xf /u";
+ | ^
+
+error: incorrect unicode escape sequence
+ --> $DIR/issue-23620-invalid-escapes.rs:38:28
+ |
+LL | let _ = b"/u{a4a4} /xf /u";
+ | ^^
+ |
+help: format of unicode escape sequences is `/u{…}`
+ --> $DIR/issue-23620-invalid-escapes.rs:38:28
+ |
+LL | let _ = b"/u{a4a4} /xf /u";
+ | ^^
+
+error: unicode escape sequences cannot be used as a byte or in a byte string
+ --> $DIR/issue-23620-invalid-escapes.rs:38:28
+ |
+LL | let _ = b"/u{a4a4} /xf /u";
+ | ^^
+
+error: invalid character in numeric character escape:
+ --> $DIR/issue-23620-invalid-escapes.rs:44:17
+ |
+LL | let _ = "/xf /u";
+ | ^
+
+error: this form of character escape may only be used with characters in the range [/x00-/x7f]
+ --> $DIR/issue-23620-invalid-escapes.rs:44:16
+ |
+LL | let _ = "/xf /u";
+ | ^^
+
+error: incorrect unicode escape sequence
+ --> $DIR/issue-23620-invalid-escapes.rs:44:18
+ |
+LL | let _ = "/xf /u";
+ | ^^
+ |
+help: format of unicode escape sequences is `/u{…}`
+ --> $DIR/issue-23620-invalid-escapes.rs:44:18
+ |
+LL | let _ = "/xf /u";
+ | ^^
+
+error: aborting due to 17 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.
+
+fn main() {
+ let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
+}
--- /dev/null
+error: expected one of `:`, `;`, `=`, or `@`, found `[`
+ --> $DIR/issue-24197.rs:12:12
+ |
+LL | let buf[0] = 0; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
+ | ^ expected one of `:`, `;`, `=`, or `@` here
+
+error: aborting due to previous error
+
--- /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.
+
+static tmp : [&'static str; 2] = ["hello", "he"];
+
+fn main() {
+ let z = "hello";
+ match z {
+ tmp[0] => {} //~ ERROR expected one of `=>`, `@`, `if`, or `|`, found `[`
+ _ => {}
+ }
+}
--- /dev/null
+error: expected one of `=>`, `@`, `if`, or `|`, found `[`
+ --> $DIR/issue-24375.rs:16:12
+ |
+LL | tmp[0] => {} //~ ERROR expected one of `=>`, `@`, `if`, or `|`, found `[`
+ | ^ expected one of `=>`, `@`, `if`, or `|` here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// Verify that '>' is not both expected and found at the same time, as it used
+// to happen in #24780. For example, following should be an error:
+// expected one of ..., `>`, ... found `>`
+//
+// compile-flags: -Z parse-only
+
+fn foo() -> Vec<usize>> {
+ //~^ ERROR expected one of `!`, `+`, `::`, `where`, or `{`, found `>`
+ Vec::new()
+}
--- /dev/null
+error: expected one of `!`, `+`, `::`, `where`, or `{`, found `>`
+ --> $DIR/issue-24780.rs:17:23
+ |
+LL | fn foo() -> Vec<usize>> {
+ | ^ expected one of `!`, `+`, `::`, `where`, or `{` here
+
+error: aborting due to previous error
+
--- /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
+
+impl A .. {} //~ ERROR
+
+fn main() {}
--- /dev/null
+error: missing `for` in a trait impl
+ --> $DIR/issue-27255.rs:13:7
+ |
+LL | impl A .. {} //~ ERROR
+ | ^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+fn foo() { }
+
+//! Misplaced comment...
+//~^ ERROR expected outer doc comment
+//~| NOTE inner doc comments like this (starting with `//!` or `/*!`) can only appear before items
+
+fn main() { }
--- /dev/null
+error: expected outer doc comment
+ --> $DIR/issue-30318.rs:15:1
+ |
+LL | //! Misplaced comment...
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: inner doc comments like this (starting with `//!` or `/*!`) can only appear before items
+
+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
+
+// Testing that semicolon tokens are printed correctly in errors
+
+fn main()
+{
+ let x = 3
+} //~ ERROR: expected one of `.`, `;`, `?`, or an operator, found `}`
--- /dev/null
+error: expected one of `.`, `;`, `?`, or an operator, found `}`
+ --> $DIR/issue-3036.rs:18:1
+ |
+LL | let x = 3
+ | - expected one of `.`, `;`, `?`, or an operator here
+LL | } //~ ERROR: expected one of `.`, `;`, `?`, or an operator, found `}`
+ | ^ unexpected token
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only -Z continue-parse-after-error
+
+pub fn test<W, I: Iterator<Item=(), W> >() {}
+//~^ ERROR type parameters must be declared prior to associated type bindings
+
+fn main() { }
--- /dev/null
+error: type parameters must be declared prior to associated type bindings
+ --> $DIR/issue-32214.rs:13:37
+ |
+LL | pub fn test<W, I: Iterator<Item=(), W> >() {}
+ | ^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+fn main() {}
+
+// This used to end up in an infite loop trying to bump past EOF.
+trait T { ... } //~ ERROR
--- /dev/null
+error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `...`
+ --> $DIR/issue-32446.rs:16:11
+ |
+LL | trait T { ... } //~ ERROR
+ | ^^^ expected one of 7 possible tokens here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+ let a = 0;
+ let _b = 0;
+ let _ = 0;
+ let mut b = 0;
+ let mut _b = 0;
+ let mut _ = 0; //~ ERROR expected identifier, found reserved identifier `_`
+}
--- /dev/null
+error: expected identifier, found reserved identifier `_`
+ --> $DIR/issue-32501.rs:19:13
+ |
+LL | let mut _ = 0; //~ ERROR expected identifier, found reserved identifier `_`
+ | ^ expected identifier, found reserved identifier
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+pub fn test() {
+ foo(|_|) //~ ERROR expected expression, found `)`
+}
+
+fn main() { }
--- /dev/null
+error: expected expression, found `)`
+ --> $DIR/issue-32505.rs:14:12
+ |
+LL | foo(|_|) //~ ERROR expected expression, found `)`
+ | ^ expected expression
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// Issue #33262
+
+pub fn main() {
+ for i in 0..a as { }
+ //~^ ERROR expected type, found `{`
+}
--- /dev/null
+error: expected type, found `{`
+ --> $DIR/issue-33262.rs:16:22
+ |
+LL | for i in 0..a as { }
+ | ^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+impl S {
+ fn f(*, a: u8) -> u8 {} //~ ERROR expected pattern, found `*`
+}
--- /dev/null
+error: expected pattern, found `*`
+ --> $DIR/issue-33413.rs:14:10
+ |
+LL | fn f(*, a: u8) -> u8 {} //~ ERROR expected pattern, found `*`
+ | ^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+use foo.bar; //~ ERROR expected one of `::`, `;`, or `as`, found `.`
--- /dev/null
+error: expected one of `::`, `;`, or `as`, found `.`
+ --> $DIR/issue-33455.rs:11:8
+ |
+LL | use foo.bar; //~ ERROR expected one of `::`, `;`, or `as`, found `.`
+ | ^ expected one of `::`, `;`, or `as` here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z no-analysis
+
+macro_rules! foo {
+ { $+ } => { //~ ERROR expected identifier, found `+`
+ //~^ ERROR missing fragment specifier
+ $(x)(y) //~ ERROR expected `*` or `+`
+ }
+}
+
+foo!();
--- /dev/null
+error: expected identifier, found `+`
+ --> $DIR/issue-33569.rs:14:8
+ |
+LL | { $+ } => { //~ ERROR expected identifier, found `+`
+ | ^
+
+error: expected `*` or `+`
+ --> $DIR/issue-33569.rs:16:13
+ |
+LL | $(x)(y) //~ ERROR expected `*` or `+`
+ | ^^^
+
+error: missing fragment specifier
+ --> $DIR/issue-33569.rs:14:8
+ |
+LL | { $+ } => { //~ ERROR expected identifier, found `+`
+ | ^
+
+error: aborting due to 3 previous errors
+
--- /dev/null
+// Copyright 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.
+
+macro_rules! test_macro {
+ ( $( $t:ty ),* $(),*) => {
+ enum SomeEnum {
+ $( $t, )* //~ ERROR expected identifier, found `String`
+ };
+ };
+}
+
+fn main() {
+ test_macro!(String,);
+}
--- /dev/null
+error: expected identifier, found `String`
+ --> $DIR/issue-37113.rs:14:16
+ |
+LL | $( $t, )* //~ ERROR expected identifier, found `String`
+ | ^^ expected identifier
+...
+LL | test_macro!(String,);
+ | --------------------- in this macro invocation
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+macro_rules! failed {
+ () => {{
+ let x = 5 ""; //~ ERROR found `""`
+ }}
+}
+
+fn main() {
+ failed!();
+}
--- /dev/null
+error: expected one of `.`, `;`, `?`, or an operator, found `""`
+ --> $DIR/issue-37234.rs:13:19
+ |
+LL | let x = 5 ""; //~ ERROR found `""`
+ | ^^ expected one of `.`, `;`, `?`, or an operator here
+...
+LL | failed!();
+ | ---------- in this macro invocation
+
+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
+
+fn main() {
+ '\u{_10FFFF}'; //~ ERROR invalid start of unicode escape
+}
--- /dev/null
+error: invalid start of unicode escape
+ --> $DIR/issue-43692.rs:14:9
+ |
+LL | '/u{_10FFFF}'; //~ ERROR invalid start of unicode escape
+ | ^
+
+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
+
+fn main() {
+ let __isize = 340282366920938463463374607431768211456; // 2^128
+ //~^ ERROR int literal is too large
+}
--- /dev/null
+error: int literal is too large
+ --> $DIR/issue-5544-a.rs:14:19
+ |
+LL | let __isize = 340282366920938463463374607431768211456; // 2^128
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+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
+
+fn main() {
+ let __isize = 0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ff;
+ //~^ ERROR int literal is too large
+}
--- /dev/null
+error: int literal is too large
+ --> $DIR/issue-5544-b.rs:14:19
+ |
+LL | let __isize = 0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ff;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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.
+
+// ignore-windows
+// ignore-freebsd
+// ignore-openbsd
+// ignore-netbsd
+// ignore-bitrig
+
+// compile-flags: -Z parse-only
+
+#[path = "../compile-fail"]
+mod foo; //~ ERROR: a directory
+
+fn main() {}
--- /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
+
+trait Foo { fn a() } //~ ERROR expected `;` or `{`, found `}`
+
+fn main() {}
--- /dev/null
+error: expected `;` or `{`, found `}`
+ --> $DIR/issue-6610.rs:13:20
+ |
+LL | trait Foo { fn a() } //~ ERROR expected `;` or `{`, found `}`
+ | ^ expected `;` or `{`
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+pub extern
+ "invalid-ab_isize" //~ ERROR invalid ABI
+fn foo() {}
+
+fn main() {}
--- /dev/null
+error[E0703]: invalid ABI: found `invalid-ab_isize`
+ --> $DIR/issue-8537.rs:14:3
+ |
+LL | "invalid-ab_isize" //~ ERROR invalid ABI
+ | ^^^^^^^^^^^^^^^^^^ invalid ABI
+ |
+ = help: valid ABIs: cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0703`.
--- /dev/null
+// Copyright 2014 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 abstract = (); //~ ERROR expected pattern, found reserved keyword `abstract`
+}
--- /dev/null
+error: expected pattern, found reserved keyword `abstract`
+ --> $DIR/keyword-abstract.rs:14:9
+ |
+LL | let abstract = (); //~ ERROR expected pattern, found reserved keyword `abstract`
+ | ^^^^^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py as'
+
+fn main() {
+ let as = "foo"; //~ error: expected pattern, found keyword `as`
+}
--- /dev/null
+error: expected pattern, found keyword `as`
+ --> $DIR/keyword-as-as-identifier.rs:16:9
+ |
+LL | let as = "foo"; //~ error: expected pattern, found keyword `as`
+ | ^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+ let box = "foo"; //~ error: expected pattern, found `=`
+}
--- /dev/null
+error: expected pattern, found `=`
+ --> $DIR/keyword-box-as-identifier.rs:14:13
+ |
+LL | let box = "foo"; //~ error: expected pattern, found `=`
+ | ^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py break'
+
+fn main() {
+ let break = "foo"; //~ error: expected pattern, found keyword `break`
+}
--- /dev/null
+error: expected pattern, found keyword `break`
+ --> $DIR/keyword-break-as-identifier.rs:16:9
+ |
+LL | let break = "foo"; //~ error: expected pattern, found keyword `break`
+ | ^^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py const'
+
+fn main() {
+ let const = "foo"; //~ error: expected pattern, found keyword `const`
+}
--- /dev/null
+error: expected pattern, found keyword `const`
+ --> $DIR/keyword-const-as-identifier.rs:16:9
+ |
+LL | let const = "foo"; //~ error: expected pattern, found keyword `const`
+ | ^^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py continue'
+
+fn main() {
+ let continue = "foo"; //~ error: expected pattern, found keyword `continue`
+}
--- /dev/null
+error: expected pattern, found keyword `continue`
+ --> $DIR/keyword-continue-as-identifier.rs:16:9
+ |
+LL | let continue = "foo"; //~ error: expected pattern, found keyword `continue`
+ | ^^^^^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py else'
+
+fn main() {
+ let else = "foo"; //~ error: expected pattern, found keyword `else`
+}
--- /dev/null
+error: expected pattern, found keyword `else`
+ --> $DIR/keyword-else-as-identifier.rs:16:9
+ |
+LL | let else = "foo"; //~ error: expected pattern, found keyword `else`
+ | ^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py enum'
+
+fn main() {
+ let enum = "foo"; //~ error: expected pattern, found keyword `enum`
+}
--- /dev/null
+error: expected pattern, found keyword `enum`
+ --> $DIR/keyword-enum-as-identifier.rs:16:9
+ |
+LL | let enum = "foo"; //~ error: expected pattern, found keyword `enum`
+ | ^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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 final = (); //~ ERROR expected pattern, found reserved keyword `final`
+}
--- /dev/null
+error: expected pattern, found reserved keyword `final`
+ --> $DIR/keyword-final.rs:14:9
+ |
+LL | let final = (); //~ ERROR expected pattern, found reserved keyword `final`
+ | ^^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py fn'
+
+fn main() {
+ let fn = "foo"; //~ error: expected pattern, found keyword `fn`
+}
--- /dev/null
+error: expected pattern, found keyword `fn`
+ --> $DIR/keyword-fn-as-identifier.rs:16:9
+ |
+LL | let fn = "foo"; //~ error: expected pattern, found keyword `fn`
+ | ^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py for'
+
+fn main() {
+ let for = "foo"; //~ error: expected pattern, found keyword `for`
+}
--- /dev/null
+error: expected pattern, found keyword `for`
+ --> $DIR/keyword-for-as-identifier.rs:16:9
+ |
+LL | let for = "foo"; //~ error: expected pattern, found keyword `for`
+ | ^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py if'
+
+fn main() {
+ let if = "foo"; //~ error: expected pattern, found keyword `if`
+}
--- /dev/null
+error: expected pattern, found keyword `if`
+ --> $DIR/keyword-if-as-identifier.rs:16:9
+ |
+LL | let if = "foo"; //~ error: expected pattern, found keyword `if`
+ | ^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py impl'
+
+fn main() {
+ let impl = "foo"; //~ error: expected pattern, found keyword `impl`
+}
--- /dev/null
+error: expected pattern, found keyword `impl`
+ --> $DIR/keyword-impl-as-identifier.rs:16:9
+ |
+LL | let impl = "foo"; //~ error: expected pattern, found keyword `impl`
+ | ^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py in'
+
+fn main() {
+ let in = "foo"; //~ error: expected pattern, found keyword `in`
+}
--- /dev/null
+error: expected pattern, found keyword `in`
+ --> $DIR/keyword-in-as-identifier.rs:16:9
+ |
+LL | let in = "foo"; //~ error: expected pattern, found keyword `in`
+ | ^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py let'
+
+fn main() {
+ let let = "foo"; //~ error: expected pattern, found keyword `let`
+}
--- /dev/null
+error: expected pattern, found keyword `let`
+ --> $DIR/keyword-let-as-identifier.rs:16:9
+ |
+LL | let let = "foo"; //~ error: expected pattern, found keyword `let`
+ | ^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py loop'
+
+fn main() {
+ let loop = "foo"; //~ error: expected pattern, found keyword `loop`
+}
--- /dev/null
+error: expected pattern, found keyword `loop`
+ --> $DIR/keyword-loop-as-identifier.rs:16:9
+ |
+LL | let loop = "foo"; //~ error: expected pattern, found keyword `loop`
+ | ^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py match'
+
+fn main() {
+ let match = "foo"; //~ error: expected pattern, found keyword `match`
+}
--- /dev/null
+error: expected pattern, found keyword `match`
+ --> $DIR/keyword-match-as-identifier.rs:16:9
+ |
+LL | let match = "foo"; //~ error: expected pattern, found keyword `match`
+ | ^^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py mod'
+
+fn main() {
+ let mod = "foo"; //~ error: expected pattern, found keyword `mod`
+}
--- /dev/null
+error: expected pattern, found keyword `mod`
+ --> $DIR/keyword-mod-as-identifier.rs:16:9
+ |
+LL | let mod = "foo"; //~ error: expected pattern, found keyword `mod`
+ | ^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py move'
+
+fn main() {
+ let move = "foo"; //~ error: expected pattern, found keyword `move`
+}
--- /dev/null
+error: expected pattern, found keyword `move`
+ --> $DIR/keyword-move-as-identifier.rs:16:9
+ |
+LL | let move = "foo"; //~ error: expected pattern, found keyword `move`
+ | ^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+ let mut = "foo"; //~ error: expected identifier, found `=`
+}
--- /dev/null
+error: expected identifier, found `=`
+ --> $DIR/keyword-mut-as-identifier.rs:14:13
+ |
+LL | let mut = "foo"; //~ error: expected identifier, found `=`
+ | ^ expected identifier
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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 override = (); //~ ERROR expected pattern, found reserved keyword `override`
+}
--- /dev/null
+error: expected pattern, found reserved keyword `override`
+ --> $DIR/keyword-override.rs:14:9
+ |
+LL | let override = (); //~ ERROR expected pattern, found reserved keyword `override`
+ | ^^^^^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py pub'
+
+fn main() {
+ let pub = "foo"; //~ error: expected pattern, found keyword `pub`
+}
--- /dev/null
+error: expected pattern, found keyword `pub`
+ --> $DIR/keyword-pub-as-identifier.rs:16:9
+ |
+LL | let pub = "foo"; //~ error: expected pattern, found keyword `pub`
+ | ^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+ let ref = "foo"; //~ error: expected identifier, found `=`
+}
--- /dev/null
+error: expected identifier, found `=`
+ --> $DIR/keyword-ref-as-identifier.rs:14:13
+ |
+LL | let ref = "foo"; //~ error: expected identifier, found `=`
+ | ^ expected identifier
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py return'
+
+fn main() {
+ let return = "foo"; //~ error: expected pattern, found keyword `return`
+}
--- /dev/null
+error: expected pattern, found keyword `return`
+ --> $DIR/keyword-return-as-identifier.rs:16:9
+ |
+LL | let return = "foo"; //~ error: expected pattern, found keyword `return`
+ | ^^^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py static'
+
+fn main() {
+ let static = "foo"; //~ error: expected pattern, found keyword `static`
+}
--- /dev/null
+error: expected pattern, found keyword `static`
+ --> $DIR/keyword-static-as-identifier.rs:16:9
+ |
+LL | let static = "foo"; //~ error: expected pattern, found keyword `static`
+ | ^^^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py struct'
+
+fn main() {
+ let struct = "foo"; //~ error: expected pattern, found keyword `struct`
+}
--- /dev/null
+error: expected pattern, found keyword `struct`
+ --> $DIR/keyword-struct-as-identifier.rs:16:9
+ |
+LL | let struct = "foo"; //~ error: expected pattern, found keyword `struct`
+ | ^^^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py trait'
+
+fn main() {
+ let trait = "foo"; //~ error: expected pattern, found keyword `trait`
+}
--- /dev/null
+error: expected pattern, found keyword `trait`
+ --> $DIR/keyword-trait-as-identifier.rs:16:9
+ |
+LL | let trait = "foo"; //~ error: expected pattern, found keyword `trait`
+ | ^^^^^ expected pattern
+
+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 --edition 2018
+
+fn main() {
+ let try = "foo"; //~ error: expected pattern, found reserved keyword `try`
+}
--- /dev/null
+error: expected pattern, found reserved keyword `try`
+ --> $DIR/keyword-try-as-identifier-edition2018.rs:14:9
+ |
+LL | let try = "foo"; //~ error: expected pattern, found reserved keyword `try`
+ | ^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py type'
+
+fn main() {
+ let type = "foo"; //~ error: expected pattern, found keyword `type`
+}
--- /dev/null
+error: expected pattern, found keyword `type`
+ --> $DIR/keyword-type-as-identifier.rs:16:9
+ |
+LL | let type = "foo"; //~ error: expected pattern, found keyword `type`
+ | ^^^^ expected pattern
+
+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
+
+fn main() {
+ let typeof = (); //~ ERROR expected pattern, found reserved keyword `typeof`
+}
--- /dev/null
+error: expected pattern, found reserved keyword `typeof`
+ --> $DIR/keyword-typeof.rs:14:9
+ |
+LL | let typeof = (); //~ ERROR expected pattern, found reserved keyword `typeof`
+ | ^^^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py unsafe'
+
+fn main() {
+ let unsafe = "foo"; //~ error: expected pattern, found keyword `unsafe`
+}
--- /dev/null
+error: expected pattern, found keyword `unsafe`
+ --> $DIR/keyword-unsafe-as-identifier.rs:16:9
+ |
+LL | let unsafe = "foo"; //~ error: expected pattern, found keyword `unsafe`
+ | ^^^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py use'
+
+fn main() {
+ let use = "foo"; //~ error: expected pattern, found keyword `use`
+}
--- /dev/null
+error: expected pattern, found keyword `use`
+ --> $DIR/keyword-use-as-identifier.rs:16:9
+ |
+LL | let use = "foo"; //~ error: expected pattern, found keyword `use`
+ | ^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py where'
+
+fn main() {
+ let where = "foo"; //~ error: expected pattern, found keyword `where`
+}
--- /dev/null
+error: expected pattern, found keyword `where`
+ --> $DIR/keyword-where-as-identifier.rs:16:9
+ |
+LL | let where = "foo"; //~ error: expected pattern, found keyword `where`
+ | ^^^^^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This file was auto-generated using 'src/etc/generate-keyword-tests.py while'
+
+fn main() {
+ let while = "foo"; //~ error: expected pattern, found keyword `while`
+}
--- /dev/null
+error: expected pattern, found keyword `while`
+ --> $DIR/keyword-while-as-identifier.rs:16:9
+ |
+LL | let while = "foo"; //~ error: expected pattern, found keyword `while`
+ | ^^^^^ expected pattern
+
+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
+
+pub mod break {
+ //~^ ERROR expected identifier, found keyword `break`
+}
--- /dev/null
+error: expected identifier, found keyword `break`
+ --> $DIR/keyword.rs:13:9
+ |
+LL | pub mod break {
+ | ^^^^^ expected identifier, found keyword
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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() {
+ struct::foo();
+ //~^ ERROR expected identifier
+}
+fn bar() {
+ mut::baz();
+ //~^ ERROR expected expression, found keyword `mut`
+}
--- /dev/null
+error: expected identifier, found `::`
+ --> $DIR/keywords-followed-by-double-colon.rs:14:11
+ |
+LL | struct::foo();
+ | ^^ expected identifier
+
+error: expected expression, found keyword `mut`
+ --> $DIR/keywords-followed-by-double-colon.rs:18:5
+ |
+LL | mut::baz();
+ | ^^^ expected expression
+
+error: aborting due to 2 previous errors
+
--- /dev/null
+// Copyright 2014 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
+
+fn main() {
+ 0b121; //~ ERROR invalid digit for a base 2 literal
+ 0b10_10301; //~ ERROR invalid digit for a base 2 literal
+ 0b30; //~ ERROR invalid digit for a base 2 literal
+ 0b41; //~ ERROR invalid digit for a base 2 literal
+ 0b5; //~ ERROR invalid digit for a base 2 literal
+ 0b6; //~ ERROR invalid digit for a base 2 literal
+ 0b7; //~ ERROR invalid digit for a base 2 literal
+ 0b8; //~ ERROR invalid digit for a base 2 literal
+ 0b9; //~ ERROR invalid digit for a base 2 literal
+}
--- /dev/null
+error: invalid digit for a base 2 literal
+ --> $DIR/lex-bad-binary-literal.rs:14:8
+ |
+LL | 0b121; //~ ERROR invalid digit for a base 2 literal
+ | ^
+
+error: invalid digit for a base 2 literal
+ --> $DIR/lex-bad-binary-literal.rs:15:12
+ |
+LL | 0b10_10301; //~ ERROR invalid digit for a base 2 literal
+ | ^
+
+error: invalid digit for a base 2 literal
+ --> $DIR/lex-bad-binary-literal.rs:16:7
+ |
+LL | 0b30; //~ ERROR invalid digit for a base 2 literal
+ | ^
+
+error: invalid digit for a base 2 literal
+ --> $DIR/lex-bad-binary-literal.rs:17:7
+ |
+LL | 0b41; //~ ERROR invalid digit for a base 2 literal
+ | ^
+
+error: invalid digit for a base 2 literal
+ --> $DIR/lex-bad-binary-literal.rs:18:7
+ |
+LL | 0b5; //~ ERROR invalid digit for a base 2 literal
+ | ^
+
+error: invalid digit for a base 2 literal
+ --> $DIR/lex-bad-binary-literal.rs:19:7
+ |
+LL | 0b6; //~ ERROR invalid digit for a base 2 literal
+ | ^
+
+error: invalid digit for a base 2 literal
+ --> $DIR/lex-bad-binary-literal.rs:20:7
+ |
+LL | 0b7; //~ ERROR invalid digit for a base 2 literal
+ | ^
+
+error: invalid digit for a base 2 literal
+ --> $DIR/lex-bad-binary-literal.rs:21:7
+ |
+LL | 0b8; //~ ERROR invalid digit for a base 2 literal
+ | ^
+
+error: invalid digit for a base 2 literal
+ --> $DIR/lex-bad-binary-literal.rs:22:7
+ |
+LL | 0b9; //~ ERROR invalid digit for a base 2 literal
+ | ^
+
+error: aborting due to 9 previous errors
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only -Z continue-parse-after-error
+static c3: char =
+ '\x1' //~ ERROR: numeric character escape is too short
+;
+
+static s: &'static str =
+ "\x1" //~ ERROR: numeric character escape is too short
+;
+
+static c: char =
+ '\●' //~ ERROR: unknown character escape
+;
+
+static s: &'static str =
+ "\●" //~ ERROR: unknown character escape
+;
+
--- /dev/null
+error: numeric character escape is too short
+ --> $DIR/lex-bad-char-literals-1.rs:13:8
+ |
+LL | '/x1' //~ ERROR: numeric character escape is too short
+ | ^
+
+error: numeric character escape is too short
+ --> $DIR/lex-bad-char-literals-1.rs:17:8
+ |
+LL | "/x1" //~ ERROR: numeric character escape is too short
+ | ^
+
+error: unknown character escape: /u{25cf}
+ --> $DIR/lex-bad-char-literals-1.rs:21:7
+ |
+LL | '/●' //~ ERROR: unknown character escape
+ | ^
+
+error: unknown character escape: /u{25cf}
+ --> $DIR/lex-bad-char-literals-1.rs:25:7
+ |
+LL | "/●" //~ ERROR: unknown character escape
+ | ^
+
+error: aborting due to 4 previous errors
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This test needs to the last one appearing in this file as it kills the parser
+static c: char =
+ 'nope' //~ ERROR: character literal may only contain one codepoint: 'nope'
+;
+
--- /dev/null
+error: character literal may only contain one codepoint: 'nope'
+ --> $DIR/lex-bad-char-literals-2.rs:15:5
+ |
+LL | 'nope' //~ ERROR: character literal may only contain one codepoint: 'nope'
+ | ^^^^^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+// This test needs to the last one appearing in this file as it kills the parser
+static c: char =
+ '●●' //~ ERROR: character literal may only contain one codepoint
+;
--- /dev/null
+error: character literal may only contain one codepoint
+ --> $DIR/lex-bad-char-literals-3.rs:15:5
+ |
+LL | '●●' //~ ERROR: character literal may only contain one codepoint
+ | ^^^^
+help: if you meant to write a `str` literal, use double quotes
+ |
+LL | "●●" //~ ERROR: character literal may only contain one codepoint
+ | ^^^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+//
+// This test needs to the last one appearing in this file as it kills the parser
+static c: char =
+ '● //~ ERROR: character literal may only contain one codepoint: '●
+;
--- /dev/null
+error: character literal may only contain one codepoint: '●
+ --> $DIR/lex-bad-char-literals-4.rs:15:5
+ |
+LL | '● //~ ERROR: character literal may only contain one codepoint: '●
+ | ^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+//
+// This test needs to the last one appearing in this file as it kills the parser
+static c: char =
+ '\x10\x10' //~ ERROR: character literal may only contain one codepoint
+;
--- /dev/null
+error: character literal may only contain one codepoint
+ --> $DIR/lex-bad-char-literals-5.rs:15:5
+ |
+LL | '/x10/x10' //~ ERROR: character literal may only contain one codepoint
+ | ^^^^^^^^^^
+help: if you meant to write a `str` literal, use double quotes
+ |
+LL | "/x10/x10" //~ ERROR: character literal may only contain one codepoint
+ | ^^^^^^^^^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+fn main() {
+ 0o1.0; //~ ERROR: octal float literal is not supported
+ 0o2f32; //~ ERROR: octal float literal is not supported
+ 0o3.0f32; //~ ERROR: octal float literal is not supported
+ 0o4e4; //~ ERROR: octal float literal is not supported
+ 0o5.0e5; //~ ERROR: octal float literal is not supported
+ 0o6e6f32; //~ ERROR: octal float literal is not supported
+ 0o7.0e7f64; //~ ERROR: octal float literal is not supported
+ 0x8.0e+9; //~ ERROR: hexadecimal float literal is not supported
+ 0x9.0e-9; //~ ERROR: hexadecimal float literal is not supported
+ 0o; //~ ERROR: no valid digits
+ 1e+; //~ ERROR: expected at least one digit in exponent
+ 0x539.0; //~ ERROR: hexadecimal float literal is not supported
+ 9900000000000000000000000000999999999999999999999999999999; //~ ERROR: int literal is too large
+ 9900000000000000000000000000999999999999999999999999999999; //~ ERROR: int literal is too large
+ 0x; //~ ERROR: no valid digits
+ 0xu32; //~ ERROR: no valid digits
+ 0ou32; //~ ERROR: no valid digits
+ 0bu32; //~ ERROR: no valid digits
+ 0b; //~ ERROR: no valid digits
+ 0o123f64; //~ ERROR: octal float literal is not supported
+ 0o123.456; //~ ERROR: octal float literal is not supported
+ 0b101f64; //~ ERROR: binary float literal is not supported
+ 0b111.101; //~ ERROR: binary float literal is not supported
+}
--- /dev/null
+error: octal float literal is not supported
+ --> $DIR/lex-bad-numeric-literals.rs:14:5
+ |
+LL | 0o1.0; //~ ERROR: octal float literal is not supported
+ | ^^^^^
+
+error: octal float literal is not supported
+ --> $DIR/lex-bad-numeric-literals.rs:16:5
+ |
+LL | 0o3.0f32; //~ ERROR: octal float literal is not supported
+ | ^^^^^
+
+error: octal float literal is not supported
+ --> $DIR/lex-bad-numeric-literals.rs:17:5
+ |
+LL | 0o4e4; //~ ERROR: octal float literal is not supported
+ | ^^^^^
+
+error: octal float literal is not supported
+ --> $DIR/lex-bad-numeric-literals.rs:18:5
+ |
+LL | 0o5.0e5; //~ ERROR: octal float literal is not supported
+ | ^^^^^^^
+
+error: octal float literal is not supported
+ --> $DIR/lex-bad-numeric-literals.rs:19:5
+ |
+LL | 0o6e6f32; //~ ERROR: octal float literal is not supported
+ | ^^^^^
+
+error: octal float literal is not supported
+ --> $DIR/lex-bad-numeric-literals.rs:20:5
+ |
+LL | 0o7.0e7f64; //~ ERROR: octal float literal is not supported
+ | ^^^^^^^
+
+error: hexadecimal float literal is not supported
+ --> $DIR/lex-bad-numeric-literals.rs:21:5
+ |
+LL | 0x8.0e+9; //~ ERROR: hexadecimal float literal is not supported
+ | ^^^^^^^^
+
+error: hexadecimal float literal is not supported
+ --> $DIR/lex-bad-numeric-literals.rs:22:5
+ |
+LL | 0x9.0e-9; //~ ERROR: hexadecimal float literal is not supported
+ | ^^^^^^^^
+
+error: no valid digits found for number
+ --> $DIR/lex-bad-numeric-literals.rs:23:5
+ |
+LL | 0o; //~ ERROR: no valid digits
+ | ^^
+
+error: expected at least one digit in exponent
+ --> $DIR/lex-bad-numeric-literals.rs:24:8
+ |
+LL | 1e+; //~ ERROR: expected at least one digit in exponent
+ | ^
+
+error: hexadecimal float literal is not supported
+ --> $DIR/lex-bad-numeric-literals.rs:25:5
+ |
+LL | 0x539.0; //~ ERROR: hexadecimal float literal is not supported
+ | ^^^^^^^
+
+error: no valid digits found for number
+ --> $DIR/lex-bad-numeric-literals.rs:28:5
+ |
+LL | 0x; //~ ERROR: no valid digits
+ | ^^
+
+error: no valid digits found for number
+ --> $DIR/lex-bad-numeric-literals.rs:29:5
+ |
+LL | 0xu32; //~ ERROR: no valid digits
+ | ^^
+
+error: no valid digits found for number
+ --> $DIR/lex-bad-numeric-literals.rs:30:5
+ |
+LL | 0ou32; //~ ERROR: no valid digits
+ | ^^
+
+error: no valid digits found for number
+ --> $DIR/lex-bad-numeric-literals.rs:31:5
+ |
+LL | 0bu32; //~ ERROR: no valid digits
+ | ^^
+
+error: no valid digits found for number
+ --> $DIR/lex-bad-numeric-literals.rs:32:5
+ |
+LL | 0b; //~ ERROR: no valid digits
+ | ^^
+
+error: octal float literal is not supported
+ --> $DIR/lex-bad-numeric-literals.rs:34:5
+ |
+LL | 0o123.456; //~ ERROR: octal float literal is not supported
+ | ^^^^^^^^^
+
+error: binary float literal is not supported
+ --> $DIR/lex-bad-numeric-literals.rs:36:5
+ |
+LL | 0b111.101; //~ ERROR: binary float literal is not supported
+ | ^^^^^^^^^
+
+error: octal float literal is not supported
+ --> $DIR/lex-bad-numeric-literals.rs:15:5
+ |
+LL | 0o2f32; //~ ERROR: octal float literal is not supported
+ | ^^^^^^
+
+error: int literal is too large
+ --> $DIR/lex-bad-numeric-literals.rs:26:5
+ |
+LL | 9900000000000000000000000000999999999999999999999999999999; //~ ERROR: int literal is too large
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: int literal is too large
+ --> $DIR/lex-bad-numeric-literals.rs:27:5
+ |
+LL | 9900000000000000000000000000999999999999999999999999999999; //~ ERROR: int literal is too large
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: octal float literal is not supported
+ --> $DIR/lex-bad-numeric-literals.rs:33:5
+ |
+LL | 0o123f64; //~ ERROR: octal float literal is not supported
+ | ^^^^^^^^
+
+error: binary float literal is not supported
+ --> $DIR/lex-bad-numeric-literals.rs:35:5
+ |
+LL | 0b101f64; //~ ERROR: binary float literal is not supported
+ | ^^^^^^^^
+
+error: aborting due to 23 previous errors
+
--- /dev/null
+// Copyright 2014 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
+
+fn main() {
+ 0o18; //~ ERROR invalid digit for a base 8 literal
+ 0o1234_9_5670; //~ ERROR invalid digit for a base 8 literal
+}
--- /dev/null
+error: invalid digit for a base 8 literal
+ --> $DIR/lex-bad-octal-literal.rs:14:8
+ |
+LL | 0o18; //~ ERROR invalid digit for a base 8 literal
+ | ^
+
+error: invalid digit for a base 8 literal
+ --> $DIR/lex-bad-octal-literal.rs:15:12
+ |
+LL | 0o1234_9_5670; //~ ERROR invalid digit for a base 8 literal
+ | ^
+
+error: aborting due to 2 previous errors
+
--- /dev/null
+// Copyright 2014 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
+
+● //~ ERROR: unknown start of token
--- /dev/null
+error: unknown start of token: /u{25cf}
+ --> $DIR/lex-bad-token.rs:13:1
+ |
+LL | ● //~ ERROR: unknown start of token
+ | ^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+// ignore-tidy-cr
+
+/// doc comment with bare CR: '\r'
+pub fn foo() {}
+//~^^ ERROR: bare CR not allowed in doc-comment
+
+/** block doc comment with bare CR: '\r' */
+pub fn bar() {}
+//~^^ ERROR: bare CR not allowed in block doc-comment
+
+fn main() {
+ //! doc comment with bare CR: '\r'
+ //~^ ERROR: bare CR not allowed in doc-comment
+
+ /*! block doc comment with bare CR: '\r' */
+ //~^ ERROR: bare CR not allowed in block doc-comment
+
+ // the following string literal has a bare CR in it
+ let _s = "foo\rbar"; //~ ERROR: bare CR not allowed in string
+
+ // the following string literal has a bare CR in it
+ let _s = r"bar\rfoo"; //~ ERROR: bare CR not allowed in raw string
+
+ // the following string literal has a bare CR in it
+ let _s = "foo\\rbar"; //~ ERROR: unknown character escape: \r
+}
--- /dev/null
+error: bare CR not allowed in doc-comment
+ --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:15:32
+ |
+LL | /// doc comment with bare CR: '\r'
+ | ^
+
+error: bare CR not allowed in block doc-comment
+ --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:19:38
+ |
+LL | /** block doc comment with bare CR: '\r' */
+ | ^
+
+error: bare CR not allowed in doc-comment
+ --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:24:36
+ |
+LL | //! doc comment with bare CR: '\r'
+ | ^
+
+error: bare CR not allowed in block doc-comment
+ --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:27:42
+ |
+LL | /*! block doc comment with bare CR: '\r' */
+ | ^
+
+error: bare CR not allowed in string, use /r instead
+ --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:31:18
+ |
+LL | let _s = "foo\rbar"; //~ ERROR: bare CR not allowed in string
+ | ^
+
+error: bare CR not allowed in raw string, use /r instead
+ --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:34:14
+ |
+LL | let _s = r"bar\rfoo"; //~ ERROR: bare CR not allowed in raw string
+ | ^^^^^
+
+error: unknown character escape: /r
+ --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:37:19
+ |
+LL | let _s = "foo/\rbar"; //~ ERROR: unknown character escape: /r
+ | ^
+ |
+help: this is an isolated carriage return; consider checking your editor and version control settings
+ --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:37:19
+ |
+LL | let _s = "foo/\rbar"; //~ ERROR: unknown character escape: /r
+ | ^
+
+error: aborting due to 7 previous errors
+
--- /dev/null
+// Copyright 2014 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
+
+\ //~ ERROR: unknown start of token: \
--- /dev/null
+error: unknown start of token: /
+ --> $DIR/lex-stray-backslash.rs:13:1
+ |
+LL | / //~ ERROR: unknown start of token: /
+ | ^
+
+error: aborting due to previous error
+
--- /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.
+
+fn test(&'a str) {
+ //~^ ERROR unexpected lifetime `'a` in pattern
+}
+
+fn main() {
+}
--- /dev/null
+error: unexpected lifetime `'a` in pattern
+ --> $DIR/lifetime-in-pattern.rs:11:10
+ |
+LL | fn test(&'a str) {
+ | ^^ unexpected lifetime
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+struct Foo<'a, 'b> {
+ a: &'a &'b i32
+}
+
+fn foo<'a, 'b>(x: &mut Foo<'a; 'b>) {}
+//~^ ERROR expected one of `,` or `>`, found `;`
--- /dev/null
+error: expected one of `,` or `>`, found `;`
+ --> $DIR/lifetime-semicolon.rs:17:30
+ |
+LL | fn foo<'a, 'b>(x: &mut Foo<'a; 'b>) {}
+ | ^ expected one of `,` or `>` here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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() {
+ foo! bar < //~ ERROR expected `(` or `{`, found `<`
+}
--- /dev/null
+error: expected `(` or `{`, found `<`
+ --> $DIR/macro-bad-delimiter-ident.rs:14:14
+ |
+LL | foo! bar < //~ ERROR expected `(` or `{`, found `<`
+ | ^ expected `(` or `{`
+
+error: aborting due to previous error
+
--- /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.
+
+macro_rules! outer {
+ (#[$outer:meta]) => ()
+}
+
+outer! {
+ //! Inner
+} //~^ ERROR no rules expected the token `!`
+
+fn main() { }
--- /dev/null
+error: no rules expected the token `!`
+ --> $DIR/macro-doc-comments-1.rs:16:5
+ |
+LL | //! Inner
+ | ^^^^^^^^^
+
+error: aborting due to previous error
+
--- /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.
+
+macro_rules! inner {
+ (#![$inner:meta]) => ()
+}
+
+inner! {
+ /// Outer
+} //~^ ERROR no rules expected the token `[`
+
+fn main() { }
--- /dev/null
+error: no rules expected the token `[`
+ --> $DIR/macro-doc-comments-2.rs:16:5
+ |
+LL | /// Outer
+ | ^
+
+error: aborting due to previous error
+
--- /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 macro() { //~ ERROR expected identifier, found reserved keyword `macro`
+}
+
+pub fn main() {
+}
--- /dev/null
+error: expected identifier, found reserved keyword `macro`
+ --> $DIR/macro-keyword.rs:13:4
+ |
+LL | fn macro() { //~ ERROR expected identifier, found reserved keyword `macro`
+ | ^^^^^ expected identifier, found reserved keyword
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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() {
+ foo! {
+ bar, "baz", 1, 2.0
+ ) //~ ERROR incorrect close delimiter
+}
--- /dev/null
+error: incorrect close delimiter: `)`
+ --> $DIR/macro-mismatched-delim-brace-paren.rs:16:5
+ |
+LL | foo! {
+ | - un-closed delimiter
+LL | bar, "baz", 1, 2.0
+LL | ) //~ ERROR incorrect close delimiter
+ | ^ incorrect close delimiter
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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() {
+ foo! (
+ bar, "baz", 1, 2.0
+ } //~ ERROR incorrect close delimiter
+} //~ ERROR unexpected close delimiter: `}`
--- /dev/null
+error: incorrect close delimiter: `}`
+ --> $DIR/macro-mismatched-delim-paren-brace.rs:16:5
+ |
+LL | foo! (
+ | - un-closed delimiter
+LL | bar, "baz", 1, 2.0
+LL | } //~ ERROR incorrect close delimiter
+ | ^ incorrect close delimiter
+
+error: unexpected close delimiter: `}`
+ --> $DIR/macro-mismatched-delim-paren-brace.rs:17:1
+ |
+LL | } //~ ERROR unexpected close delimiter: `}`
+ | ^ unexpected close delimiter
+
+error: aborting due to 2 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.
+
+macro_rules! mac {
+ ( $($v:tt)* ) => (
+ $v //~ ERROR still repeating at this depth
+ )
+}
+
+fn main() {
+ mac!(0);
+}
--- /dev/null
+error: variable 'v' is still repeating at this depth
+ --> $DIR/macro-repeat.rs:13:9
+ |
+LL | $v //~ ERROR still repeating at this depth
+ | ^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+macro_rules! foo() //~ ERROR semicolon
+
+fn main() {
+}
--- /dev/null
+error: macros that expand to items must either be surrounded with braces or followed by a semicolon
+ --> $DIR/macros-no-semicolon-items.rs:13:17
+ |
+LL | macro_rules! foo() //~ ERROR semicolon
+ | ^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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() {
+ assert_eq!(1, 2)
+ assert_eq!(3, 4) //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `assert_eq`
+ println!("hello");
+}
--- /dev/null
+error: expected one of `.`, `;`, `?`, `}`, or an operator, found `assert_eq`
+ --> $DIR/macros-no-semicolon.rs:15:5
+ |
+LL | assert_eq!(1, 2)
+ | - expected one of `.`, `;`, `?`, `}`, or an operator here
+LL | assert_eq!(3, 4) //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `assert_eq`
+ | ^^^^^^^^^ unexpected token
+
+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 main() {
+
+ match 0 {
+ 0 => {
+ } + 5 //~ ERROR expected pattern, found `+`
+ }
+}
--- /dev/null
+error: expected pattern, found `+`
+ --> $DIR/match-arrows-block-then-binop.rs:17:9
+ |
+LL | } + 5 //~ ERROR expected pattern, found `+`
+ | ^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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 a = Vec::new();
+ match a {
+ [1, tail.., tail..] => {}, //~ ERROR: expected one of `,` or `@`, found `..`
+ _ => ()
+ }
+}
--- /dev/null
+error: expected one of `,` or `@`, found `..`
+ --> $DIR/match-vec-invalid.rs:16:25
+ |
+LL | [1, tail.., tail..] => {}, //~ ERROR: expected one of `,` or `@`, found `..`
+ | ^^ expected one of `,` or `@` here
+
+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.
+
+// ignore-windows
+
+// compile-flags: -Z parse-only
+
+mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
+//~^ HELP name the file either not_a_real_file.rs or not_a_real_file/mod.rs inside the directory
+
+fn main() {
+ assert_eq!(mod_file_aux::bar(), 10);
+}
--- /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.
+
+// ignore-android
+// ignore-bitrig
+// ignore-cloudabi
+// ignore-dragonfly
+// ignore-emscripten
+// ignore-freebsd
+// ignore-gnu
+// ignore-haiku
+// ignore-ios
+// ignore-linux
+// ignore-macos
+// ignore-netbsd
+// ignore-openbsd
+// ignore-solaris
+
+// compile-flags: -Z parse-only
+
+mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
+//~^ HELP name the file either not_a_real_file.rs or not_a_real_file\mod.rs inside the directory
+
+fn main() {
+ assert_eq!(mod_file_aux::bar(), 10);
+}
--- /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
+
+#[path = "not_a_real_file.rs"]
+mod m; //~ ERROR not_a_real_file.rs
+
+fn main() {
+ assert_eq!(m::foo(), 10);
+}
--- /dev/null
+error: couldn't read "C:/msys64/home/we/rust/src/test/ui/parser/not_a_real_file.rs": The system cannot find the file specified. (os error 2)
+ --> $DIR/mod_file_with_path_attr.rs:14:5
+ |
+LL | mod m; //~ ERROR not_a_real_file.rs
+ | ^
+
+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.
+
+// error-pattern:18:3
+
+/* 1
+ * 2
+ * 3
+ */
+fn main() {
+ %; // parse error on line 18, but is reported on line 6 instead.
+}
--- /dev/null
+error: expected expression, found `%`
+ --> $DIR/multiline-comment-line-tracking.rs:18:3
+ |
+LL | %; // parse error on line 18, but is reported on line 6 instead.
+ | ^ expected expression
+
+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
+
+struct S {
+ y: isize
+}
+
+impl Cmp, ToString for S {
+//~^ ERROR: expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `,`
+ fn eq(&&other: S) { false }
+ fn to_string(&self) -> String { "hi".to_string() }
+}
--- /dev/null
+error: expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `,`
+ --> $DIR/multitrait.rs:17:9
+ |
+LL | impl Cmp, ToString for S {
+ | ^ expected one of 8 possible tokens here
+
+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
+
+// Can't put mut in non-ident pattern
+
+pub fn main() {
+ struct Foo { x: isize }
+ let mut Foo { x: x } = Foo { x: 3 }; //~ ERROR: expected one of `:`, `;`, `=`, or `@`, found `{`
+}
--- /dev/null
+error: expected one of `:`, `;`, `=`, or `@`, found `{`
+ --> $DIR/mut-patterns.rs:17:17
+ |
+LL | let mut Foo { x: x } = Foo { x: 3 }; //~ ERROR: expected one of `:`, `;`, `=`, or `@`, found `{`
+ | ^ expected one of `:`, `;`, `=`, or `@` here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+pub fn main() {
+ let s = "\u{2603"; //~ ERROR unterminated unicode escape (needed a `}`)
+}
--- /dev/null
+error: unterminated unicode escape (needed a `}`)
+ --> $DIR/new-unicode-escapes-1.rs:14:21
+ |
+LL | let s = "/u{2603"; //~ ERROR unterminated unicode escape (needed a `}`)
+ | ^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+pub fn main() {
+ let s = "\u{260311111111}"; //~ ERROR overlong unicode escape (must have at most 6 hex digits)
+}
--- /dev/null
+error: overlong unicode escape (must have at most 6 hex digits)
+ --> $DIR/new-unicode-escapes-2.rs:14:17
+ |
+LL | let s = "/u{260311111111}"; //~ ERROR overlong unicode escape (must have at most 6 hex digits)
+ | ^^^^^^^^^^^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+pub fn main() {
+ let s1 = "\u{d805}"; //~ ERROR invalid unicode character escape
+ let s2 = "\u{ffffff}"; //~ ERROR invalid unicode character escape
+}
--- /dev/null
+error: invalid unicode character escape
+ --> $DIR/new-unicode-escapes-3.rs:14:14
+ |
+LL | let s1 = "/u{d805}"; //~ ERROR invalid unicode character escape
+ | ^^^^^^^^^^
+ |
+ = help: unicode escape must not be a surrogate
+
+error: invalid unicode character escape
+ --> $DIR/new-unicode-escapes-3.rs:15:14
+ |
+LL | let s2 = "/u{ffffff}"; //~ ERROR invalid unicode character escape
+ | ^^^^^^^^^^^^
+ |
+ = help: unicode escape must be at most 10FFFF
+
+error: aborting due to 2 previous errors
+
--- /dev/null
+// Copyright 2014 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
+
+pub fn main() {
+ let s = "\u{lol}";
+ //~^ ERROR invalid character in unicode escape: l
+}
--- /dev/null
+error: invalid character in unicode escape: l
+ --> $DIR/new-unicode-escapes-4.rs:14:17
+ |
+LL | let s = "/u{lol}";
+ | ^
+
+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
+
+// error-pattern:binary float literal is not supported
+
+fn main() {
+ 0b101010f64;
+ 0b101.010;
+ 0b101p4f64;
+}
--- /dev/null
+error: binary float literal is not supported
+ --> $DIR/no-binary-float-literal.rs:17:5
+ |
+LL | 0b101.010;
+ | ^^^^^^^^^
+
+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
+
+// error-pattern:hexadecimal float literal is not supported
+
+fn main() {
+ 0xABC.Df;
+ 0x567.89;
+ 0xDEAD.BEEFp-2f;
+}
--- /dev/null
+error: hexadecimal float literal is not supported
+ --> $DIR/no-hex-float-literal.rs:17:5
+ |
+LL | 0x567.89;
+ | ^^^^^^^^
+
+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 -Z continue-parse-after-error
+
+trait A {
+ fn foo(*mut self); //~ ERROR cannot pass `self` by raw pointer
+ fn baz(*const self); //~ ERROR cannot pass `self` by raw pointer
+ fn bar(*self); //~ ERROR cannot pass `self` by raw pointer
+}
+
+struct X;
+impl A for X {
+ fn foo(*mut self) { } //~ ERROR cannot pass `self` by raw pointer
+ fn baz(*const self) { } //~ ERROR cannot pass `self` by raw pointer
+ fn bar(*self) { } //~ ERROR cannot pass `self` by raw pointer
+}
+
+fn main() { }
--- /dev/null
+error: cannot pass `self` by raw pointer
+ --> $DIR/no-unsafe-self.rs:14:17
+ |
+LL | fn foo(*mut self); //~ ERROR cannot pass `self` by raw pointer
+ | ^^^^
+
+error: cannot pass `self` by raw pointer
+ --> $DIR/no-unsafe-self.rs:15:19
+ |
+LL | fn baz(*const self); //~ ERROR cannot pass `self` by raw pointer
+ | ^^^^
+
+error: cannot pass `self` by raw pointer
+ --> $DIR/no-unsafe-self.rs:16:13
+ |
+LL | fn bar(*self); //~ ERROR cannot pass `self` by raw pointer
+ | ^^^^
+
+error: cannot pass `self` by raw pointer
+ --> $DIR/no-unsafe-self.rs:21:17
+ |
+LL | fn foo(*mut self) { } //~ ERROR cannot pass `self` by raw pointer
+ | ^^^^
+
+error: cannot pass `self` by raw pointer
+ --> $DIR/no-unsafe-self.rs:22:19
+ |
+LL | fn baz(*const self) { } //~ ERROR cannot pass `self` by raw pointer
+ | ^^^^
+
+error: cannot pass `self` by raw pointer
+ --> $DIR/no-unsafe-self.rs:23:13
+ |
+LL | fn bar(*self) { } //~ ERROR cannot pass `self` by raw pointer
+ | ^^^^
+
+error: aborting due to 6 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
+
+// error-pattern: lt
+
+fn f(a: isize, b: isize) : lt(a, b) { }
+
+fn lt(a: isize, b: isize) { }
+
+fn main() { let a: isize = 10; let b: isize = 23; check (lt(a, b)); f(a, b); }
--- /dev/null
+error: expected one of `->`, `where`, or `{`, found `:`
+ --> $DIR/not-a-pred.rs:15:26
+ |
+LL | fn f(a: isize, b: isize) : lt(a, b) { }
+ | ^ expected one of `->`, `where`, or `{` here
+
+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(x) { //~ ERROR expected one of `:` or `@`, found `)`
+}
--- /dev/null
+error: expected one of `:` or `@`, found `)`
+ --> $DIR/omitted-arg-in-item-fn.rs:13:9
+ |
+LL | fn foo(x) { //~ ERROR expected one of `:` or `@`, found `)`
+ | ^ expected one of `:` or `@` here
+
+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
+
+// http://phpsadness.com/sad/1
+
+fn main() {
+ ::; //~ ERROR expected identifier, found `;`
+}
--- /dev/null
+error: expected identifier, found `;`
+ --> $DIR/paamayim-nekudotayim.rs:16:7
+ |
+LL | ::; //~ ERROR expected identifier, found `;`
+ | ^ expected identifier
+
+error: aborting due to previous error
+
--- /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 foo() {
+ match x {
+ <T as Trait>::Type(2) => (),
+ //~^ ERROR unexpected `(` after qualified path
+ _ => (),
+ }
+}
--- /dev/null
+error: unexpected `(` after qualified path
+ --> $DIR/paren-after-qualified-path-in-match.rs:15:27
+ |
+LL | <T as Trait>::Type(2) => (),
+ | ^ unexpected `(` after qualified path
+
+error: aborting due to previous error
+
--- /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.
+
+fn main() {
+ match 42 {
+ x < 7 => (),
+ //~^ error: expected one of `=>`, `@`, `if`, or `|`, found `<`
+ _ => ()
+ }
+}
--- /dev/null
+error: expected one of `=>`, `@`, `if`, or `|`, found `<`
+ --> $DIR/pat-lt-bracket-1.rs:13:7
+ |
+LL | x < 7 => (),
+ | ^ expected one of `=>`, `@`, `if`, or `|` here
+
+error: aborting due to previous error
+
--- /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.
+
+fn a(B<) {}
+ //~^ error: expected one of `:` or `@`, found `<`
--- /dev/null
+error: expected one of `:` or `@`, found `<`
+ --> $DIR/pat-lt-bracket-2.rs:11:7
+ |
+LL | fn a(B<) {}
+ | ^ expected one of `:` or `@` here
+
+error[E0601]: `main` function not found in crate `pat_lt_bracket_2`
+ |
+ = note: consider adding a `main` function to `$DIR/pat-lt-bracket-2.rs`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0601`.
--- /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.
+
+struct Foo<T>(T, T);
+
+impl<T> Foo<T> {
+ fn foo(&self) {
+ match *self {
+ Foo<T>(x, y) => {
+ //~^ error: expected one of `=>`, `@`, `if`, or `|`, found `<`
+ println!("Goodbye, World!")
+ }
+ }
+ }
+}
--- /dev/null
+error: expected one of `=>`, `@`, `if`, or `|`, found `<`
+ --> $DIR/pat-lt-bracket-3.rs:16:16
+ |
+LL | Foo<T>(x, y) => {
+ | ^ expected one of `=>`, `@`, `if`, or `|` here
+
+error[E0601]: `main` function not found in crate `pat_lt_bracket_3`
+ |
+ = note: consider adding a `main` function to `$DIR/pat-lt-bracket-3.rs`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0601`.
--- /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
+
+enum BtNode {
+ Node(u32,Box<BtNode>,Box<BtNode>),
+ Leaf(u32),
+}
+
+fn main() {
+ let y = match x {
+ Foo<T>::A(value) => value, //~ error: expected one of `=>`, `@`, `if`, or `|`, found `<`
+ Foo<T>::B => 7,
+ };
+}
--- /dev/null
+error: expected one of `=>`, `@`, `if`, or `|`, found `<`
+ --> $DIR/pat-lt-bracket-4.rs:20:12
+ |
+LL | Foo<T>::A(value) => value, //~ error: expected one of `=>`, `@`, `if`, or `|`, found `<`
+ | ^ expected one of `=>`, `@`, `if`, or `|` here
+
+error: aborting due to previous error
+
--- /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.
+
+fn main() {
+ let v[0] = v[1]; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
+}
--- /dev/null
+error: expected one of `:`, `;`, `=`, or `@`, found `[`
+ --> $DIR/pat-lt-bracket-5.rs:12:10
+ |
+LL | let v[0] = v[1]; //~ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
+ | ^ expected one of `:`, `;`, `=`, or `@` here
+
+error: aborting due to previous error
+
--- /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.
+
+fn main() {
+ let Test(&desc[..]) = x; //~ ERROR: expected one of `)`, `,`, or `@`, found `[`
+}
--- /dev/null
+error: expected one of `)`, `,`, or `@`, found `[`
+ --> $DIR/pat-lt-bracket-6.rs:12:19
+ |
+LL | let Test(&desc[..]) = x; //~ ERROR: expected one of `)`, `,`, or `@`, found `[`
+ | ^ expected one of `)`, `,`, or `@` here
+
+error: aborting due to previous error
+
--- /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.
+
+fn main() {
+ for thing(x[]) in foo {} //~ ERROR: expected one of `)`, `,`, or `@`, found `[`
+}
--- /dev/null
+error: expected one of `)`, `,`, or `@`, found `[`
+ --> $DIR/pat-lt-bracket-7.rs:12:16
+ |
+LL | for thing(x[]) in foo {} //~ ERROR: expected one of `)`, `,`, or `@`, found `[`
+ | ^ expected one of `)`, `,`, or `@` here
+
+error: aborting due to previous error
+
--- /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.
+
+// Parsing of range patterns
+
+fn main() {
+ let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, or `=`, found `..=`
+}
--- /dev/null
+error: expected one of `:`, `;`, or `=`, found `..=`
+ --> $DIR/pat-ranges-1.rs:14:21
+ |
+LL | let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, or `=`, found `..=`
+ | ^^^ expected one of `:`, `;`, or `=` here
+
+error: aborting due to previous error
+
--- /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.
+
+// Parsing of range patterns
+
+fn main() {
+ let 10 ..= makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, or `=`, found `!`
+}
--- /dev/null
+error: expected one of `::`, `:`, `;`, or `=`, found `!`
+ --> $DIR/pat-ranges-2.rs:14:26
+ |
+LL | let 10 ..= makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, or `=`, found `!`
+ | ^ expected one of `::`, `:`, `;`, or `=` here
+
+error: aborting due to previous error
+
--- /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.
+
+// Parsing of range patterns
+
+fn main() {
+ let 10 ..= 10 + 3 = 12; //~ expected one of `:`, `;`, or `=`, found `+`
+}
--- /dev/null
+error: expected one of `:`, `;`, or `=`, found `+`
+ --> $DIR/pat-ranges-3.rs:14:19
+ |
+LL | let 10 ..= 10 + 3 = 12; //~ expected one of `:`, `;`, or `=`, found `+`
+ | ^ expected one of `:`, `;`, or `=` here
+
+error: aborting due to previous error
+
--- /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.
+
+// Parsing of range patterns
+
+fn main() {
+ let 10 - 3 ..= 10 = 8;
+ //~^ error: expected one of `...`, `..=`, `..`, `:`, `;`, or `=`, found `-`
+}
--- /dev/null
+error: expected one of `...`, `..=`, `..`, `:`, `;`, or `=`, found `-`
+ --> $DIR/pat-ranges-4.rs:14:12
+ |
+LL | let 10 - 3 ..= 10 = 8;
+ | ^ expected one of `...`, `..=`, `..`, `:`, `;`, or `=` here
+
+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 matcher(x: Option<isize>) {
+ match x {
+ ref Some(i) => {} //~ ERROR expected identifier, found enum pattern
+ None => {}
+ }
+}
+
+fn main() {}
--- /dev/null
+error: expected identifier, found enum pattern
+ --> $DIR/pat-ref-enum.rs:15:11
+ |
+LL | ref Some(i) => {} //~ ERROR expected identifier, found enum pattern
+ | ^^^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+ match 0 {
+ (, ..) => {} //~ ERROR expected pattern, found `,`
+ }
+}
--- /dev/null
+error: expected pattern, found `,`
+ --> $DIR/pat-tuple-1.rs:15:10
+ |
+LL | (, ..) => {} //~ ERROR expected pattern, found `,`
+ | ^ expected pattern
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+ match 0 {
+ (pat, ..,) => {} //~ ERROR trailing comma is not permitted after `..`
+ }
+}
--- /dev/null
+error: trailing comma is not permitted after `..`
+ --> $DIR/pat-tuple-2.rs:15:17
+ |
+LL | (pat, ..,) => {} //~ ERROR trailing comma is not permitted after `..`
+ | ^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+ match 0 {
+ (.., pat, ..) => {} //~ ERROR `..` can only be used once per tuple or tuple struct pattern
+ }
+}
--- /dev/null
+error: `..` can only be used once per tuple or tuple struct pattern
+ --> $DIR/pat-tuple-3.rs:15:19
+ |
+LL | (.., pat, ..) => {} //~ ERROR `..` can only be used once per tuple or tuple struct pattern
+ | ^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+ match 0 {
+ (.. pat) => {} //~ ERROR expected one of `)` or `,`, found `pat`
+ }
+}
--- /dev/null
+error: expected one of `)` or `,`, found `pat`
+ --> $DIR/pat-tuple-4.rs:15:13
+ |
+LL | (.. pat) => {} //~ ERROR expected one of `)` or `,`, found `pat`
+ | ^^^ expected one of `)` or `,` here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+ match 0 {
+ (pat ..) => {} //~ ERROR unexpected token: `)`
+ }
+}
--- /dev/null
+error: unexpected token: `)`
+ --> $DIR/pat-tuple-5.rs:15:14
+ |
+LL | (pat ..) => {} //~ ERROR unexpected token: `)`
+ | ^^
+
+error: aborting due to previous error
+
--- /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.
+
+// Issue #14660
+
+macro_rules! priv_x { () => {
+ static x: u32 = 0;
+}}
+
+macro_rules! pub_x { () => {
+ pub priv_x!(); //~ ERROR can't qualify macro invocation with `pub`
+ //~^ HELP try adjusting the macro to put `pub` inside the invocation
+}}
+
+mod foo {
+ pub_x!();
+}
+
+fn main() {
+ let y: u32 = foo::x;
+}
--- /dev/null
+error: can't qualify macro invocation with `pub`
+ --> $DIR/pub-item-macro.rs:18:5
+ |
+LL | pub priv_x!(); //~ ERROR can't qualify macro invocation with `pub`
+ | ^^^
+...
+LL | pub_x!();
+ | --------- in this macro invocation
+ |
+ = help: try adjusting the macro to put `pub` inside the invocation
+
+error: aborting due to previous error
+
--- /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.
+
+// Issue #18317
+
+mod bleh {
+ macro_rules! defn {
+ ($n:ident) => (
+ fn $n (&self) -> i32 {
+ println!("{}", stringify!($n));
+ 1
+ }
+ )
+ }
+
+ #[derive(Copy, Clone)]
+ pub struct S;
+
+ impl S {
+ pub defn!(f); //~ ERROR can't qualify macro invocation with `pub`
+ //~^ HELP try adjusting the macro to put `pub` inside the invocation
+ }
+}
+
+fn main() {}
--- /dev/null
+error: can't qualify macro invocation with `pub`
+ --> $DIR/pub-method-macro.rs:27:9
+ |
+LL | pub defn!(f); //~ ERROR can't qualify macro invocation with `pub`
+ | ^^^
+ |
+ = help: try adjusting the macro to put `pub` inside the invocation
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+// Test range syntax - syntax errors.
+
+pub fn main() {
+ let r = 1..2..3;
+ //~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..`
+}
--- /dev/null
+error: expected one of `.`, `;`, `?`, or an operator, found `..`
+ --> $DIR/range-3.rs:16:17
+ |
+LL | let r = 1..2..3;
+ | ^^ expected one of `.`, `;`, `?`, or an operator here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+// Test range syntax - syntax errors.
+
+pub fn main() {
+ let r = ..1..2;
+ //~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..`
+}
--- /dev/null
+error: expected one of `.`, `;`, `?`, or an operator, found `..`
+ --> $DIR/range-4.rs:16:16
+ |
+LL | let r = ..1..2;
+ | ^^ expected one of `.`, `;`, `?`, or an operator here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// Make sure that inclusive ranges with no end point don't parse.
+
+pub fn main() {
+ for _ in 1..= {} //~ERROR inclusive range with no end
+ //~^HELP bounded at the end
+}
+
--- /dev/null
+error[E0586]: inclusive range with no end
+ --> $DIR/range_inclusive.rs:14:19
+ |
+LL | for _ in 1..= {} //~ERROR inclusive range with no end
+ | ^
+ |
+ = help: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0586`.
--- /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
+
+// Make sure that inclusive ranges with `...` syntax don't parse.
+
+use std::ops::RangeToInclusive;
+
+fn return_range_to() -> RangeToInclusive<i32> {
+ return ...1; //~ERROR unexpected token: `...`
+ //~^HELP use `..` for an exclusive range
+ //~^^HELP or `..=` for an inclusive range
+}
+
+pub fn main() {
+ let x = ...0; //~ERROR unexpected token: `...`
+ //~^HELP use `..` for an exclusive range
+ //~^^HELP or `..=` for an inclusive range
+
+ let x = 5...5; //~ERROR unexpected token: `...`
+ //~^HELP use `..` for an exclusive range
+ //~^^HELP or `..=` for an inclusive range
+
+ for _ in 0...1 {} //~ERROR unexpected token: `...`
+ //~^HELP use `..` for an exclusive range
+ //~^^HELP or `..=` for an inclusive range
+}
--- /dev/null
+error: unexpected token: `...`
+ --> $DIR/range_inclusive_dotdotdot.rs:18:12
+ |
+LL | return ...1; //~ERROR unexpected token: `...`
+ | ^^^
+help: use `..` for an exclusive range
+ |
+LL | return ..1; //~ERROR unexpected token: `...`
+ | ^^
+help: or `..=` for an inclusive range
+ |
+LL | return ..=1; //~ERROR unexpected token: `...`
+ | ^^^
+
+error: unexpected token: `...`
+ --> $DIR/range_inclusive_dotdotdot.rs:24:13
+ |
+LL | let x = ...0; //~ERROR unexpected token: `...`
+ | ^^^
+help: use `..` for an exclusive range
+ |
+LL | let x = ..0; //~ERROR unexpected token: `...`
+ | ^^
+help: or `..=` for an inclusive range
+ |
+LL | let x = ..=0; //~ERROR unexpected token: `...`
+ | ^^^
+
+error: unexpected token: `...`
+ --> $DIR/range_inclusive_dotdotdot.rs:28:14
+ |
+LL | let x = 5...5; //~ERROR unexpected token: `...`
+ | ^^^
+help: use `..` for an exclusive range
+ |
+LL | let x = 5..5; //~ERROR unexpected token: `...`
+ | ^^
+help: or `..=` for an inclusive range
+ |
+LL | let x = 5..=5; //~ERROR unexpected token: `...`
+ | ^^^
+
+error: unexpected token: `...`
+ --> $DIR/range_inclusive_dotdotdot.rs:32:15
+ |
+LL | for _ in 0...1 {} //~ERROR unexpected token: `...`
+ | ^^^
+help: use `..` for an exclusive range
+ |
+LL | for _ in 0..1 {} //~ERROR unexpected token: `...`
+ | ^^
+help: or `..=` for an inclusive range
+ |
+LL | for _ in 0..=1 {} //~ERROR unexpected token: `...`
+ | ^^^
+
+error: aborting due to 4 previous errors
+
--- /dev/null
+// Copyright 2014 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
+
+
+pub fn main() {
+ br##"a"#; //~ unterminated raw string
+}
--- /dev/null
+error: unterminated raw string
+ --> $DIR/raw-byte-string-eof.rs:15:6
+ |
+LL | br##"a"#; //~ unterminated raw string
+ | ^ unterminated raw string
+ |
+ = note: this raw string should be terminated with `"##`
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+
+pub fn main() {
+ br"é"; //~ ERROR raw byte string must be ASCII
+ br##~"a"~##; //~ ERROR only `#` is allowed in raw string delimitation
+}
--- /dev/null
+error: raw byte string must be ASCII: /u{e9}
+ --> $DIR/raw-byte-string-literals.rs:15:8
+ |
+LL | br"é"; //~ ERROR raw byte string must be ASCII
+ | ^
+
+error: found invalid character; only `#` is allowed in raw string delimitation: ~
+ --> $DIR/raw-byte-string-literals.rs:16:6
+ |
+LL | br##~"a"~##; //~ ERROR only `#` is allowed in raw string delimitation
+ | ^^^
+
+error: aborting due to 2 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
+
+static s: &'static str =
+ r#~"#"~# //~ ERROR found invalid character; only `#` is allowed in raw string delimitation
+;
--- /dev/null
+error: found invalid character; only `#` is allowed in raw string delimitation: ~
+ --> $DIR/raw-str-delim.rs:14:5
+ |
+LL | r#~"#"~# //~ ERROR found invalid character; only `#` is allowed in raw string delimitation
+ | ^^
+
+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
+
+static s: &'static str =
+ r#"
+ "## //~ ERROR expected one of `.`, `;`, `?`, or an operator, found `#`
+;
--- /dev/null
+error: expected one of `.`, `;`, `?`, or an operator, found `#`
+ --> $DIR/raw-str-unbalanced.rs:15:9
+ |
+LL | "## //~ ERROR expected one of `.`, `;`, `?`, or an operator, found `#`
+ | ^ expected one of `.`, `;`, `?`, or an operator here
+
+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
+
+static s: &'static str =
+ r#" string literal goes on
+ and on
+ //~^^ ERROR unterminated raw string
--- /dev/null
+error: unterminated raw string
+ --> $DIR/raw-str-unterminated.rs:14:5
+ |
+LL | r#" string literal goes on
+ | ^ unterminated raw string
+ |
+ = note: this raw string should be terminated with `"#`
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only -Z continue-parse-after-error
+
+fn main() {
+ enum Test {
+ Very
+ Bad //~ ERROR found `Bad`
+ Stuff
+ }
+}
--- /dev/null
+error: expected one of `(`, `,`, `=`, `{`, or `}`, found `Bad`
+ --> $DIR/recover-enum.rs:16:9
+ |
+LL | Very
+ | - expected one of `(`, `,`, `=`, `{`, or `}` here
+LL | Bad //~ ERROR found `Bad`
+ | ^^^ unexpected token
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only -Z continue-parse-after-error
+
+fn main() {
+ enum Test {
+ Var1,
+ Var2(String),
+ Var3 {
+ abc: {}, //~ ERROR: expected type, found `{`
+ },
+ }
+
+ // recover...
+ let a = 1;
+ enum Test2 {
+ Fine,
+ }
+
+ enum Test3 {
+ StillFine {
+ def: i32,
+ },
+ }
+
+ {
+ // fail again
+ enum Test4 {
+ Nope(i32 {}) //~ ERROR: found `{`
+ //~^ ERROR: found `{`
+ }
+ }
+ // still recover later
+ let bad_syntax = _; //~ ERROR: expected expression, found reserved identifier `_`
+}
--- /dev/null
+error: expected type, found `{`
+ --> $DIR/recover-enum2.rs:18:18
+ |
+LL | abc: {}, //~ ERROR: expected type, found `{`
+ | ^
+
+error: expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `{`
+ --> $DIR/recover-enum2.rs:37:22
+ |
+LL | Nope(i32 {}) //~ ERROR: found `{`
+ | ^ expected one of 7 possible tokens here
+
+error: expected one of `!`, `&&`, `&`, `(`, `)`, `*`, `+`, `,`, `::`, `<`, `?`, `[`, `_`, `crate`, `dyn`, `extern`, `fn`, `for`, `impl`, `pub`, `unsafe`, `}`, or lifetime, found `{`
+ --> $DIR/recover-enum2.rs:37:22
+ |
+LL | Nope(i32 {}) //~ ERROR: found `{`
+ | ^ expected one of 23 possible tokens here
+
+error: expected expression, found reserved identifier `_`
+ --> $DIR/recover-enum2.rs:42:22
+ |
+LL | let bad_syntax = _; //~ ERROR: expected expression, found reserved identifier `_`
+ | ^ expected expression
+
+error: aborting due to 4 previous errors
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only -Z continue-parse-after-error
+
+fn main() {
+ struct Test {
+ Very
+ Bad //~ ERROR found `Bad`
+ Stuff
+ }
+}
--- /dev/null
+error: expected `:`, found `Bad`
+ --> $DIR/recover-struct.rs:16:9
+ |
+LL | Very
+ | - expected `:`
+LL | Bad //~ ERROR found `Bad`
+ | ^^^ unexpected token
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2012-2014 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
+
+// ignore-test blk region isn't supported in the front-end
+
+fn foo(cond: bool) {
+ // Here we will infer a type that uses the
+ // region of the if stmt then block, but in the scope:
+ let mut x; //~ ERROR foo
+
+ if cond {
+ x = &'blk [1,2,3];
+ }
+}
+
+fn main() {}
--- /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
+
+type closure = Box<lt/fn()>;
+//~^ ERROR expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `/`
--- /dev/null
+error: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `/`
+ --> $DIR/removed-syntax-closure-lifetime.rs:13:22
+ |
+LL | type closure = Box<lt/fn()>;
+ | ^ expected one of 7 possible tokens here
+
+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
+
+enum e = isize; //~ ERROR expected one of `<`, `where`, or `{`, found `=`
--- /dev/null
+error: expected one of `<`, `where`, or `{`, found `=`
+ --> $DIR/removed-syntax-enum-newtype.rs:13:8
+ |
+LL | enum e = isize; //~ ERROR expected one of `<`, `where`, or `{`, found `=`
+ | ^ expected one of `<`, `where`, or `{` here
+
+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
+
+extern {
+ const i: isize;
+ //~^ ERROR extern items cannot be `const`
+}
--- /dev/null
+error: extern items cannot be `const`
+ --> $DIR/removed-syntax-extern-const.rs:14:5
+ |
+LL | const i: isize;
+ | ^^^^^ help: try using a static value: `static`
+
+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 -Z continue-parse-after-error
+
+struct s {
+ let foo: (),
+ //~^ ERROR expected identifier, found keyword `let`
+ //~^^ ERROR expected `:`, found `foo`
+}
--- /dev/null
+error: expected identifier, found keyword `let`
+ --> $DIR/removed-syntax-field-let.rs:14:5
+ |
+LL | let foo: (),
+ | ^^^ expected identifier, found keyword
+
+error: expected `:`, found `foo`
+ --> $DIR/removed-syntax-field-let.rs:14:9
+ |
+LL | let foo: (),
+ | ^^^ expected `:`
+
+error: aborting due to 2 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 s {
+ bar: ();
+ //~^ ERROR expected `,`, or `}`, found `;`
+}
--- /dev/null
+error: expected `,`, or `}`, found `;`
+ --> $DIR/removed-syntax-field-semicolon.rs:14:12
+ |
+LL | bar: ();
+ | ^
+
+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
+
+type v = [isize * 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `*`
--- /dev/null
+error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `*`
+ --> $DIR/removed-syntax-fixed-vec.rs:13:17
+ |
+LL | type v = [isize * 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `*`
+ | ^ expected one of 7 possible tokens here
+
+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
+
+fn f() {
+ let x: fn~() = || (); //~ ERROR expected `(`, found `~`
+}
--- /dev/null
+error: expected `(`, found `~`
+ --> $DIR/removed-syntax-fn-sigil.rs:14:14
+ |
+LL | let x: fn~() = || (); //~ ERROR expected `(`, found `~`
+ | - ^ expected `(`
+ | |
+ | while parsing the type for `x`
+
+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
+
+fn f(+x: isize) {} //~ ERROR expected pattern, found `+`
--- /dev/null
+error: expected pattern, found `+`
+ --> $DIR/removed-syntax-mode.rs:13:6
+ |
+LL | fn f(+x: isize) {} //~ ERROR expected pattern, found `+`
+ | ^ expected pattern
+
+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
+
+fn f() {
+ let v = [mut 1, 2, 3, 4]; //~ ERROR expected expression, found keyword `mut`
+}
--- /dev/null
+error: expected expression, found keyword `mut`
+ --> $DIR/removed-syntax-mut-vec-expr.rs:14:14
+ |
+LL | let v = [mut 1, 2, 3, 4]; //~ ERROR expected expression, found keyword `mut`
+ | ^^^ expected expression
+
+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
+
+type v = [mut isize]; //~ ERROR expected type, found keyword `mut`
--- /dev/null
+error: expected type, found keyword `mut`
+ --> $DIR/removed-syntax-mut-vec-ty.rs:13:11
+ |
+LL | type v = [mut isize]; //~ ERROR expected type, found keyword `mut`
+ | ^^^
+
+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
+
+type bptr = &lifetime/isize; //~ ERROR expected one of `!`, `(`, `::`, `;`, or `<`, found `/`
--- /dev/null
+error: expected one of `!`, `(`, `::`, `;`, or `<`, found `/`
+ --> $DIR/removed-syntax-ptr-lifetime.rs:13:22
+ |
+LL | type bptr = &lifetime/isize; //~ ERROR expected one of `!`, `(`, `::`, `;`, or `<`, found `/`
+ | ^ expected one of `!`, `(`, `::`, `;`, or `<` here
+
+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
+
+type t = { f: () }; //~ ERROR expected type, found `{`
--- /dev/null
+error: expected type, found `{`
+ --> $DIR/removed-syntax-record.rs:13:10
+ |
+LL | type t = { f: () }; //~ ERROR expected type, found `{`
+ | ^
+
+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
+// ignore-tidy-linelength
+
+struct S;
+
+impl S {
+ static fn f() {}
+}
+//~^^ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`,
--- /dev/null
+error: expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, `unsafe`, or `}`, found `static`
+ --> $DIR/removed-syntax-static-fn.rs:17:5
+ |
+LL | impl S {
+ | - expected one of 11 possible tokens here
+LL | static fn f() {}
+ | ^^^^^^ 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
+
+fn f() {
+ let a_box = box mut 42; //~ ERROR expected expression, found keyword `mut`
+}
--- /dev/null
+error: expected expression, found keyword `mut`
+ --> $DIR/removed-syntax-uniq-mut-expr.rs:14:21
+ |
+LL | let a_box = box mut 42; //~ ERROR expected expression, found keyword `mut`
+ | ^^^ expected expression
+
+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
+
+type mut_box = Box<mut isize>; //~ ERROR expected one of `>`, lifetime, or type, found `mut`
--- /dev/null
+error: expected one of `>`, lifetime, or type, found `mut`
+ --> $DIR/removed-syntax-uniq-mut-ty.rs:13:20
+ |
+LL | type mut_box = Box<mut isize>; //~ ERROR expected one of `>`, lifetime, or type, found `mut`
+ | ^^^ expected one of `>`, lifetime, or type here
+
+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
+
+fn removed_with() {
+ struct S {
+ foo: (),
+ bar: (),
+ }
+
+ let a = S { foo: (), bar: () };
+ let b = S { foo: () with a };
+ //~^ ERROR expected one of `,`, `.`, `?`, `}`, or an operator, found `with`
+}
--- /dev/null
+error: expected one of `,`, `.`, `?`, `}`, or an operator, found `with`
+ --> $DIR/removed-syntax-with-1.rs:20:25
+ |
+LL | let b = S { foo: () with a };
+ | ^^^^ expected one of `,`, `.`, `?`, `}`, or an operator here
+
+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
+
+fn removed_with() {
+ struct S {
+ foo: (),
+ bar: (),
+ }
+
+ let a = S { foo: (), bar: () };
+ let b = S { foo: (), with a };
+ //~^ ERROR expected one of `,` or `}`, found `a`
+}
--- /dev/null
+error: expected one of `,` or `}`, found `a`
+ --> $DIR/removed-syntax-with-2.rs:20:31
+ |
+LL | let b = S { foo: (), with a };
+ | ^ expected one of `,` or `}` here
+
+error: aborting due to previous error
+
--- /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 f<T>() {}
+
+fn main() {
+ false == false == false;
+ //~^ ERROR: chained comparison operators require parentheses
+
+ false == 0 < 2;
+ //~^ ERROR: chained comparison operators require parentheses
+
+ f<X>();
+ //~^ ERROR: chained comparison operators require parentheses
+ //~| HELP: use `::<...>` instead of `<...>`
+ //~| HELP: or use `(...)`
+}
--- /dev/null
+error: chained comparison operators require parentheses
+ --> $DIR/require-parens-for-chained-comparison.rs:16:11
+ |
+LL | false == false == false;
+ | ^^^^^^^^^^^^^^^^^
+
+error: chained comparison operators require parentheses
+ --> $DIR/require-parens-for-chained-comparison.rs:19:11
+ |
+LL | false == 0 < 2;
+ | ^^^^^^^^
+
+error: chained comparison operators require parentheses
+ --> $DIR/require-parens-for-chained-comparison.rs:22:6
+ |
+LL | f<X>();
+ | ^^^^
+ |
+ = help: use `::<...>` instead of `<...>` if you meant to specify type arguments
+ = help: or use `(...)` if you meant to specify fn arguments
+
+error: aborting due to 3 previous errors
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+struct Rgb(u8, u8, u8);
+
+fn main() {
+ let _ = Rgb { 0, 1, 2 }; //~ ERROR expected identifier, found `0`
+}
--- /dev/null
+error: expected identifier, found `0`
+ --> $DIR/struct-field-numeric-shorthand.rs:16:19
+ |
+LL | let _ = Rgb { 0, 1, 2 }; //~ ERROR expected identifier, found `0`
+ | --- ^ expected identifier
+ | |
+ | while parsing this struct
+
+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
+
+struct Foo {
+ x: isize,
+}
+
+impl Foo {
+ fn hi(&self) -> bool {
+ true
+ }
+}
+
+fn main() {
+ for x in Foo {
+ x: 3 //~ ERROR expected type, found `3`
+ }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
+ println!("yo");
+ }
+}
--- /dev/null
+error: expected type, found `3`
+ --> $DIR/struct-literal-in-for.rs:25:12
+ |
+LL | x: 3 //~ ERROR expected type, found `3`
+ | ^ expecting a type here because of type ascription
+
+error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
+ --> $DIR/struct-literal-in-for.rs:26:12
+ |
+LL | }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
+ | ^ expected one of `.`, `;`, `?`, `}`, or an operator here
+
+error: aborting due to 2 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
+
+struct Foo {
+ x: isize,
+}
+
+impl Foo {
+ fn hi(&self) -> bool {
+ true
+ }
+}
+
+fn main() {
+ if Foo {
+ x: 3 //~ ERROR expected type, found `3`
+ }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
+ println!("yo");
+ }
+}
--- /dev/null
+error: expected type, found `3`
+ --> $DIR/struct-literal-in-if.rs:25:12
+ |
+LL | x: 3 //~ ERROR expected type, found `3`
+ | ^ expecting a type here because of type ascription
+
+error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
+ --> $DIR/struct-literal-in-if.rs:26:12
+ |
+LL | }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
+ | ^ expected one of `.`, `;`, `?`, `}`, or an operator here
+
+error: aborting due to 2 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
+
+struct Foo {
+ x: isize,
+}
+
+fn main() {
+ match Foo {
+ x: 3 //~ ERROR expected one of `=>`, `@`, `if`, or `|`, found `:`
+ } {
+ Foo {
+ x: x
+ } => {} //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `=>`
+ }
+}
--- /dev/null
+error: expected one of `=>`, `@`, `if`, or `|`, found `:`
+ --> $DIR/struct-literal-in-match-discriminant.rs:19:10
+ |
+LL | x: 3 //~ ERROR expected one of `=>`, `@`, `if`, or `|`, found `:`
+ | ^ expected one of `=>`, `@`, `if`, or `|` here
+
+error: expected one of `.`, `;`, `?`, `}`, or an operator, found `=>`
+ --> $DIR/struct-literal-in-match-discriminant.rs:23:11
+ |
+LL | } => {} //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `=>`
+ | ^^ expected one of `.`, `;`, `?`, `}`, or an operator here
+
+error: aborting due to 2 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
+
+struct Foo {
+ x: isize,
+}
+
+impl Foo {
+ fn hi(&self) -> bool {
+ true
+ }
+}
+
+fn main() {
+ while Foo {
+ x: 3 //~ ERROR expected type, found `3`
+ }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
+ println!("yo");
+ }
+}
--- /dev/null
+error: expected type, found `3`
+ --> $DIR/struct-literal-in-while.rs:25:12
+ |
+LL | x: 3 //~ ERROR expected type, found `3`
+ | ^ expecting a type here because of type ascription
+
+error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
+ --> $DIR/struct-literal-in-while.rs:26:12
+ |
+LL | }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
+ | ^ expected one of `.`, `;`, `?`, `}`, or an operator here
+
+error: aborting due to 2 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
+
+struct Foo {
+ x: isize,
+}
+
+impl Foo {
+ fn hi(&self) -> bool {
+ true
+ }
+}
+
+fn main() {
+ while || Foo {
+ x: 3 //~ ERROR expected type, found `3`
+ }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
+ println!("yo");
+ }
+}
--- /dev/null
+error: expected type, found `3`
+ --> $DIR/struct-literal-restrictions-in-lamda.rs:25:12
+ |
+LL | x: 3 //~ ERROR expected type, found `3`
+ | ^ expecting a type here because of type ascription
+
+error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
+ --> $DIR/struct-literal-restrictions-in-lamda.rs:26:12
+ |
+LL | }.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
+ | ^ expected one of `.`, `;`, `?`, `}`, or an operator here
+
+error: aborting due to 2 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
+
+//error-pattern: discriminator values can only be used with a field-less enum
+
+enum color {
+ red = 0xff0000,
+ green = 0x00ff00,
+ blue = 0x0000ff,
+ black = 0x000000,
+ white = 0xffffff,
+ other (str),
+}
--- /dev/null
+error: discriminator values can only be used with a field-less enum
+ --> $DIR/tag-variant-disr-non-nullary.rs:20:13
+ |
+LL | white = 0xffffff,
+ | ^^^^^^^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+// ignore-tidy-cr
+// Issue #11669
+
+fn main() {
+ // \r\n
+ let ok = "This is \
+ a test";
+ // \r only
+ let bad = "This is \\r a test";
+ //~^ ERROR unknown character escape: \r
+ //~^^ HELP this is an isolated carriage return
+
+}
--- /dev/null
+error: unknown character escape: /r
+ --> $DIR/trailing-carriage-return-in-string.rs:21:25
+ |
+LL | let bad = "This is /\r a test";
+ | ^
+ |
+help: this is an isolated carriage return; consider checking your editor and version control settings
+ --> $DIR/trailing-carriage-return-in-string.rs:21:25
+ |
+LL | let bad = "This is /\r a test";
+ | ^
+
+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 -Z continue-parse-after-error
+
+trait Foo {
+}
+
+struct Bar;
+
+impl Foo + Owned for Bar { //~ ERROR expected a trait, found type
+}
+
+fn main() { }
--- /dev/null
+error: expected a trait, found type
+ --> $DIR/trait-bounds-not-on-impl.rs:18:6
+ |
+LL | impl Foo + Owned for Bar { //~ ERROR expected a trait, found type
+ | ^^^^^^^^^^^
+
+error: aborting due to previous error
+
--- /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.
+
+macro_rules! bah {
+ ($a:expr) => ($a)
+ //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, or `unsafe`, found `2`
+}
+
+trait bar {
+ bah!(2);
+}
+
+fn main() {}
--- /dev/null
+error: expected one of `async`, `const`, `extern`, `fn`, `type`, or `unsafe`, found `2`
+ --> $DIR/trait-non-item-macros.rs:12:19
+ |
+LL | ($a:expr) => ($a)
+ | ^^ unexpected token
+...
+LL | bah!(2);
+ | -------- in this macro invocation
+
+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
+
+fn main() {
+ let _: Box<((Copy)) + Copy>;
+ //~^ ERROR expected a path on the left-hand side of `+`, not `((Copy))`
+ let _: Box<(Copy + Copy) + Copy>;
+ //~^ ERROR expected a path on the left-hand side of `+`, not `(Copy + Copy)`
+ let _: Box<(Copy +) + Copy>;
+ //~^ ERROR expected a path on the left-hand side of `+`, not `(Copy)`
+ let _: Box<(dyn Copy) + Copy>;
+ //~^ ERROR expected a path on the left-hand side of `+`, not `(dyn Copy)`
+}
--- /dev/null
+error[E0178]: expected a path on the left-hand side of `+`, not `((Copy))`
+ --> $DIR/trait-object-bad-parens.rs:14:16
+ |
+LL | let _: Box<((Copy)) + Copy>;
+ | ^^^^^^^^^^^^^^^ expected a path
+
+error[E0178]: expected a path on the left-hand side of `+`, not `(Copy + Copy)`
+ --> $DIR/trait-object-bad-parens.rs:16:16
+ |
+LL | let _: Box<(Copy + Copy) + Copy>;
+ | ^^^^^^^^^^^^^^^^^^^^ expected a path
+
+error[E0178]: expected a path on the left-hand side of `+`, not `(Copy)`
+ --> $DIR/trait-object-bad-parens.rs:18:16
+ |
+LL | let _: Box<(Copy +) + Copy>;
+ | ^^^^^^^^^^^^^^^ expected a path
+
+error[E0178]: expected a path on the left-hand side of `+`, not `(dyn Copy)`
+ --> $DIR/trait-object-bad-parens.rs:20:16
+ |
+LL | let _: Box<(dyn Copy) + Copy>;
+ | ^^^^^^^^^^^^^^^^^ expected a path
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0178`.
--- /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
+
+fn f<T: Copy + ('a)>() {} //~ ERROR parenthesized lifetime bounds are not supported
+
+fn main() {
+ let _: Box<Copy + ('a)>; //~ ERROR parenthesized lifetime bounds are not supported
+ let _: Box<('a) + Copy>; //~ ERROR expected type, found `'a`
+}
--- /dev/null
+error: parenthesized lifetime bounds are not supported
+ --> $DIR/trait-object-lifetime-parens.rs:13:19
+ |
+LL | fn f<T: Copy + ('a)>() {} //~ ERROR parenthesized lifetime bounds are not supported
+ | ^
+
+error: parenthesized lifetime bounds are not supported
+ --> $DIR/trait-object-lifetime-parens.rs:16:26
+ |
+LL | let _: Box<Copy + ('a)>; //~ ERROR parenthesized lifetime bounds are not supported
+ | ^
+
+error: expected type, found `'a`
+ --> $DIR/trait-object-lifetime-parens.rs:17:17
+ |
+LL | let _: Box<('a) + Copy>; //~ ERROR expected type, found `'a`
+ | - ^^
+ | |
+ | while parsing the type for `_`
+
+error: aborting due to 3 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.
+
+// A single lifetime is not parsed as a type.
+// `ty` matcher in particular doesn't accept a single lifetime
+
+macro_rules! m {
+ ($t: ty) => ( let _: $t; )
+}
+
+fn main() {
+ m!('static); //~ ERROR expected type, found `'static`
+}
--- /dev/null
+error: expected type, found `'static`
+ --> $DIR/trait-object-macro-matcher.rs:19:8
+ |
+LL | m!('static); //~ ERROR expected type, found `'static`
+ | ^^^^^^^
+
+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.
+
+trait Trait<'a> {}
+
+fn main() {
+ let _: &for<'a> Trait<'a> + 'static;
+ //~^ ERROR expected a path on the left-hand side of `+`, not `&for<'a> Trait<'a>`
+ //~| HELP try adding parentheses
+ //~| SUGGESTION &(for<'a> Trait<'a> + 'static)
+}
--- /dev/null
+error[E0178]: expected a path on the left-hand side of `+`, not `&for<'a> Trait<'a>`
+ --> $DIR/trait-object-polytrait-priority.rs:14:12
+ |
+LL | let _: &for<'a> Trait<'a> + 'static;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try adding parentheses: `&(for<'a> Trait<'a> + 'static)`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0178`.
--- /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
+
+fn f<T: (Copy) + (?Sized) + (for<'a> Trait<'a>)>() {}
+
+fn main() {
+ let _: Box<(Copy) + (?Sized) + (for<'a> Trait<'a>)>;
+ let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Copy)>;
+ let _: Box<(for<'a> Trait<'a>) + (Copy) + (?Sized)>;
+}
+
+FAIL //~ ERROR
--- /dev/null
+error: expected one of `!` or `::`, found `<eof>`
+ --> $DIR/trait-object-trait-parens.rs:21:1
+ |
+LL | FAIL //~ ERROR
+ | ^^^^ 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
+// Fixes issue where `+` in generics weren't parsed if they were part of a `+=`.
+
+struct Whitespace<T: Clone + = ()> { t: T }
+struct TokenSplit<T: Clone += ()> { t: T }
+
+fn main() {
+}
+
+FAIL //~ ERROR
--- /dev/null
+error: expected one of `!` or `::`, found `<eof>`
+ --> $DIR/trait-plusequal-splitting.rs:20:1
+ |
+LL | FAIL //~ ERROR
+ | ^^^^ expected one of `!` or `::` here
+
+error: aborting due to previous error
+
--- /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.
+
+trait Foo {
+ pub const Foo: u32;
+ //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found
+}
+
+fn main() {}
--- /dev/null
+error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub`
+ --> $DIR/trait-pub-assoc-const.rs:12:5
+ |
+LL | trait Foo {
+ | - expected one of 7 possible tokens here
+LL | pub const Foo: u32;
+ | ^^^ unexpected token
+
+error: aborting due to previous error
+
--- /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.
+
+trait Foo {
+ pub type Foo;
+ //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found
+}
+
+fn main() {}
--- /dev/null
+error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub`
+ --> $DIR/trait-pub-assoc-ty.rs:12:5
+ |
+LL | trait Foo {
+ | - expected one of 7 possible tokens here
+LL | pub type Foo;
+ | ^^^ unexpected token
+
+error: aborting due to previous error
+
--- /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.
+
+trait Foo {
+ pub fn foo();
+ //~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found
+}
+
+fn main() {}
--- /dev/null
+error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub`
+ --> $DIR/trait-pub-method.rs:12:5
+ |
+LL | trait Foo {
+ | - expected one of 7 possible tokens here
+LL | pub fn foo();
+ | ^^^ unexpected token
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+struct Foo {
+ x: isize,
+ y: isize,
+}
+
+fn main() {
+ let f = Foo {
+ x: 1,
+ y: 2,
+ };
+ f.x::<isize>;
+ //~^ ERROR field expressions may not have generic arguments
+ f.x::<>;
+ //~^ ERROR field expressions may not have generic arguments
+ f.x::();
+ //~^ ERROR field expressions may not have generic arguments
+}
--- /dev/null
+error: field expressions may not have generic arguments
+ --> $DIR/type-parameters-in-field-exprs.rs:23:8
+ |
+LL | f.x::<isize>;
+ | ^^^^^^^^^
+
+error: field expressions may not have generic arguments
+ --> $DIR/type-parameters-in-field-exprs.rs:25:8
+ |
+LL | f.x::<>;
+ | ^^^^
+
+error: field expressions may not have generic arguments
+ --> $DIR/type-parameters-in-field-exprs.rs:27:8
+ |
+LL | f.x::();
+ | ^^^^
+
+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
+
+
+// error-pattern: unterminated double quote string
+
+
+fn main() {
+ "
+}
--- /dev/null
+error: unterminated double quote string
+ --> $DIR/unbalanced-doublequote.rs:18:5
+ |
+LL | / "
+LL | | }
+ | |__^
+
+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.
+
+fn main() {
+ let a = 42._; //~ ERROR expected identifier, found reserved identifier `_`
+ //~^ ERROR `{integer}` is a primitive type and therefore doesn't have fields
+}
--- /dev/null
+error: expected identifier, found reserved identifier `_`
+ --> $DIR/underscore-suffix-for-float.rs:12:16
+ |
+LL | let a = 42._; //~ ERROR expected identifier, found reserved identifier `_`
+ | ^ expected identifier, found reserved identifier
+
+error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
+ --> $DIR/underscore-suffix-for-float.rs:12:16
+ |
+LL | let a = 42._; //~ ERROR expected identifier, found reserved identifier `_`
+ | ^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0610`.
--- /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.
+
+fn main() {
+ let _ = "Foo"_;
+ //~^ WARNING underscore literal suffix is not allowed
+ //~| WARNING this was previously accepted
+ //~| NOTE issue #42326
+}
+
+FAIL
+//~^ ERROR
+//~| NOTE
--- /dev/null
+warning: underscore literal suffix is not allowed
+ --> $DIR/underscore-suffix-for-string.rs:12:18
+ |
+LL | let _ = "Foo"_;
+ | ^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #42326 <https://github.com/rust-lang/rust/issues/42326>
+
+error: expected one of `!` or `::`, found `<eof>`
+ --> $DIR/underscore-suffix-for-string.rs:18:1
+ |
+LL | FAIL
+ | ^^^^ expected one of `!` or `::` here
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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 y = 0;
+ //~^ ERROR unknown start of token: \u{37e}
+ //~^^ HELP Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not
+}
--- /dev/null
+error: unknown start of token: /u{37e}
+ --> $DIR/unicode-chars.rs:14:14
+ |
+LL | let y = 0;
+ | ^
+help: Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not
+ |
+LL | let y = 0;
+ | ^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+// Test syntax checks for `type` keyword.
+
+struct S1 for type; //~ ERROR expected `where`, `{`, `(`, or `;` after struct name, found `for`
+
+pub fn main() {
+}
--- /dev/null
+error: expected `where`, `{`, `(`, or `;` after struct name, found `for`
+ --> $DIR/unsized.rs:15:11
+ |
+LL | struct S1 for type; //~ ERROR expected `where`, `{`, `(`, or `;` after struct name, found `for`
+ | ^^^ expected `where`, `{`, `(`, or `;` after struct name
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+// Test syntax checks for `type` keyword.
+
+fn f<X>() {}
+
+pub fn main() {
+ f<type>(); //~ ERROR expected expression, found keyword `type`
+}
--- /dev/null
+error: expected expression, found keyword `type`
+ --> $DIR/unsized2.rs:18:7
+ |
+LL | f<type>(); //~ ERROR expected expression, found keyword `type`
+ | ^^^^ expected expression
+
+error: aborting due to previous error
+
--- /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 -Z continue-parse-after-error
+
+use std::any:: as foo; //~ ERROR expected identifier, found keyword `as`
+//~^ ERROR: expected one of `::`, `;`, or `as`, found `foo`
--- /dev/null
+error: expected identifier, found keyword `as`
+ --> $DIR/use-as-where-use-ends-with-mod-sep.rs:13:16
+ |
+LL | use std::any:: as foo; //~ ERROR expected identifier, found keyword `as`
+ | ^^ expected identifier, found keyword
+
+error: expected one of `::`, `;`, or `as`, found `foo`
+ --> $DIR/use-as-where-use-ends-with-mod-sep.rs:13:19
+ |
+LL | use std::any:: as foo; //~ ERROR expected identifier, found keyword `as`
+ | ^^^ expected one of `::`, `;`, or `as` here
+
+error: aborting due to 2 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
+
+use std::any::; //~ ERROR expected identifier, found `;`
--- /dev/null
+error: expected identifier, found `;`
+ --> $DIR/use-ends-with-mod-sep.rs:13:15
+ |
+LL | use std::any::; //~ ERROR expected identifier, found `;`
+ | ^ expected identifier
+
+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
+
+fn foo(x: isize, ...) {
+ //~^ ERROR: only foreign functions are allowed to be variadic
+}
+
+fn main() {}
--- /dev/null
+error: only foreign functions are allowed to be variadic
+ --> $DIR/variadic-ffi-3.rs:13:18
+ |
+LL | fn foo(x: isize, ...) {
+ | ^^^
+
+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
+
+extern "C" fn foo(x: isize, ...) {
+ //~^ ERROR: only foreign functions are allowed to be variadic
+}
+
+fn main() {}
--- /dev/null
+error: only foreign functions are allowed to be variadic
+ --> $DIR/variadic-ffi-4.rs:13:29
+ |
+LL | extern "C" fn foo(x: isize, ...) {
+ | ^^^
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 2014 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
+
+// Test diagnostics for the removed struct inheritance feature.
+
+virtual struct SuperStruct { //~ ERROR expected item, found `virtual`
+ f1: isize,
+}
+
+struct Struct : SuperStruct;
+
+pub fn main() {}
--- /dev/null
+error: expected item, found `virtual`
+ --> $DIR/virtual-structs.rs:15:1
+ |
+LL | virtual struct SuperStruct { //~ ERROR expected item, found `virtual`
+ | ^^^^^^^ expected item
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only -Z continue-parse-after-error
+
+// Empty predicate list is OK
+fn equal1<T>(_: &T, _: &T) -> bool where {
+ true
+}
+
+// Empty bound list is OK
+fn equal2<T>(_: &T, _: &T) -> bool where T: {
+ true
+}
+
+fn foo<'a>() where 'a {}
+//~^ ERROR expected `:`, found `{`
+
+fn main() {
+}
--- /dev/null
+error: expected `:`, found `{`
+ --> $DIR/where-clauses-no-bounds-or-predicates.rs:23:23
+ |
+LL | fn foo<'a>() where 'a {}
+ | ^ expected `:`
+
+error: aborting due to previous error
+
--- /dev/null
+// Copyright 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.
+
+// compile-flags: -Z parse-only
+
+fn foo<T>() where <T>::Item: ToString, T: Iterator { }
+//~^ ERROR generic parameters on `where` clauses are reserved for future use
+
+fn main() {}
--- /dev/null
+error: generic parameters on `where` clauses are reserved for future use
+ --> $DIR/where_with_bound.rs:13:19
+ |
+LL | fn foo<T>() where <T>::Item: ToString, T: Iterator { }
+ | ^^^
+
+error: aborting due to previous error
+
--- /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.
+
+fn f() {
+ let ok = "{{everything fine}}";
+ let bad = "\{it is wrong\}";
+ //~^ ERROR unknown character escape: {
+ //~^^ HELP if used in a formatting string, curly braces are escaped with `{{` and `}}`
+ //~^^^ ERROR unknown character escape: }
+ //~^^^^ HELP if used in a formatting string, curly braces are escaped with `{{` and `}}`
+}
--- /dev/null
+error: unknown character escape: {
+ --> $DIR/wrong-escape-of-curly-braces.rs:13:17
+ |
+LL | let bad = "/{it is wrong/}";
+ | ^
+ |
+help: if used in a formatting string, curly braces are escaped with `{{` and `}}`
+ --> $DIR/wrong-escape-of-curly-braces.rs:13:17
+ |
+LL | let bad = "/{it is wrong/}";
+ | ^
+
+error: unknown character escape: }
+ --> $DIR/wrong-escape-of-curly-braces.rs:13:30
+ |
+LL | let bad = "/{it is wrong/}";
+ | ^
+ |
+help: if used in a formatting string, curly braces are escaped with `{{` and `}}`
+ --> $DIR/wrong-escape-of-curly-braces.rs:13:30
+ |
+LL | let bad = "/{it is wrong/}";
+ | ^
+
+error[E0601]: `main` function not found in crate `wrong_escape_of_curly_braces`
+ |
+ = note: consider adding a `main` function to `$DIR/wrong-escape-of-curly-braces.rs`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0601`.