about summary refs log tree commit diff
path: root/tests/pretty
AgeCommit message (Collapse)AuthorLines
2024-11-27Update tests to use new proc-macro headerEric Huss-6/+1
2024-10-11Add pretty, ui, and feature-gate tests for the enzyme/autodiff frontendManuel Drehwald-0/+272
2024-09-11Use `doc(hidden)` instead of `allow(missing_docs)` in the test harnessOlivier Goffart-1/+1
So that it doesn't fail with `forbid(missing_docs)` Fixes #130218
2024-09-11Use `#[doc(hidden)]` instead of `#[allow(missing_docs)]` on the const ↵Olivier Goffart-3/+3
generated for `#[test]`
2024-09-11Fix false positive with `missing_docs` and `#[test]`Olivier Goffart-0/+3
Since #130025, the compiler don't ignore missing_docs when compiling the tests. But there is now a false positive warning for every `#[test]` For example, this code ```rust //! Crate docs fn just_a_test() {} ``` Would emit this warning when running `cargo test` ``` warning: missing documentation for a constant --> src/lib.rs:5:1 | 4 | #[test] | ------- in this procedural macro expansion 5 | fn just_a_test() {} | ^^^^^^^^^^^^^^^^^^^ ```
2024-09-09Allow `missing_docs` lint on the generated test harnessUrgau-0/+1
2024-08-18stabilize raw_ref_opRalf Jung-1/+0
2024-07-06Mark format! with must_use hintlukas-10/+11
2024-06-07Auto merge of #125918 - oli-obk:const_block_ice, r=compiler-errorsbors-1/+6
Revert: create const block bodies in typeck via query feeding as per the discussion in https://github.com/rust-lang/rust/pull/125806#discussion_r1622563948 It was a mistake to try to shoehorn const blocks and some specific anon consts into the same box and feed them during typeck. It turned out not simplifying anything (my hope was that we could feed `type_of` to start avoiding the huge HIR matcher, but that didn't work out), but instead making a few things more fragile. reverts the const-block-specific parts of https://github.com/rust-lang/rust/pull/124650 `@bors` rollup=never had a small perf impact previously fixes https://github.com/rust-lang/rust/issues/125846 r? `@compiler-errors`
2024-06-07Revert "Create const block DefIds in typeck instead of ast lowering"Oli Scherer-1/+6
This reverts commit ddc5f9b6c1f21da5d4596bf7980185a00984ac42.
2024-06-06Revert "Rollup merge of #124099 - voidc:disallow-ambiguous-expr-attrs, ↵Rémy Rakic-15/+15
r=davidtwco" This reverts commit 57dad1d75e562ff73051c1c43b07eaf65c7dbd74, reversing changes made to 36316df9fe6c3e246153fe6e78967643cf08c148.
2024-06-04Handle safety keyword for extern block inner itemsSantiago Pastorino-1/+1
2024-05-28Create const block DefIds in typeck instead of ast loweringOli Scherer-6/+1
2024-05-24Move the checks for Arguments constructors to inline constBen Kimock-1/+1
2024-05-20hir pretty: fix block indentNilstrieb-23/+23
2024-04-29Rollup merge of #124269 - scrabsha:sasha/fix-124206, r=dtolnay许杰友 Jieyou Xu (Joe)-0/+68
Pretty-print parenthesis around binary in postfix match Fixes #124206.
2024-04-29Pretty-print parenthesis around binary in postfix matchSasha Pourcelot-0/+68
Signed-off-by: Sasha Pourcelot <sasha.pourcelot@protonmail.com>
2024-04-24Fix tests and blessGary Guo-1/+0
2024-04-18Disallow ambiguous attributes on expressionsDominik Stolz-15/+15
2024-03-06Add MatchKind member to the Match expr for pretty printing & fmtRoss Smyth-0/+21
2024-02-22Re-bless tests/pretty许杰友 Jieyou Xu (Joe)-38/+38
2024-02-22[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives许杰友 Jieyou Xu (Joe)-115/+115
2024-01-31Auto merge of #120227 - nnethercote:further-improve-space_between, ↵bors-7/+7
r=petrochenkov Further improve `space_between` `space_between` is used by `print_tts` to decide when spaces should be put between tokens. This PR improves it in two ways: - avoid unnecessary spaces before semicolons, and - don't omit some necessary spaces before/after some punctuation symbols. r? `@petrochenkov`
2024-01-22Don't insert spaces before most semicolons in `print_tts`.Nicholas Nethercote-7/+7
This gives better output for code produced by proc macros.
2024-01-21Add `#[coverage(off)]` to closures introduced by `#[test]`/`#[bench]`Zalathar-3/+6
2024-01-19Remove feature(offset_of) from testsGeorge Bateman-1/+0
2024-01-12Delegation implementation: step 1Bryanskiy-0/+25
2023-12-26Make some non-diagnostic-affecting QPath::LangItem into regular qpathsMichael Goulet-1/+1
2023-12-11Improve `print_tts` by changing `tokenstream::Spacing`.Nicholas Nethercote-1/+1
`tokenstream::Spacing` appears on all `TokenTree::Token` instances, both punct and non-punct. Its current usage: - `Joint` means "can join with the next token *and* that token is a punct". - `Alone` means "cannot join with the next token *or* can join with the next token but that token is not a punct". The fact that `Alone` is used for two different cases is awkward. This commit augments `tokenstream::Spacing` with a new variant `JointHidden`, resulting in: - `Joint` means "can join with the next token *and* that token is a punct". - `JointHidden` means "can join with the next token *and* that token is a not a punct". - `Alone` means "cannot join with the next token". This *drastically* improves the output of `print_tts`. For example, this: ``` stringify!(let a: Vec<u32> = vec![];) ``` currently produces this string: ``` let a : Vec < u32 > = vec! [] ; ``` With this PR, it now produces this string: ``` let a: Vec<u32> = vec![] ; ``` (The space after the `]` is because `TokenTree::Delimited` currently doesn't have spacing information. The subsequent commit fixes this.) The new `print_tts` doesn't replicate original code perfectly. E.g. multiple space characters will be condensed into a single space character. But it's much improved. `print_tts` still produces the old, uglier output for code produced by proc macros. Because we have to translate the generated code from `proc_macro::Spacing` to the more expressive `token::Spacing`, which results in too much `proc_macro::Along` usage and no `proc_macro::JointHidden` usage. So `space_between` still exists and is used by `print_tts` in conjunction with the `Spacing` field. This change will also help with the removal of `Token::Interpolated`. Currently interpolated tokens are pretty-printed nicely via AST pretty printing. `Token::Interpolated` removal will mean they get printed with `print_tts`. Without this change, that would result in much uglier output for code produced by decl macro expansions. With this change, AST pretty printing and `print_tts` produce similar results. The commit also tweaks the comments on `proc_macro::Spacing`. In particular, it refers to "compound tokens" rather than "multi-char operators" because lifetimes aren't operators.
2023-10-25Remove unnecessary CVarArgs name skipping logicDaniPopes-1/+1
2023-10-25Print variadic argument pattern in HIR pretty printerDaniPopes-0/+28
2023-10-16Preserve unicode escapes in format string literals when pretty-printing ASTPaul Gey-0/+31
2023-09-08Rework no_coverage to coverage(off)Andy Caldwell-1/+1
2023-05-01Rollup merge of #111042 - Zalathar:no-coverage, r=wesleywiserMatthias Krüger-0/+1
Add `#[no_coverage]` to the test harness's `fn main` There are two main motivations for adding `#[no_coverage]` to the test harness's entry point: - The entry point is trivial compiler-generated code that doesn't correspond to user source, and it always runs, so there's no value in instrumenting it for coverage. - Because it has dummy spans, it causes the instrumentor implementation to emit invalid coverage mappings that confuse `llvm-cov` and result in strange coverage reports. Fixes #110749.
2023-05-01Add `#[no_coverage]` to the test harness's `fn main`Zalathar-0/+1
2023-04-30Close parentheses for `offset_of` in AST pretty printingNilstrieb-0/+4
HIR pretty printing already handles it correctly.
2023-03-20Auto merge of #108148 - parthopdas:master, r=oli-obkbors-4/+21
Implementing "<test_binary> --list --format json" for use by IDE test explorers / runners Fixes #107307 PR 1 of 2 - wiring up just the new information + implement the command line changes i.e. --format json + tests upcoming: PR 2 of 2 - clean up "#[cfg(not(bootstrap))]" from PR 1 As per the discussions on - MCP: https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Implementing.20.22.3Ctest_binary.3E.20--list.20--form.E2.80.A6.20compiler-team.23592/near/328747548 - preRFC: https://internals.rust-lang.org/t/pre-rfc-implementing-test-binary-list-format-json-for-use-by-ide-test-explorers-runners/18308 - FYI on Discord: https://discord.com/channels/442252698964721669/459149169546887178/1075581549409484820
2023-03-16Bless pretty tests.Mara Bos-6/+4
2023-03-15Implementing "<test_binary> --list --format json" #107307 #49359Partha P. Das-4/+21
2023-03-12Remove uses of `box_syntax` in rustc and toolsclubby789-3/+0
2023-01-29Update tests.Mara Bos-3/+4
2023-01-12Bless pretty tests.Mara Bos-4/+2
2023-01-11Change `src/test` to `tests` in source files, fix tidy and testsAlbert Larsan-2/+2
2023-01-11Move /src/test to /testsAlbert Larsan-0/+1961