Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Dependency Graph Tasks from in_tasks to with_tasks #40376

Closed
wants to merge 4 commits into from

Conversation

cramertj
Copy link
Member

@cramertj cramertj commented Mar 8, 2017

nikomatsakis and others added 4 commits March 8, 2017 09:10
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!
@eddyb
Copy link
Member

eddyb commented Mar 8, 2017

Can we wait until the next release, so we can use closure to fn pointer coercions (#39817)?

@cramertj
Copy link
Member Author

cramertj commented Mar 8, 2017

@eddyb That'd be a lot prettier, haha

@nikomatsakis nikomatsakis self-assigned this Mar 8, 2017
@nikomatsakis
Copy link
Contributor

It doesn't seem that different? we'd delete a line or two per case, basically, but we'd still wind up re-indenting and everything.

@nikomatsakis
Copy link
Contributor

Anyway by the time we land this it'll probably be the next release anyway...

@bors
Copy link
Contributor

bors commented Mar 11, 2017

☔ The latest upstream changes (presumably #40308) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis
Copy link
Contributor

So @cramertj should we close this in favor of the on-demandification approach?

@cramertj
Copy link
Member Author

@nikomatsakis Sure.

@cramertj cramertj closed this Mar 15, 2017
@cramertj cramertj deleted the incr-comp-isolate-tasks branch September 21, 2017 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants