pub fn sanity_check_via_rustc_peek<'a, 'tcx, O>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                                                mir: &Mir<'tcx>,
                                                id: ast::NodeId,
                                                _attributes: &[ast::Attribute],
                                                flow_ctxt: &O::Ctxt,
                                                results: &DataflowResults<O>)
    where O: BitDenotation<Ctxt=MoveDataParamEnv<'tcx>, Idx=MovePathIndex>
{
    debug!("sanity_check_via_rustc_peek id: {:?}", id);
    // FIXME: this is not DRY. Figure out way to abstract this and
    // `dataflow::build_sets`. (But note it is doing non-standard
    // stuff, so such generalization may not be realistic.)

    for bb in mir.basic_blocks().indices() {
        each_block(tcx, mir, flow_ctxt, results, bb);
    }
}
/// This function scans `mir` for all calls to the intrinsic
/// `rustc_peek` that have the expression form `rustc_peek(&expr)`.
///
/// For each such call, determines what the dataflow bit-state is for
/// the L-value corresponding to `expr`; if the bit-state is a 1, then
/// that call to `rustc_peek` is ignored by the sanity check. If the
/// bit-state is a 0, then this pass emits a error message saying
/// "rustc_peek: bit not set".
///
/// The intention is that one can write unit tests for dataflow by
/// putting code into a compile-fail test and using `rustc_peek` to
/// make observations about the results of dataflow static analyses.
///
/// (If there are any calls to `rustc_peek` that do not match the
/// expression form above, then that emits an error as well, but those
/// errors are not intended to be used for unit tests.)


For each such call, determines what the dataflow bit-state is for
the L-value corresponding to `expr`; if the bit-state is a 1, then
that call to `rustc_peek` is ignored by the sanity check. If the
bit-state is a 0, then this pass emits a error message saying
"rustc_peek: bit not set".

The intention is that one can write unit tests for dataflow by
putting code into a compile-fail test and using `rustc_peek` to
make observations about the results of dataflow static analyses.

(If there are any calls to `rustc_peek` that do not match the
expression form above, then that emits an error as well, but those
errors are not intended to be used for unit tests.)
For each such call determines what the dataflow bit - state is for the L - value corresponding to ` expr ` ; if the bit - state is a 1 then that call to ` rustc_peek ` is ignored by the sanity check . If the bit - state is a 0 then this pass emits a error message saying " rustc_peek : bit not set " . The intention is that one can write unit tests for dataflow by putting code into a compile - fail test and using ` rustc_peek ` to make observations about the results of dataflow static analyses . ( If there are any calls to ` rustc_peek ` that do not match the expression form above then that emits an error as well but those errors are not intended to be used for unit tests . )
pub fn sanity_check_via_rustc_peek<'a, 'tcx, O>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                                                mir: &Mir<'tcx>,
                                                id: ast::NodeId,
                                                _attributes: &[ast::Attribute],
                                                flow_ctxt: &O::Ctxt,
                                                results: &DataflowResults<O>)
    where O: BitDenotation<Ctxt=MoveDataParamEnv<'tcx>, Idx=MovePathIndex>
{
    debug!("sanity_check_via_rustc_peek id: {:?}", id);
    // FIXME: this is not DRY. Figure out way to abstract this and
    // `dataflow::build_sets`. (But note it is doing non-standard
    // stuff, so such generalization may not be realistic.)
    for bb in mir.basic_blocks().indices() {
        each_block(tcx, mir, flow_ctxt, results, bb);
    }
}
pub fn sanity_check_via_rustc_peek < ' a , ' tcx , O > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , mir : & Mir < ' tcx > , id : ast :: NodeId , _attributes : & [ ast :: Attribute ] , flow_ctxt : & O :: Ctxt , results : & DataflowResults < O > ) where O : BitDenotation < Ctxt = MoveDataParamEnv < ' tcx > , Idx = MovePathIndex > { debug ! ( " " id ) ; // FIXME: this is not DRY. Figure out way to abstract this and // `dataflow::build_sets`. (But note it is doing non-standard // stuff, so such generalization may not be realistic.) for bb in mir . basic_blocks ( ) . indices ( ) { each_block ( tcx , mir , flow_ctxt , results , bb ) ; } }
This function scans `mir` for all calls to the intrinsic
`rustc_peek` that have the expression form `rustc_peek(&expr)`.
This function scans ` mir ` for all calls to the intrinsic ` rustc_peek ` that have the expression form ` rustc_peek ( &expr ) ` .
tcx
TyCtxt<'a, 'tcx, 'tcx>
mir
&Mir<'tcx>
id
ast::NodeId
_attributes
&[ast::Attribute]
flow_ctxt
&O::Ctxt
results
&DataflowResults<O>
tcx
TyCtxt<'a, 'tcx, 'tcx>
mir
&Mir<'tcx>
id
ast::NodeId
_attributes
&[ast::Attribute]
flow_ctxt
&O::Ctxt
results
&DataflowResults<O>