auto merge of #6302 : nikomatsakis/rust/issue-6141-leaking-owned-fn, r=brson
When autoborrowing a fn in trans, adjust the type of the datum to be `&fn`. Fixes #6141. r? @brson
This commit is contained in:
commit
d35eb6e1ee
6 changed files with 71 additions and 54 deletions
8
src/test/run-pass/issue-6141-leaking-owned-fn.rs
Normal file
8
src/test/run-pass/issue-6141-leaking-owned-fn.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fn run(f: &fn()) {
|
||||
f()
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let f: ~fn() = || ();
|
||||
run(f);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue