Skip to content

tracking issue for debug_non_exhaustive feature #67364

Closed
@richard-uk1

Description

@richard-uk1

Feature gate: #![feature(debug_non_exhaustive)]

This is a tracking issue for adding the ability to add an ellipsis to the end of the Debug representation of a struct, to indicate that the struct has more fields, but that these fields are not displayable. This involves adding the finish_non_exhaustive method to DebugStruct, that produces output like

Name { field1: value1, .. }

where the .. indicate that there are more hidden fields.

Public API

// core::fmt

impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
    pub fn finish_non_exhaustive(&mut self) -> fmt::Result;
}

Steps / History

Unresolved Questions

  • Should this method be implemented for DebugTuple and DebugMap as well?
    • I would probably say "no" since I can't think of any use cases for them. They could always be added later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-fmtArea: `core::fmt`B-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-SmallLibs issues that are considered "small" or self-containedLibs-TrackedLibs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions