about summary refs log tree commit diff
path: root/src/test/pretty
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-1961/+0
2022-10-24Rollup merge of #99939 - saethlin:pre-sort-tests, r=thomcc,jackh726Yuki Okushi-0/+82
Sort tests at compile time, not at startup Recently, another Miri user was trying to run `cargo miri test` on the crate `iced-x86` with `--features=code_asm,mvex`. This configuration has a startup time of ~18 minutes. That's ~18 minutes before any tests even start to run. The fact that this crate has over 26,000 tests and Miri is slow makes a lot of code which is otherwise a bit sloppy but fine into a huge runtime issue. Sorting the tests when the test harness is created instead of at startup time knocks just under 4 minutes out of those ~18 minutes. I have ways to remove most of the rest of the startup time, but this change requires coordinating changes of both the compiler and libtest, so I'm sending it separately. (except for doctests, because there is no compile-time harness)
2022-10-19Fixup a few tests needing asm supportJosh Stone-0/+1
2022-10-15pretty: fix to print some lifetimes on HIR pretty-printYutaro Ohno-0/+36
2022-09-26address reviewb-naber-1/+1
2022-09-23Bless pretty tests.Camille GILLOT-3/+3
2022-09-01Sort tests at compile time, not at startupBen Kimock-0/+82
Recently, another Miri user was trying to run `cargo miri test` on the crate `iced-x86` with `--features=code_asm,mvex`. This configuration has a startup time of ~18 minutes. That's ~18 minutes before any tests even start to run. The fact that this crate has over 26,000 tests and Miri is slow makes a lot of code which is otherwise a bit sloppy but fine into a huge runtime issue. Sorting the tests when the test harness is created instead of at startup time knocks just under 4 minutes out of those ~18 minutes. I have ways to remove most of the rest of the startup time, but this change requires coordinating changes of both the compiler and libtest, so I'm sending it separately.
2022-08-30Stabilize GATsJack Huey-2/+0
2022-06-16Add pp-exact test involving `where T:`David Tolnay-0/+3
Currently fails. ---- [pretty] src/test/pretty/where-clauses.rs stdout ---- error: pretty-printed source does not match expected source expected: ------------------------------------------ // pp-exact fn f<'a, 'b, T>(t: T) -> isize where T: 'a, 'a: 'b, T: Eq { 0 } // This is legal syntax, sometimes generated by macros. `where T: $($bound+)*` fn zero_bounds<'a, T>() where 'a:, T: {} fn main() {} ------------------------------------------ actual: ------------------------------------------ // pp-exact fn f<'a, 'b, T>(t: T) -> isize where T: 'a, 'a: 'b, T: Eq { 0 } // This is legal syntax, sometimes generated by macros. `where T: $($bound+)*` fn zero_bounds<'a, T>() where 'a, T {} fn main() {} ------------------------------------------ diff: ------------------------------------------ 3 fn f<'a, 'b, T>(t: T) -> isize where T: 'a, 'a: 'b, T: Eq { 0 } 4 5 // This is legal syntax, sometimes generated by macros. `where T: $($bound+)*` - fn zero_bounds<'a, T>() where 'a:, T: {} + fn zero_bounds<'a, T>() where 'a, T {} 7 8 fn main() {} 9
2022-05-01Auto merge of #96376 - scottmcm:do-yeet, r=oli-obkbors-0/+12
Add `do yeet` expressions to allow experimentation in nightly Two main goals for this: - Ensure that trait restructuring in https://github.com/rust-lang/rust/issues/84277#issuecomment-1066120333 doesn't accidentally close us off from the possibility of doing this in future, as sketched in https://rust-lang.github.io/rfcs/3058-try-trait-v2.html#possibilities-for-yeet - Experiment with the *existence* of syntax for this, to be able to weight the syntax-vs-library tradeoffs better than we can right now. Notably the syntax (with `do`) and name in this PR are not intended as candidates for stabilization, but they make a good v0 PR for adding this with minimal impact to compiler maintenance or priming one possible name choice over another. r? `@oli-obk` The lang `second` for doing this: https://github.com/rust-lang/lang-team/issues/160#issuecomment-1107896716 Tracking issues - Lang, https://github.com/rust-lang/rust/issues/96373 - Libs-api, https://github.com/rust-lang/rust/issues/96374
2022-04-30Add `do yeet` expressions to allow experimentation in nightlyScott McMurray-0/+12
Using an obviously-placeholder syntax. An RFC would still be needed before this could have any chance at stabilization, and it might be removed at any point. But I'd really like to have it in nightly at least to ensure it works well with try_trait_v2, especially as we refactor the traits.
2022-04-27Make [e]println macros eagerly drop temporaries (for backport)David Tolnay-1/+1
2022-04-23Bless pretty-print output.Camille GILLOT-10/+10
2022-04-16Rollup merge of #94985 - dtolnay:constattr, r=pnkfelixDylan DPC-0/+9
Parse inner attributes on inline const block According to https://github.com/rust-lang/rust/pull/84414#issuecomment-826150936, inner attributes are intended to be supported *"in all containers for statements (or some subset of statements)"*. This PR adds inner attribute parsing and pretty-printing for inline const blocks (https://github.com/rust-lang/rust/issues/76001), which contain statements just like an unsafe block or a loop body. ```rust let _ = const { #![allow(...)] let x = (); x }; ```
2022-03-15Parse inner attributes on inline const blockDavid Tolnay-0/+9
2022-03-11Format core and std macro rules, removing needless surrounding blocksDavid Tolnay-1/+1
2022-02-07Bless use tree pretty print testDavid Tolnay-5/+11
2022-02-07Add pretty printer test for use treesDavid Tolnay-0/+17
2022-02-03Bless all pretty printer tests and ui testsDavid Tolnay-11/+12
2022-01-31Bless all pretty printer tests and ui testsDavid Tolnay-2/+1
2022-01-30Restore a visual alignment mode for block commentsDavid Tolnay-3/+3
2022-01-30Bless all pretty printer tests and ui testsDavid Tolnay-158/+138
2022-01-17Emit simpler code from format_argsDavid Tolnay-16/+2
2022-01-12Remove pretty tests for LLVM-style inline assemblyTomasz Miąsko-17/+3
2021-12-29Move equal sign back into head iboxDavid Tolnay-2/+1
2021-12-29Fix spacing of pretty printed const item without bodyDavid Tolnay-11/+12
2021-12-28Remove pretty printer space inside block with only outer attrsDavid Tolnay-11/+11
2021-12-12Stabilize asm! and global_asm!Amanieu d'Antras-6/+8
They are also removed from the prelude as per the decision in https://github.com/rust-lang/rust/issues/87228. stdarch and compiler-builtins are updated to work with the new, stable asm! and global_asm! macros.
2021-12-08Pretty print break and continue without redundant spaceDavid Tolnay-6/+5
2021-12-05Add pretty printer test for async blocksDavid Tolnay-0/+9
Currently fails with: ---- [pretty] pretty/async.rs stdout ---- error: pretty-printed source does not match expected source expected: ------------------------------------------ // pp-exact // pretty-compare-only // edition:2021 async fn f() { let first = async { 1 }; let second = async move { 2 }; join(first, second).await } ------------------------------------------ actual: ------------------------------------------ // pp-exact // pretty-compare-only // edition:2021 async fn f() { let first = async { 1 }; let second = async move { 2 }; join(first, second).await } ------------------------------------------ diff: ------------------------------------------ 3 // edition:2021 4 5 async fn f() { - let first = async { 1 }; - let second = async move { 2 }; + let first = async { 1 }; + let second = async move { 2 }; 8 join(first, second).await 9 } 10
2021-12-01Pretty print empty blocks as {}David Tolnay-80/+79
2021-11-06Don't destructure args tuple in format_args!Cameron Steffen-2/+2
2021-09-21Use ZST for fmt unsafetyCameron Steffen-39/+27
This allows the format_args! macro to keep the pre-expansion code out of the unsafe block without doing gymnastics with nested `match` expressions. This reduces codegen.
2021-09-09Revert "Add test for pretty printing anonymous types"Felix S. Klock II-24/+0
This reverts commit d59b1f1ef4be692b67c1ff1b49ec810fd59452cf.
2021-08-16Make Arguments constructors unsafeCameron Steffen-27/+39
2021-07-27Auto merge of #83491 - jyn514:remove-pretty, r=pnkfelixbors-2/+2
Remove unstable `--pretty` flag It doesn't do anything `--unpretty` doesn't, and due to a bug, also didn't show up in `--help`. I don't think there's any reason to keep it around, I haven't seen anyone using it. Closes https://github.com/rust-lang/rust/issues/36473.
2021-07-03rustc_ast_pretty: Don't print space after `$`Noah Lev-6/+6
For example, this code: $arg:expr used to be pretty-printed as: $ arg : expr but is now pretty-printed as: $arg : expr
2021-06-29Rollup merge of #86358 - klensy:pp-loop, r=Mark-SimulacrumYuki Okushi-3/+20
fix pretty print for `loop`
2021-06-26Auto merge of #86586 - Smittyvb:https-everywhere, r=petrochenkovbors-2/+2
Use HTTPS links where possible While looking at #86583, I wondered how many other (insecure) HTTP links were in `rustc`. This changes most other `http` links to `https`. While most of the links are in comments or documentation, there are a few other HTTP links that are used by CI that are changed to HTTPS. Notes: - I didn't change any to or in licences - Some links don't support HTTPS :( - Some `http` links were dead, in those cases I upgraded them to their new places (all of which used HTTPS)
2021-06-23Use HTTPS links where possibleSmitty-2/+2
2021-06-23fix pretty print for `loop` in mir and hirklensy-3/+20
2021-06-22Auto merge of #85193 - pnkfelix:readd-support-for-inner-attrs-within-match, ↵bors-7/+18
r=nikomatsakis Re-add support for parsing (and pretty-printing) inner-attributes in match body Re-add support for parsing (and pretty-printing) inner-attributes within body of a `match`. In other words, we can do `match EXPR { #![inner_attr] ARM_1 ARM_2 ... }` again. I believe this unbreaks the only four crates that crater flagged as broken by PR #83312. (I am putting this up so that the lang-team can check it out and decide whether it changes their mind about what to do regarding PR #83312.)
2021-05-24Add test for pretty printing anonymous typesjedel1043-0/+24
2021-05-15Remove some unncessary spaces from pretty-printed tokenstream outputAaron Hill-4/+4
In addition to making the output look nicer for all crates, this also aligns the pretty-printing output with what the `rental` crate expects. This will allow us to eventually disable a backwards-compat hack in a follow-up PR.
2021-05-11Updates to tests.Felix S. Klock II-7/+18
2021-05-03parser: Remove support for inner attributes on non-block expressionsVadim Petrochenkov-50/+39
2021-04-28Be stricter about rejecting LLVM reserved registers in asm!Amanieu d'Antras-2/+2
2021-04-23Remove unstable `--pretty` flagJoshua Nelson-2/+2
It doesn't do anything `--unpretty` doesn't, and due to a bug, also didn't show up in `--help`. I don't think there's any reason to keep it around, I haven't seen anyone using it.
2021-02-25Update test/pretty output for edition preludes.Mara Bos-6/+6
2021-02-13Fix pretty printing of generic associated type constraintsMatthew Jasper-0/+2