summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/mismatched-braces
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:43 +0000
commit3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245 (patch)
treedaf049b282ab10e8c3d03e409b3cd84ff3f7690c /tests/ui/parser/mismatched-braces
parentAdding debian version 1.68.2+dfsg1-1. (diff)
downloadrustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.tar.xz
rustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.zip
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/parser/mismatched-braces')
-rw-r--r--tests/ui/parser/mismatched-braces/missing-close-brace-in-impl-trait.rs6
-rw-r--r--tests/ui/parser/mismatched-braces/missing-close-brace-in-impl-trait.stderr25
-rw-r--r--tests/ui/parser/mismatched-braces/missing-close-brace-in-struct.rs2
-rw-r--r--tests/ui/parser/mismatched-braces/missing-close-brace-in-struct.stderr11
-rw-r--r--tests/ui/parser/mismatched-braces/missing-close-brace-in-trait.rs3
-rw-r--r--tests/ui/parser/mismatched-braces/missing-close-brace-in-trait.stderr20
6 files changed, 9 insertions, 58 deletions
diff --git a/tests/ui/parser/mismatched-braces/missing-close-brace-in-impl-trait.rs b/tests/ui/parser/mismatched-braces/missing-close-brace-in-impl-trait.rs
index 8f46970b1..79de98d8b 100644
--- a/tests/ui/parser/mismatched-braces/missing-close-brace-in-impl-trait.rs
+++ b/tests/ui/parser/mismatched-braces/missing-close-brace-in-impl-trait.rs
@@ -1,13 +1,13 @@
fn main() {}
-impl T for () { //~ ERROR cannot find trait `T` in this scope
+impl T for () {
fn foo(&self) {}
-trait T { //~ ERROR trait is not supported in `trait`s or `impl`s
+trait T {
fn foo(&self);
}
-pub(crate) struct Bar<T>(); //~ ERROR struct is not supported in `trait`s or `impl`s
+pub(crate) struct Bar<T>();
//~ ERROR this file contains an unclosed delimiter
diff --git a/tests/ui/parser/mismatched-braces/missing-close-brace-in-impl-trait.stderr b/tests/ui/parser/mismatched-braces/missing-close-brace-in-impl-trait.stderr
index cc7cc0c55..d91a7f054 100644
--- a/tests/ui/parser/mismatched-braces/missing-close-brace-in-impl-trait.stderr
+++ b/tests/ui/parser/mismatched-braces/missing-close-brace-in-impl-trait.stderr
@@ -7,28 +7,5 @@ LL | impl T for () {
LL |
| ^
-error: trait is not supported in `trait`s or `impl`s
- --> $DIR/missing-close-brace-in-impl-trait.rs:7:1
- |
-LL | trait T {
- | ^^^^^^^
- |
- = help: consider moving the trait out to a nearby module scope
-
-error: struct is not supported in `trait`s or `impl`s
- --> $DIR/missing-close-brace-in-impl-trait.rs:11:1
- |
-LL | pub(crate) struct Bar<T>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = help: consider moving the struct out to a nearby module scope
-
-error[E0405]: cannot find trait `T` in this scope
- --> $DIR/missing-close-brace-in-impl-trait.rs:3:6
- |
-LL | impl T for () {
- | ^ not found in this scope
-
-error: aborting due to 4 previous errors
+error: aborting due to previous error
-For more information about this error, try `rustc --explain E0405`.
diff --git a/tests/ui/parser/mismatched-braces/missing-close-brace-in-struct.rs b/tests/ui/parser/mismatched-braces/missing-close-brace-in-struct.rs
index 090a17b41..88bc72576 100644
--- a/tests/ui/parser/mismatched-braces/missing-close-brace-in-struct.rs
+++ b/tests/ui/parser/mismatched-braces/missing-close-brace-in-struct.rs
@@ -1,7 +1,7 @@
pub(crate) struct Bar<T> {
foo: T,
-trait T { //~ ERROR expected identifier, found keyword `trait`
+trait T {
fn foo(&self);
}
diff --git a/tests/ui/parser/mismatched-braces/missing-close-brace-in-struct.stderr b/tests/ui/parser/mismatched-braces/missing-close-brace-in-struct.stderr
index ad1e90e43..d01d9ed60 100644
--- a/tests/ui/parser/mismatched-braces/missing-close-brace-in-struct.stderr
+++ b/tests/ui/parser/mismatched-braces/missing-close-brace-in-struct.stderr
@@ -7,14 +7,5 @@ LL | pub(crate) struct Bar<T> {
LL | fn main() {}
| ^
-error: expected identifier, found keyword `trait`
- --> $DIR/missing-close-brace-in-struct.rs:4:1
- |
-LL | pub(crate) struct Bar<T> {
- | --- while parsing this struct
-...
-LL | trait T {
- | ^^^^^ expected identifier, found keyword
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
diff --git a/tests/ui/parser/mismatched-braces/missing-close-brace-in-trait.rs b/tests/ui/parser/mismatched-braces/missing-close-brace-in-trait.rs
index b6932deb5..a05d6aa8e 100644
--- a/tests/ui/parser/mismatched-braces/missing-close-brace-in-trait.rs
+++ b/tests/ui/parser/mismatched-braces/missing-close-brace-in-trait.rs
@@ -2,10 +2,9 @@ trait T {
fn foo(&self);
pub(crate) struct Bar<T>();
-//~^ ERROR struct is not supported in `trait`s or `impl`s
impl T for Bar<usize> {
-//~^ ERROR implementation is not supported in `trait`s or `impl`s
+
fn foo(&self) {}
}
diff --git a/tests/ui/parser/mismatched-braces/missing-close-brace-in-trait.stderr b/tests/ui/parser/mismatched-braces/missing-close-brace-in-trait.stderr
index 7c6254356..7418dd64c 100644
--- a/tests/ui/parser/mismatched-braces/missing-close-brace-in-trait.stderr
+++ b/tests/ui/parser/mismatched-braces/missing-close-brace-in-trait.stderr
@@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
- --> $DIR/missing-close-brace-in-trait.rs:12:65
+ --> $DIR/missing-close-brace-in-trait.rs:11:65
|
LL | trait T {
| - unclosed delimiter
@@ -7,21 +7,5 @@ LL | trait T {
LL | fn main() {}
| ^
-error: struct is not supported in `trait`s or `impl`s
- --> $DIR/missing-close-brace-in-trait.rs:4:1
- |
-LL | pub(crate) struct Bar<T>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = help: consider moving the struct out to a nearby module scope
-
-error: implementation is not supported in `trait`s or `impl`s
- --> $DIR/missing-close-brace-in-trait.rs:7:1
- |
-LL | impl T for Bar<usize> {
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = help: consider moving the implementation out to a nearby module scope
-
-error: aborting due to 3 previous errors
+error: aborting due to previous error