• T
    Support unchecked blocks · f841e894
    Tim Chevalier 提交于
    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.
    f841e894
typeck.rs 100.2 KB