Skip to content

Commit d33e317

Browse files
[debuginfo] Fix and unify handling of fat pointers in debuginfo: Change doc comment so it is not interpreted as doc-test.
1 parent 3c61d2e commit d33e317

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -572,21 +572,21 @@ fn dyn_type_metadata<'ll, 'tcx>(
572572

573573
/// Create debuginfo for `[T]` and `str`. These are unsized.
574574
///
575-
/// Note: We currently emit just emit the debuginfo for the element type here
576-
/// (i.e. `T` for slices and `u8` for `str`), so that we end up with
577-
/// `*const T` for the `data_ptr` field of the corresponding fat-pointer
578-
/// debuginfo of `&[T]`.
575+
/// NOTE: We currently emit just emit the debuginfo for the element type here
576+
/// (i.e. `T` for slices and `u8` for `str`), so that we end up with
577+
/// `*const T` for the `data_ptr` field of the corresponding fat-pointer
578+
/// debuginfo of `&[T]`.
579579
///
580-
/// It would be preferable and more accurate if we emitted a DIArray of T
581-
/// without an upper bound instead. That is, LLVM already supports emitting
582-
/// debuginfo of arrays of unknown size. But GDB currently seems to end up
583-
/// in an infinite loop when confronted with such a type.
580+
/// It would be preferable and more accurate if we emitted a DIArray of T
581+
/// without an upper bound instead. That is, LLVM already supports emitting
582+
/// debuginfo of arrays of unknown size. But GDB currently seems to end up
583+
/// in an infinite loop when confronted with such a type.
584584
///
585-
/// As a side effect of the current encoding every instance of a type like
586-
/// `struct Foo { unsized_field: [u8] }` will look like
587-
/// `struct Foo { unsized_field: u8 }` in debuginfo. If the length of the
588-
/// slice is zero, then accessing `unsized_field` in the debugger would
589-
/// result in an out-of-bounds access.
585+
/// As a side effect of the current encoding every instance of a type like
586+
/// `struct Foo { unsized_field: [u8] }` will look like
587+
/// `struct Foo { unsized_field: u8 }` in debuginfo. If the length of the
588+
/// slice is zero, then accessing `unsized_field` in the debugger would
589+
/// result in an out-of-bounds access.
590590
fn slice_type_metadata<'ll, 'tcx>(
591591
cx: &CodegenCx<'ll, 'tcx>,
592592
slice_type: Ty<'tcx>,

0 commit comments

Comments
 (0)