about summary refs log tree commit diff
path: root/tests/ui/parser/issues
diff options
context:
space:
mode:
authorxizheyin <xizheyin@smail.nju.edu.cn>2025-05-06 15:45:04 +0800
committerxizheyin <xizheyin@smail.nju.edu.cn>2025-05-07 22:56:14 +0800
commitb922da3586ce01a4bf174db09624a1d0a424d5d9 (patch)
tree161065f1e979b81e232552847025831b7015d16d /tests/ui/parser/issues
parent896cf8029c6a87b920e05dd569482dad6adbddfc (diff)
downloadrust-b922da3586ce01a4bf174db09624a1d0a424d5d9.tar.gz
rust-b922da3586ce01a4bf174db09624a1d0a424d5d9.zip
Use `parse_param_general` when parsing `(T, U)->R` in `parse_path_segment`
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>

Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Diffstat (limited to 'tests/ui/parser/issues')
-rw-r--r--tests/ui/parser/issues/issue-103748-ICE-wrong-braces.rs5
-rw-r--r--tests/ui/parser/issues/issue-103748-ICE-wrong-braces.stderr39
2 files changed, 4 insertions, 40 deletions
diff --git a/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.rs b/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.rs
index 1c28c0632fa..60dd88e6540 100644
--- a/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.rs
+++ b/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.rs
@@ -2,7 +2,4 @@
 
 struct Apple((Apple, Option(Banana ? Citron)));
 //~^ ERROR invalid `?` in type
-//~| ERROR expected one of `)` or `,`, found `Citron`
-//~| ERROR cannot find type `Citron` in this scope [E0412]
-//~| ERROR parenthesized type parameters may only be used with a `Fn` trait [E0214]
-//~| ERROR `Apple` has infinite size
+//~| ERROR unexpected token: `Citron`
diff --git a/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.stderr b/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.stderr
index 97a73b4fd5e..c92535c3906 100644
--- a/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.stderr
+++ b/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.stderr
@@ -10,44 +10,11 @@ LL - struct Apple((Apple, Option(Banana ? Citron)));
 LL + struct Apple((Apple, Option(Option<Banana > Citron)));
    |
 
-error: expected one of `)` or `,`, found `Citron`
+error: unexpected token: `Citron`
   --> $DIR/issue-103748-ICE-wrong-braces.rs:3:38
    |
 LL | struct Apple((Apple, Option(Banana ? Citron)));
-   |                                     -^^^^^^ expected one of `)` or `,`
-   |                                     |
-   |                                     help: missing `,`
+   |                                      ^^^^^^ unexpected token after this
 
-error[E0412]: cannot find type `Citron` in this scope
-  --> $DIR/issue-103748-ICE-wrong-braces.rs:3:38
-   |
-LL | struct Apple((Apple, Option(Banana ? Citron)));
-   |                                      ^^^^^^ not found in this scope
-
-error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
-  --> $DIR/issue-103748-ICE-wrong-braces.rs:3:22
-   |
-LL | struct Apple((Apple, Option(Banana ? Citron)));
-   |                      ^^^^^^^^^^^^^^^^^^^^^^^ only `Fn` traits may use parentheses
-   |
-help: use angle brackets instead
-   |
-LL - struct Apple((Apple, Option(Banana ? Citron)));
-LL + struct Apple((Apple, Option<Banana ? Citron>));
-   |
-
-error[E0072]: recursive type `Apple` has infinite size
-  --> $DIR/issue-103748-ICE-wrong-braces.rs:3:1
-   |
-LL | struct Apple((Apple, Option(Banana ? Citron)));
-   | ^^^^^^^^^^^^  ----- recursive without indirection
-   |
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
-   |
-LL | struct Apple((Box<Apple>, Option(Banana ? Citron)));
-   |               ++++     +
-
-error: aborting due to 5 previous errors
+error: aborting due to 2 previous errors
 
-Some errors have detailed explanations: E0072, E0214, E0412.
-For more information about an error, try `rustc --explain E0072`.