-
Notifications
You must be signed in to change notification settings - Fork 192
Open
Description
Summary
When trying to add a reproducer / regression test for #2886, the test case should fail with a parsing error, similar to what is found in https://godbolt.org/z/WorW4oqG4.
Reproducer
I tried this code (in gcc/testsuite/rust/compile/parens.rs):
pub fn ret_parens(x: i32) -> i32 {
((x+1))
}
pub fn arg_ret_parens((x): (i32)) -> (i32) {
((x+1))
}
pub fn ret_rpit_parens2(x: i32) -> (i32) {
((x+1))
}
pub fn ret_parens3(x: i32) -> i32 {
((x+1))
}Related: #2886
Does the code make use of any (1.49) nightly feature ?
- Nightly
Godbolt link
https://godbolt.org/z/WorW4oqG4
Actual behavior
The test passes, which it should only after a proper fix.
Expected behavior
The test should fail to compile with the following errors:
<source>:7:21: error: Failed to resolve trait by looking up hir node
7 | fn increment1((x): (i32)) -> i32{
| ^~~
<source>:8:7: error: cannot apply operator '+' to types dyn [] and <integer>
8 | ((x+1))
| ^
<source>:11:27: error: Failed to resolve trait by looking up hir node
11 | fn increment2(x: i32) -> (i32) {
| ^~~
Compiler returned: 1
GCC Version
GCC 15.2.1, GCCRS c742973
Metadata
Metadata
Assignees
Labels
No labels