Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 39a1bcf

Browse files
Unrolled build for rust-lang#125236
Rollup merge of rust-lang#125236 - dtolnay:expandtest, r=nnethercote Add tests for `-Zunpretty=expanded` ported from stringify's tests This PR adds a new set of tests for the AST pretty-printer. Previously, pretty-printer edge cases were tested by way of `stringify!` in [tests/ui/macros/stringify.rs](https://github.com/rust-lang/rust/blob/1.78.0/tests/ui/macros/stringify.rs), such as the tests added by rust-lang@419b269 and rust-lang@527e2ea. Those tests will no longer provide effective coverage of the AST pretty-printer after rust-lang#124141. `Nonterminal` and `TokenKind::Interpolated` are being removed, and a consequence is that `stringify!` will perform token stream pretty printing, instead of AST pretty printing, in all of the `stringify!` cases including $:expr and all other interpolations. This PR adds 2 new ui tests with `compile-flags: -Zunpretty=expanded`: - **tests/ui/unpretty/expanded-exhaustive.rs** — this test aims for exhaustive coverage of all the variants of `ExprKind`, `ItemKind`, `PatKind`, `StmtKind`, `TyKind`, and `VisibilityKind`. Some parts could use being fleshed out further, but the current state is roughly on par with what exists in the old stringify-based tests. - **tests/ui/unpretty/expanded-interpolation.rs** — this test covers tricky macro metavariable edge cases that require the AST pretty printer to synthesize parentheses in order for the printed code to be valid Rust syntax. r? `@nnethercote`
2 parents eb1a5c9 + 3e05be5 commit 39a1bcf

File tree

10 files changed

+1807
-51
lines changed

10 files changed

+1807
-51
lines changed

‎src/tools/tidy/src/issues.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2915,7 +2915,6 @@ ui/macros/issue-95267.rs
29152915
ui/macros/issue-95533.rs
29162916
ui/macros/issue-98466-allow.rs
29172917
ui/macros/issue-98466.rs
2918-
ui/macros/issue-98790.rs
29192918
ui/macros/issue-99261.rs
29202919
ui/macros/issue-99265.rs
29212920
ui/macros/issue-99907.rs

‎src/tools/tidy/src/ui_tests.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const EXTENSION_EXCEPTION_PATHS: &[&str] = &[
4141
"tests/ui/macros/not-utf8.bin", // testing including data with the include macros
4242
"tests/ui/macros/syntax-extension-source-utils-files/includeme.fragment", // more include
4343
"tests/ui/proc-macro/auxiliary/included-file.txt", // more include
44+
"tests/ui/unpretty/auxiliary/data.txt", // more include
4445
"tests/ui/invalid/foo.natvis.xml", // sample debugger visualizer
4546
"tests/ui/sanitizer/dataflow-abilist.txt", // dataflow sanitizer ABI list file
4647
"tests/ui/shell-argfiles/shell-argfiles.args", // passing args via a file

‎tests/ui/macros/issue-98790.rs‎

Lines changed: 0 additions & 24 deletions
This file was deleted.

‎tests/ui/unpretty/auxiliary/data.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
data for include_bytes in ../expanded-exhaustive.rs

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /