diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2017-03-06 15:35:34 -0500 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2017-03-10 08:15:13 -0800 |
| commit | 4b6b544d6512bfac7c926b3d93246fd14a56eb1d (patch) | |
| tree | a60887eea57ab602270514f4b2216cc011395fca /src/rustllvm/RustWrapper.cpp | |
| parent | f573db4f80c75f156df8a743f456bf087ec81dc2 (diff) | |
| download | rust-4b6b544d6512bfac7c926b3d93246fd14a56eb1d.tar.gz rust-4b6b544d6512bfac7c926b3d93246fd14a56eb1d.zip | |
isolate dep-graph tasks
A task function is now given as a `fn` pointer to ensure that it carries no state. Each fn can take two arguments, because that worked out to be convenient -- these two arguments must be of some type that is `DepGraphSafe`, a new trait that is intended to prevent "leaking" information into the task that was derived from tracked state. 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. 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/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
