pub fn trans_lit_str<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                                 lit_expr: &hir::Expr,
                                 str_lit: InternedString,
                                 dest: Dest)
                                 -> Block<'blk, 'tcx> {
    debug!("trans_lit_str(lit_expr={:?}, dest={})",
           lit_expr,
           dest.to_string(bcx.ccx()));

    match dest {
        Ignore => bcx,
        SaveIn(lldest) => {
            let bytes = str_lit.len();
            let llbytes = C_uint(bcx.ccx(), bytes);
            let llcstr = C_cstr(bcx.ccx(), str_lit, false);
            let llcstr = consts::ptrcast(llcstr, Type::i8p(bcx.ccx()));
            Store(bcx, llcstr, expr::get_dataptr(bcx, lldest));
            Store(bcx, llbytes, expr::get_meta(bcx, lldest));
            bcx
        }
    }
}
/// Literal strings translate to slices into static memory.  This is different from
/// trans_slice_vstore() above because it doesn't need to copy the content anywhere.
Literal strings translate to slices into static memory.  This is different from
trans_slice_vstore() above because it doesn't need to copy the content anywhere.
Literal strings translate to slices into static memory . This is different from trans_slice_vstore () above because it doesn ' t need to copy the content anywhere .
pub fn trans_lit_str<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                                 lit_expr: &hir::Expr,
                                 str_lit: InternedString,
                                 dest: Dest)
                                 -> Block<'blk, 'tcx> {
    debug!("trans_lit_str(lit_expr={:?}, dest={})",
           lit_expr,
           dest.to_string(bcx.ccx()));
    match dest {
        Ignore => bcx,
        SaveIn(lldest) => {
            let bytes = str_lit.len();
            let llbytes = C_uint(bcx.ccx(), bytes);
            let llcstr = C_cstr(bcx.ccx(), str_lit, false);
            let llcstr = consts::ptrcast(llcstr, Type::i8p(bcx.ccx()));
            Store(bcx, llcstr, expr::get_dataptr(bcx, lldest));
            Store(bcx, llbytes, expr::get_meta(bcx, lldest));
            bcx
        }
    }
}
pub fn trans_lit_str < ' blk , ' tcx > ( bcx : Block < ' blk , ' tcx > , lit_expr : & hir :: Expr , str_lit : InternedString , dest : Dest ) -> Block < ' blk , ' tcx > { debug ! ( " " lit_expr dest to_string ( bcx ccx ( ) ) ) ; match dest { Ignore => bcx , SaveIn ( lldest ) => { let bytes = str_lit . len ( ) ; let llbytes = C_uint ( bcx . ccx ( ) , bytes ) ; let llcstr = C_cstr ( bcx . ccx ( ) , str_lit , false ) ; let llcstr = consts :: ptrcast ( llcstr , Type :: i8p ( bcx . ccx ( ) ) ) ; Store ( bcx , llcstr , expr :: get_dataptr ( bcx , lldest ) ) ; Store ( bcx , llbytes , expr :: get_meta ( bcx , lldest ) ) ; bcx } } }
Literal strings translate to slices into static memory.
Literal strings translate to slices into static memory .
bcx
Block<'blk, 'tcx>
lit_expr
&hir::Expr
str_lit
InternedString
dest
Dest
bcx
Block<'blk, 'tcx>
lit_expr
&hir::Expr
str_lit
InternedString
dest
Dest