fn enter_opt<'a, 'p, 'blk, 'tcx>(
             bcx: Block<'blk, 'tcx>,
             _: ast::NodeId,
             dm: &DefMap,
             m: &[Match<'a, 'p, 'blk, 'tcx>],
             opt: &Opt,
             col: uint,
             variant_size: uint,
             val: ValueRef)
             -> Vec<Match<'a, 'p, 'blk, 'tcx>> {
    debug!("enter_opt(bcx={}, m={}, opt={:?}, col={}, val={})",
           bcx.to_str(),
           m.repr(bcx.tcx()),
           *opt,
           col,
           bcx.val_to_string(val));
    let _indenter = indenter();

    let ctor = match opt {
        &ConstantValue(ConstantExpr(expr), _) => check_match::ConstantValue(
            const_eval::eval_const_expr(bcx.tcx(), &*expr)
        ),
        &ConstantRange(ConstantExpr(lo), ConstantExpr(hi), _) => check_match::ConstantRange(
            const_eval::eval_const_expr(bcx.tcx(), &*lo),
            const_eval::eval_const_expr(bcx.tcx(), &*hi)
        ),
        &SliceLengthEqual(n, _) =>
            check_match::Slice(n),
        &SliceLengthGreaterOrEqual(before, after, _) =>
            check_match::SliceWithSubslice(before, after),
        &Variant(_, _, def_id, _) =>
            check_match::Constructor::Variant(def_id)
    };

    let param_env = ty::empty_parameter_environment(bcx.tcx());
    let mcx = check_match::MatchCheckCtxt {
        tcx: bcx.tcx(),
        param_env: param_env,
    };
    enter_match(bcx, dm, m, col, val, |pats|
        check_match::specialize(&mcx, &pats[..], &ctor, col, variant_size)
    )
}
/// The above is now outdated in that enter_match() now takes a function that
/// takes the complete row of patterns rather than just the first one.
/// Also, most of the enter_() family functions have been unified with
/// the check_match specialization step.
The above is now outdated in that enter_match() now takes a function that
takes the complete row of patterns rather than just the first one.
Also, most of the enter_() family functions have been unified with
the check_match specialization step.
The above is now outdated in that enter_match () now takes a function that takes the complete row of patterns rather than just the first one . Also most of the enter_ () family functions have been unified with the check_match specialization step .
fn enter_opt<'a, 'p, 'blk, 'tcx>(
             bcx: Block<'blk, 'tcx>,
             _: ast::NodeId,
             dm: &DefMap,
             m: &[Match<'a, 'p, 'blk, 'tcx>],
             opt: &Opt,
             col: uint,
             variant_size: uint,
             val: ValueRef)
             -> Vec<Match<'a, 'p, 'blk, 'tcx>> {
    debug!("enter_opt(bcx={}, m={}, opt={:?}, col={}, val={})",
           bcx.to_str(),
           m.repr(bcx.tcx()),
           *opt,
           col,
           bcx.val_to_string(val));
    let _indenter = indenter();
    let ctor = match opt {
        &ConstantValue(ConstantExpr(expr), _) => check_match::ConstantValue(
            const_eval::eval_const_expr(bcx.tcx(), &*expr)
        ),
        &ConstantRange(ConstantExpr(lo), ConstantExpr(hi), _) => check_match::ConstantRange(
            const_eval::eval_const_expr(bcx.tcx(), &*lo),
            const_eval::eval_const_expr(bcx.tcx(), &*hi)
        ),
        &SliceLengthEqual(n, _) =>
            check_match::Slice(n),
        &SliceLengthGreaterOrEqual(before, after, _) =>
            check_match::SliceWithSubslice(before, after),
        &Variant(_, _, def_id, _) =>
            check_match::Constructor::Variant(def_id)
    };
    let param_env = ty::empty_parameter_environment(bcx.tcx());
    let mcx = check_match::MatchCheckCtxt {
        tcx: bcx.tcx(),
        param_env: param_env,
    };
    enter_match(bcx, dm, m, col, val, |pats|
        check_match::specialize(&mcx, &pats[..], &ctor, col, variant_size)
    )
}
fn enter_opt < ' a , ' p , ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > , _ : ast :: NodeId , dm : & DefMap , m : & [ Match < ' a , ' p , ' blk , ' tcx > ] , opt : & Opt , col : uint , variant_size : uint , val : ValueRef ) -> Vec < Match < ' a , ' p , ' blk , ' tcx > > { debug ! ( " " bcx to_str ( ) m repr ( bcx tcx ( ) ) opt col bcx val_to_string ( val ) ) ; let _indenter = indenter ( ) ; let ctor = match opt { & ConstantValue ( ConstantExpr ( expr ) , _ ) => check_match :: ConstantValue ( const_eval :: eval_const_expr ( bcx . tcx ( ) , & * expr ) ) , & ConstantRange ( ConstantExpr ( lo ) , ConstantExpr ( hi ) , _ ) => check_match :: ConstantRange ( const_eval :: eval_const_expr ( bcx . tcx ( ) , & * lo ) , const_eval :: eval_const_expr ( bcx . tcx ( ) , & * hi ) ) , & SliceLengthEqual ( n , _ ) => check_match :: Slice ( n ) , & SliceLengthGreaterOrEqual ( before , after , _ ) => check_match :: SliceWithSubslice ( before , after ) , & Variant ( _ , _ , def_id , _ ) => check_match :: Constructor :: Variant ( def_id ) } ; let param_env = ty :: empty_parameter_environment ( bcx . tcx ( ) ) ; let mcx = check_match :: MatchCheckCtxt { tcx : bcx . tcx ( ) , param_env : param_env , } ; enter_match ( bcx , dm , m , col , val , | pats | check_match :: specialize ( & mcx , & pats [ .. ] , & ctor , col , variant_size ) ) }
The above is now outdated in that enter_match() now takes a function that
takes the complete row of patterns rather than just the first one.
The above is now outdated in that enter_match () now takes a function that takes the complete row of patterns rather than just the first one .
bcx
ast::NodeId
dm
&DefMap
m
&[Match<'a, 'p, 'blk, 'tcx>]
opt
&Opt
col
uint
variant_size
uint
val
ValueRef
bcx
ast::NodeId
dm
&DefMap
m
&[Match<'a, 'p, 'blk, 'tcx>]
opt
&Opt
col
uint
variant_size
uint
val
ValueRef