fn compute_field_path<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
                                                name: &mut String,
                                                layout: TyLayout<'tcx>,
                                                offset: Size,
                                                size: Size) {
                    for i in 0..layout.fields.count() {
                        let field_offset = layout.fields.offset(i);
                        if field_offset > offset {
                            continue;
                        }
                        let inner_offset = offset - field_offset;
                        let field = layout.field(cx, i);
                        if inner_offset + size <= field.size {
                            write!(name, "{}$", i).unwrap();
                            compute_field_path(cx, name, field, inner_offset, size);
                        }
                    }
                }
// HACK(eddyb) the debuggers should just handle offset+size
// of discriminant instead of us having to recover its path.
// Right now it's not even going to work for `niche_start > 0`,
// and for multiple niche variants it only supports the first.
HACK(eddyb) the debuggers should just handle offset+size
of discriminant instead of us having to recover its path.
Right now it's not even going to work for `niche_start > 0`,
and for multiple niche variants it only supports the first.
HACK ( eddyb ) the debuggers should just handle offset + size of discriminant instead of us having to recover its path . Right now it ' s not even going to work for ` niche_start > 0 ` and for multiple niche variants it only supports the first .
fn compute_field_path<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
                                                name: &mut String,
                                                layout: TyLayout<'tcx>,
                                                offset: Size,
                                                size: Size) {
                    for i in 0..layout.fields.count() {
                        let field_offset = layout.fields.offset(i);
                        if field_offset > offset {
                            continue;
                        }
                        let inner_offset = offset - field_offset;
                        let field = layout.field(cx, i);
                        if inner_offset + size <= field.size {
                            write!(name, "{}$", i).unwrap();
                            compute_field_path(cx, name, field, inner_offset, size);
                        }
                    }
                }
fn compute_field_path < ' a , ' tcx > ( cx : & CodegenCx < ' a , ' tcx > , name : & mut String , layout : TyLayout < ' tcx > , offset : Size , size : Size ) { for i in 0 .. layout . fields . count ( ) { let field_offset = layout . fields . offset ( i ) ; if field_offset > offset { continue ; } let inner_offset = offset - field_offset ; let field = layout . field ( cx , i ) ; if inner_offset + size <= field . size { write ! ( name " " i ) . unwrap ( ) ; compute_field_path ( cx , name , field , inner_offset , size ) ; } } }
HACK(eddyb) the debuggers should just handle offset+size
of discriminant instead of us having to recover its path.
HACK ( eddyb ) the debuggers should just handle offset + size of discriminant instead of us having to recover its path .
cx
&CodegenCx<'a, 'tcx>
name
&mut String
layout
TyLayout<'tcx>
offset
Size
size
Size
cx
&CodegenCx<'a, 'tcx>
name
&mut String
layout
TyLayout<'tcx>
offset
Size
size
Size