Skip to content

Commit

Permalink
Add a regression test for unsafe module validation
Browse files Browse the repository at this point in the history
Add a new test to check for unsafe modules during AST validation pass.

gcc/testsuite/ChangeLog:

	* rust/compile/unsafe_module.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
  • Loading branch information
P-E-P committed Nov 29, 2023
1 parent 26ac74e commit 16d0a2d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gcc/testsuite/rust/compile/unsafe_module.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
unsafe mod toto {}
// { dg-error "module cannot be declared unsafe" "" { target *-*-* } .-1 }

0 comments on commit 16d0a2d

Please sign in to comment.