Skip to content

Pretty-printer is still adding extra whitespace in places #850

Closed

Description

@brson

Diffs from a recent reformat:

     item_obj(_obj, [ty_param], /* constructor id */node_id);
     item_res(_fn,
-              /* dtor */
+
+             /* dtor */
              node_id,
-              /* dtor id */
+
+             /* dtor id */
              [ty_param],
     noreturn; // functions with return type _|_ that always
               // raise an error or exit (i.e. never return to the caller)

+
     alt c {


+
       // One-byte tokens.
       '?' {
         rdr.bump();
@@ -400,6 +401,7 @@ fn next_token_inner(rdr: &reader) -> token::token {
       }


+
       // Multi-byte tokens.
       '=' {

Activity

  1. brson commented on Aug 21, 2011

    @brson
    ContributorAuthor

    At least one of these is the same issue as #751

  2. catamorphism commented on Jul 26, 2012

    @catamorphism
    Contributor

    Reproduced with this test case:

    type _obj = int;
    type ty_param = int;
    type node_id = int;
    type _fn = int;
    
    enum foo {
      item_obj(_obj, ~[ty_param], /* constructor id */node_id),
      item_res(_fn,
                  /* dtor */
                  node_id,
                  /* dtor id */
                  ~[ty_param]
               )
    }
    

    I suspect these are all the same issue as #751, as all of them involve extra blank lines getting added before comments.

  3. pnkfelix commented on Aug 22, 2013

    @pnkfelix
    Contributor

    linking to the metabug #3195 so that this ticket gets an entry (with status) in its comments area.

  4. flaper87 commented on Jan 29, 2014

    @flaper87
    Contributor

    still reproducible. Triaged

  5. brson commented on Jan 13, 2015

    @brson
    ContributorAuthor

    Nobody is ever going to fix the current pretty-printer. Closing.

  6. added a commit that references this issue on Dec 12, 2017
  7. added a commit that references this issue on Jun 4, 2024
  8. added a commit that references this issue on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-prettyArea: Pretty printing (including `-Z unpretty`)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions