about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-01-06 09:00:57 +0000
committerbors <bors@rust-lang.org>2016-01-06 09:00:57 +0000
commit7312e0a16328e6227d7fc593176a1fd12fea4342 (patch)
treeee92eacaf624f1e6bf5b777f61ea97f96ae77325 /src/libstd/sys/unix/stack_overflow.rs
parentdc1f442634c2e37a8b80d59e27edcc24b5614d4e (diff)
parente281509dcee2ef1ca06b333b6a40e8520c642d15 (diff)
downloadrust-7312e0a16328e6227d7fc593176a1fd12fea4342.tar.gz
rust-7312e0a16328e6227d7fc593176a1fd12fea4342.zip
Auto merge of #30692 - michaelwoerister:mir-overloaded-fn-calls, r=nikomatsakis
So far, calls going through `Fn::call`, `FnMut::call_mut`, or `FnOnce::call_once` have not been translated properly into MIR:
The call `f(a, b, c)` where `f: Fn(T1, T2, T3)` would end up in MIR as:
```
call `f` with arguments  `a`, `b`, `c`
```
What we really want is:
```
call `Fn::call` with arguments  `f`, `a`, `b`, `c`
```
This PR transforms these kinds of overloaded calls during `HIR -> HAIR` translation.

What's still a bit funky is that the `Fn` traits expect arguments to be tupled but due to special handling type-checking and trans, we do not actually tuple arguments and everything still checks out fine. So, after this PR we end up with MIR containing calls where function signature and arguments seemingly don't match:
```
call Fn::call(&self, args: (T1, T2, T3)) with arguments `f`, `a`, `b`, `c`
```
instead of
```
call Fn::call(&self, args: (T1, T2, T3)) with arguments `f`, (`a`, `b`, `c`)  //  <- args tupled!
```
It would be nice if the call traits could go without special handling in MIR and later on.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions