pub fn with_anon_task<OP,R>(&self, dep_kind: DepKind, op: OP) -> (R, DepNodeIndex)
        where OP: FnOnce() -> R
    {
        if let Some(ref data) = self.data {
            let (result, open_task) = ty::tls::with_context(|icx| {
                let task = OpenTask::Anon(Lock::new(AnonOpenTask {
                    reads: SmallVec::new(),
                    read_set: Default::default(),
                }));

                let r = {
                    let icx = ty::tls::ImplicitCtxt {
                        task: &task,
                        ..icx.clone()
                    };

                    ty::tls::enter_context(&icx, |_| {
                        op()
                    })
                };

                (r, task)
            });
            let dep_node_index = data.current
                                     .borrow_mut()
                                     .pop_anon_task(dep_kind, open_task);
            (result, dep_node_index)
        } else {
            (op(), DepNodeIndex::INVALID)
        }
    }
/// Execute something within an "anonymous" task, that is, a task the
/// DepNode of which is determined by the list of inputs it read from.
Execute something within an "anonymous" task, that is, a task the
DepNode of which is determined by the list of inputs it read from.
Execute something within an " anonymous " task that is a task the DepNode of which is determined by the list of inputs it read from .
pub fn with_anon_task<OP,R>(&self, dep_kind: DepKind, op: OP) -> (R, DepNodeIndex)
        where OP: FnOnce() -> R
    {
        if let Some(ref data) = self.data {
            let (result, open_task) = ty::tls::with_context(|icx| {
                let task = OpenTask::Anon(Lock::new(AnonOpenTask {
                    reads: SmallVec::new(),
                    read_set: Default::default(),
                }));
                let r = {
                    let icx = ty::tls::ImplicitCtxt {
                        task: &task,
                        ..icx.clone()
                    };
                    ty::tls::enter_context(&icx, |_| {
                        op()
                    })
                };
                (r, task)
            });
            let dep_node_index = data.current
                                     .borrow_mut()
                                     .pop_anon_task(dep_kind, open_task);
            (result, dep_node_index)
        } else {
            (op(), DepNodeIndex::INVALID)
        }
    }
pub fn with_anon_task < OP , R > ( & self , dep_kind : DepKind , op : OP ) -> ( R , DepNodeIndex ) where OP : FnOnce ( ) -> R { if let Some ( ref data ) = self . data { let ( result , open_task ) = ty :: tls :: with_context ( | icx | { let task = OpenTask :: Anon ( Lock :: new ( AnonOpenTask { reads : SmallVec :: new ( ) , read_set : Default :: default ( ) , } ) ) ; let r = { let icx = ty :: tls :: ImplicitCtxt { task : & task , .. icx . clone ( ) } ; ty :: tls :: enter_context ( & icx , | _ | { op ( ) } ) } ; ( r , task ) } ) ; let dep_node_index = data . current . borrow_mut ( ) . pop_anon_task ( dep_kind , open_task ) ; ( result , dep_node_index ) } else { ( op ( ) , DepNodeIndex :: INVALID ) } }
Execute something within an "anonymous" task, that is, a task the
DepNode of which is determined by the list of inputs it read from.
Execute something within an " anonymous " task that is a task the DepNode of which is determined by the list of inputs it read from .
&self
dep_kind
DepKind
op
OP
&self
dep_kind
DepKind
op
OP