2016-01-05 13:02:57 -05:00
|
|
|
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
|
//
|
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
2016-05-06 05:02:05 -04:00
|
|
|
pub mod debug;
|
2016-03-28 17:37:34 -04:00
|
|
|
mod dep_node;
|
2016-01-05 13:02:57 -05:00
|
|
|
mod dep_tracking_map;
|
|
|
|
|
mod edges;
|
2016-03-28 17:37:34 -04:00
|
|
|
mod graph;
|
2016-01-05 13:02:57 -05:00
|
|
|
mod query;
|
|
|
|
|
mod raii;
|
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!
2017-03-06 15:35:34 -05:00
|
|
|
mod safe;
|
2016-01-05 13:02:57 -05:00
|
|
|
|
2016-01-06 09:19:19 -05:00
|
|
|
pub use self::dep_tracking_map::{DepTrackingMap, DepTrackingMapConfig};
|
2016-03-28 17:37:34 -04:00
|
|
|
pub use self::dep_node::DepNode;
|
2016-07-21 12:33:23 -04:00
|
|
|
pub use self::dep_node::WorkProductId;
|
2016-03-28 17:37:34 -04:00
|
|
|
pub use self::graph::DepGraph;
|
2016-07-21 12:33:23 -04:00
|
|
|
pub use self::graph::WorkProduct;
|
2017-08-21 16:44:05 +02:00
|
|
|
pub use self::graph::DepNodeIndex;
|
2016-01-05 13:02:57 -05:00
|
|
|
pub use self::query::DepGraphQuery;
|
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!
2017-03-06 15:35:34 -05:00
|
|
|
pub use self::safe::AssertDepGraphSafe;
|
|
|
|
|
pub use self::safe::DepGraphSafe;
|
2017-06-02 17:36:30 +02:00
|
|
|
|
|
|
|
|
pub use self::dep_node::{DepKind, DepConstructor};
|