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>2017-03-11 15:50:33 +0000
committerbors <bors@rust-lang.org>2017-03-11 15:50:33 +0000
commit4b1dfbd86c5ab59a856e191556bf1c8f7e103f60 (patch)
treea69c08cc00c42afe629a01f13152aa1d3cc237a8 /src/libstd/sys/unix/stack_overflow.rs
parent5d0be0d72a8fe87c1a038f014beb7f64ba249b29 (diff)
parent4d5441fe3dc0869b3f6637e6320c9091b8d9efa0 (diff)
downloadrust-4b1dfbd86c5ab59a856e191556bf1c8f7e103f60.tar.gz
rust-4b1dfbd86c5ab59a856e191556bf1c8f7e103f60.zip
Auto merge of #40308 - nikomatsakis:incr-comp-isolate-task, r=mw
first pass at isolating dep-graph tasks

This intentionally leaves `DepGraph::in_task()`, the more common form,
alone. Eventually all uses of `DepGraph::in_task()` should be ported
to `with_task()`, but I wanted to start with a smaller subset.

I also used `AssertDepGraphSafe` on the closures that are found in
trans. This is because the types there are non-trivial and I wanted to
lay down the mechanism and come back to the more subtle cases.

The current approach taken in this PR has a downside: it is necessary
to manually "reify" fn types into fn pointers when starting a task,
like so:

    dep_graph.with_task(..., task_fn as fn(_))

this is because `with_task` takes some type `T` that implements
`DepGraphTask` rather than taking a `fn()` type directly. *This* is so
that we can accept closure and also so that we can accept fns with
multiple arities. I am not sure this is the right approach.

Originally I wanted to use closures bound by an auto trait, but that
approach has some limitations:

- the trait cannot have a `read()` method; since the current method
  is unused, that may not be a problem.
- more importantly, we would want the auto trait to be "undefined" for all types
  *by default* -- that is, this use case doesn't really fit the typical
  auto trait scenario. For example, imagine that there is a `u32` loaded
  out of a `hir::Node` -- we don't really want to be passing that
  `u32` into the task!
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions