Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions gcc/testsuite/rust/compile/issue-4148.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// { dg-excess-errors "warnings" }

// TODO: all `xfail` conditions should be changed to `target` once the ICE in #4148 is resolved

pub fn ret_parens(x: i32) -> i32 {
// { dg-warning "unnecessary parentheses around block return value" "#4148" { xfail *-*-* } .+1 }
((x+1))
}

// { dg-warning "unnecessary parentheses around type" "#4148" { xfail *-*-* } .+1 }
// { dg-warning "unnecessary parentheses around pattern" "#4148" { xfail *-*-* } .+1 }
pub fn arg_ret_parens((x): (i32)) -> (i32) {
// { dg-warning "unnecessary parentheses around block return value" "#4148" { xfail *-*-* } .+1 }
((x+1))
}

// { dg-warning "unnecessary parentheses around type" "#4148" { xfail *-*-* } .+1 }
pub fn ret_rpit_parens2(x: i32) -> (i32) {
// { dg-warning "unnecessary parentheses around block return value" "#4148" { xfail *-*-* } .+1 }
((x+1))
}

pub fn ret_parens3(x: i32) -> i32 {
// { dg-warning "unnecessary parentheses around block return value" "#4148" { xfail *-*-* } .+1 }
((x+1))
}
Loading