diff --git a/src/test/ui/rfc-2632-const-trait-impl/tilde-twice.rs b/src/test/ui/rfc-2632-const-trait-impl/tilde-twice.rs new file mode 100644 index 00000000000..06e4ede8b5e --- /dev/null +++ b/src/test/ui/rfc-2632-const-trait-impl/tilde-twice.rs @@ -0,0 +1,6 @@ +// compile-flags: -Z parse-only + +#![feature(const_trait_impl)] + +struct S; +//~^ ERROR expected identifier, found `~` diff --git a/src/test/ui/rfc-2632-const-trait-impl/tilde-twice.stderr b/src/test/ui/rfc-2632-const-trait-impl/tilde-twice.stderr new file mode 100644 index 00000000000..928d23e8a42 --- /dev/null +++ b/src/test/ui/rfc-2632-const-trait-impl/tilde-twice.stderr @@ -0,0 +1,8 @@ +error: expected identifier, found `~` + --> $DIR/tilde-twice.rs:5:20 + | +LL | struct S; + | ^ expected identifier + +error: aborting due to previous error + diff --git a/src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs b/src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs new file mode 100644 index 00000000000..96ba393bd85 --- /dev/null +++ b/src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs @@ -0,0 +1,6 @@ +// compiler-flags: -Z parse-only + +#![feature(const_trait_impl)] + +struct S; +//~^ ERROR expected one of `!`, `(`, `,`, `=`, `>`, `?`, `for`, `~`, lifetime, or path diff --git a/src/test/ui/rfc-2632-const-trait-impl/without-tilde.stderr b/src/test/ui/rfc-2632-const-trait-impl/without-tilde.stderr new file mode 100644 index 00000000000..b6b77ac4a2f --- /dev/null +++ b/src/test/ui/rfc-2632-const-trait-impl/without-tilde.stderr @@ -0,0 +1,8 @@ +error: expected one of `!`, `(`, `,`, `=`, `>`, `?`, `for`, `~`, lifetime, or path, found keyword `const` + --> $DIR/without-tilde.rs:5:13 + | +LL | struct S; + | ^^^^^ expected one of 10 possible tokens + +error: aborting due to previous error +