Skip to content

Commit

Permalink
Adjust error checks to match name resolution 2.0
Browse files Browse the repository at this point in the history
gcc/testsuite/ChangeLog:

	* rust/compile/bad_stmt_enums.rs: Adjust redefinition error.
	* rust/compile/bad_toplevel_enums.rs: Likewise.
	* rust/compile/redef_error1.rs: Likewise.
	* rust/compile/redef_error3.rs: Likewise.
	* rust/compile/redef_error4.rs: Likewise.
	* rust/compile/redef_error6.rs: Likewise.

Signed-off-by: Owen Avery <[email protected]>
  • Loading branch information
powerboat9 authored and CohenArthur committed Feb 27, 2024
1 parent 420d50c commit 4ef924f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions gcc/testsuite/rust/compile/bad_stmt_enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ fn main ()
Alpha { alpha: i32 },
pub Beta (u8),
pub Gamma,
Gamma { gamma: u32 } // { dg-error "redefined" }
Gamma { gamma: u32 } // { dg-error "defined multiple times" }
}

struct EE2 { }
enum EE2 { } // { dg-error "redefined" }
enum EE2 { } // { dg-error "defined multiple times" }

enum EE1
{
pub Alpha,
Beta = 41,
Beta = 42, // { dg-error "redefined" }
Beta = 42, // { dg-error "defined multiple times" }
pub Gamma = 3,
D,
}
Expand Down
6 changes: 3 additions & 3 deletions gcc/testsuite/rust/compile/bad_toplevel_enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ pub enum E
pub A { a: i32 },
B (u8),
pub C,
B // { dg-error "redefined" }
B // { dg-error "defined multiple times" }
}

enum E2 { }
struct E2 { } // { dg-error "redefined" }
struct E2 { } // { dg-error "defined multiple times" }

enum E1
{
A,
pub B = 42,
C = 3,
A { a: u8 }, // { dg-error "redefined" }
A { a: u8 }, // { dg-error "defined multiple times" }
pub D
}
2 changes: 1 addition & 1 deletion gcc/testsuite/rust/compile/redef_error1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ struct S1 {
y: f64,
}

struct S1(i32, bool); // { dg-error "redefined multiple times" }
struct S1(i32, bool); // { dg-error "defined multiple times" }

fn main() {}
2 changes: 1 addition & 1 deletion gcc/testsuite/rust/compile/redef_error3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fn test() -> bool {
true
}

fn test() -> i32 { // { dg-error "redefined multiple times" }
fn test() -> i32 { // { dg-error "defined multiple times" }
123
}

Expand Down
2 changes: 1 addition & 1 deletion gcc/testsuite/rust/compile/redef_error4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ impl Foo {
test()
}

fn test() -> bool { // { dg-error "redefined multiple times" }
fn test() -> bool { // { dg-error "defined multiple times" }
true
}
}
Expand Down
2 changes: 1 addition & 1 deletion gcc/testsuite/rust/compile/redef_error6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ impl Foo<i32> {
123
}

fn test(self) -> i32 { // { dg-error "redefined multiple times" }
fn test(self) -> i32 { // { dg-error "defined multiple times" }
self.0
}
}
Expand Down

0 comments on commit 4ef924f

Please sign in to comment.