Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Oct 29, 2024
1 parent 0ed660b commit dc32880
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions charon/tests/ui/pointers-in-consts.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error: Unsupported constant: `ConstantExprKind::Cast {..}`
--> tests/ui/pointers-in-consts.rs:6:9
|
6 | DISGUISED_INT => {}
| ^^^^^^^^^^^^^

error: aborting due to 1 previous error

ERROR Compilation encountered 1 errors
9 changes: 9 additions & 0 deletions charon/tests/ui/pointers-in-consts.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ known-failure
const DISGUISED_INT: *const () = 42 as _;

fn bar() {
match 43 as *const () {
DISGUISED_INT => {}
_ => {}
}
}

0 comments on commit dc32880

Please sign in to comment.