about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-09-11 11:59:05 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-09-11 12:00:56 -0700
commita9b929dbb6b8e86ccedf96a207a6253c0af1d6c9 (patch)
tree3cbdbb65cfff89c08732d95a32da59ddc60f682d /src/rustllvm/RustWrapper.cpp
parentc8b0d667c30e0918714ac178edaed883c6a8132a (diff)
downloadrust-a9b929dbb6b8e86ccedf96a207a6253c0af1d6c9.tar.gz
rust-a9b929dbb6b8e86ccedf96a207a6253c0af1d6c9.zip
librustc: Make sure region bounds on closures outlive calls to them.
This can break code like:

    fn call_rec(f: |uint| -> uint) -> uint {
        (|x| f(x))(call_rec(f))
    }

Change this code to use a temporary instead of violating the borrow
rules:

    fn call_rec(f: |uint| -> uint) -> uint {
        let tmp = call_rec(|x| f(x)); f(tmp)
    }

Closes #17144.

[breaking-change]
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions