Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print token::Interpolated with token stream pretty printing. #125174

Merged
merged 1 commit into from
Jun 11, 2024

Commits on Jun 5, 2024

  1. Print token::Interpolated with token stream pretty printing.

    Instead of using AST pretty printing.
    
    This is a step towards removing `token::Interpolated`, which will
    eventually (in rust-lang#124141) be replaced with a token stream within invisible
    delimiters.
    
    This changes (improves) the output of the `stringify!` macro in some
    cases. This is allowed. As the `stringify!` docs say: "Note that the
    expanded results of the input tokens may change in the future. You
    should be careful if you rely on the output."
    
    Test changes:
    
    - tests/ui/macros/stringify.rs: this used to test both token stream
      pretty printing and AST pretty printing via different ways of invoking
      of `stringify!` (i.e. `$expr` vs `$tt`). But those two different
      invocations now give the same result, which is a nice consistency
      improvement. This removes the need for all the `c2*` macros. The AST
      pretty printer now has more thorough testing thanks to rust-lang#125236.
    
    - tests/ui/proc-macro/*: minor improvements where small differences
      between `INPUT (DISPLAY)` output and `DEEP-RE-COLLECTED (DISPLAY)`
      output disappear.
    nnethercote committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    f7d49fd View commit details
    Browse the repository at this point in the history