Commit dc0131a
committed
tests: ensure the guards cannot be accessed
The guards created in order to drop already initialized fields correctly
when the initializer errors or panics must not be accessible by user
controlled code. (They could for example `mem::forget` the guard and
thus prevent its normal function, making the initializer macros
unsound.) Thus add a test to ensure that this is true.
Signed-off-by: Benno Lossin <lossin@kernel.org>1 parent a693e45 commit dc0131a
File tree
2 files changed
+19
-0
lines changed- tests/ui/compile-fail/init
2 files changed
+19
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments