diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2011-08-25 17:42:38 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2011-08-25 18:28:23 -0700 |
| commit | f841e894437843c142ebd7e0b0a18ed00ed52457 (patch) | |
| tree | fac7eed5de504e4246754bd7eea9a2e25c055090 /src/comp/syntax/parse/token.rs | |
| parent | d9bc3cb10c4d1e856998c8e35ce7d89e0d74f4d6 (diff) | |
| download | rust-f841e894437843c142ebd7e0b0a18ed00ed52457.tar.gz rust-f841e894437843c142ebd7e0b0a18ed00ed52457.zip | |
Support unchecked blocks
This patch supports the syntax
unchecked {
...
}
to disable purity checking within a block. Presumably it will only be
used within a declared "pure fn". However, there is no checking that it
doesn't occur elsewhere, and it would be harmless for it to do so.
I went with Lindsey's suggestion for the syntax, but it's subject to
change.
This allows you to write code that uses predicates that call arbitrary
Rust functions, but you must declare your intentions by wrapping it in
an unchecked { ... } block. The test case run-pass/unchecked-predicates.rs
demonstrates how to do that.
Diffstat (limited to 'src/comp/syntax/parse/token.rs')
0 files changed, 0 insertions, 0 deletions
