fn with_new_scope<F>(cx: &CrateContext,
                     scope_span: Span,
                     scope_stack: &mut Vec<ScopeStackEntry> ,
                     scope_map: &mut NodeMap<DIScope>,
                     inner_walk: F) where
    F: FnOnce(&CrateContext, &mut Vec<ScopeStackEntry>, &mut NodeMap<DIScope>),
{
    // Create a new lexical scope and push it onto the stack
    let loc = span_start(cx, scope_span);
    let file_metadata = file_metadata(cx, &loc.file.name, &loc.file.abs_path);
    let parent_scope = scope_stack.last().unwrap().scope_metadata;

    let scope_metadata = unsafe {
        llvm::LLVMDIBuilderCreateLexicalBlock(
            DIB(cx),
            parent_scope,
            file_metadata,
            loc.line as c_uint,
            loc.col.to_usize() as c_uint)
    };

    scope_stack.push(ScopeStackEntry { scope_metadata: scope_metadata, name: None });

    inner_walk(cx, scope_stack, scope_map);

    // pop artificial scopes
    while scope_stack.last().unwrap().name.is_some() {
        scope_stack.pop();
    }

    if scope_stack.last().unwrap().scope_metadata != scope_metadata {
        span_bug!(scope_span, "debuginfo: Inconsistency in scope management.");
    }

    scope_stack.pop();
}
// local helper functions for walking the AST.
local helper functions for walking the AST.
local helper functions for walking the AST .
fn with_new_scope<F>(cx: &CrateContext,
                     scope_span: Span,
                     scope_stack: &mut Vec<ScopeStackEntry> ,
                     scope_map: &mut NodeMap<DIScope>,
                     inner_walk: F) where
    F: FnOnce(&CrateContext, &mut Vec<ScopeStackEntry>, &mut NodeMap<DIScope>),
{
    // Create a new lexical scope and push it onto the stack
    let loc = span_start(cx, scope_span);
    let file_metadata = file_metadata(cx, &loc.file.name, &loc.file.abs_path);
    let parent_scope = scope_stack.last().unwrap().scope_metadata;
    let scope_metadata = unsafe {
        llvm::LLVMDIBuilderCreateLexicalBlock(
            DIB(cx),
            parent_scope,
            file_metadata,
            loc.line as c_uint,
            loc.col.to_usize() as c_uint)
    };
    scope_stack.push(ScopeStackEntry { scope_metadata: scope_metadata, name: None });
    inner_walk(cx, scope_stack, scope_map);
    // pop artificial scopes
    while scope_stack.last().unwrap().name.is_some() {
        scope_stack.pop();
    }
    if scope_stack.last().unwrap().scope_metadata != scope_metadata {
        span_bug!(scope_span, "debuginfo: Inconsistency in scope management.");
    }
    scope_stack.pop();
}
fn with_new_scope < F > ( cx : & CrateContext , scope_span : Span , scope_stack : & mut Vec < ScopeStackEntry > , scope_map : & mut NodeMap < DIScope > , inner_walk : F ) where F : FnOnce ( & CrateContext , & mut Vec < ScopeStackEntry > , & mut NodeMap < DIScope > ) , { // Create a new lexical scope and push it onto the stack let loc = span_start ( cx , scope_span ) ; let file_metadata = file_metadata ( cx , & loc . file . name , & loc . file . abs_path ) ; let parent_scope = scope_stack . last ( ) . unwrap ( ) . scope_metadata ; let scope_metadata = unsafe { llvm :: LLVMDIBuilderCreateLexicalBlock ( DIB ( cx ) , parent_scope , file_metadata , loc . line as c_uint , loc . col . to_usize ( ) as c_uint ) } ; scope_stack . push ( ScopeStackEntry { scope_metadata : scope_metadata , name : None } ) ; inner_walk ( cx , scope_stack , scope_map ) ; // pop artificial scopes while scope_stack . last ( ) . unwrap ( ) . name . is_some ( ) { scope_stack . pop ( ) ; } if scope_stack . last ( ) . unwrap ( ) . scope_metadata != scope_metadata { span_bug ! ( scope_span " " ) ; } scope_stack . pop ( ) ; }
local helper functions for walking the AST.
local helper functions for walking the AST .
cx
&CrateContext
scope_span
Span
scope_stack
&mut Vec<ScopeStackEntry>
scope_map
&mut NodeMap<DIScope>
inner_walk
F
cx
&CrateContext
scope_span
Span
scope_stack
&mut Vec<ScopeStackEntry>
scope_map
&mut NodeMap<DIScope>
inner_walk
F