about summary refs log tree commit diff
path: root/src/test/pretty
AgeCommit message (Collapse)AuthorLines
2019-03-15rustc: pass Option<&Substs> and Namespace around in ty::item_path.Eduard-Mihai Burtescu-17/+17
2019-03-14Moved issue tests to subdirs and normalised names.Alexander Regueiro-6/+10
2019-03-03NitAlexander Regueiro-1/+1
2019-03-02Fix C-variadic function printingDan Robertson-0/+15
There is no longer a need to append the string `", ..."` to a functions args as `...` is parsed as an argument and will appear in the functions arguments.
2019-01-26Pretty print `$crate` as `crate` or `crate_name` in more casesVadim Petrochenkov-0/+25
2018-12-25Remove licensesMark Rousskov-574/+0
2018-12-19Reintroduce special pretty-printing for `$crate` when it's necessary for ↵Vadim Petrochenkov-2/+2
proc macros
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-11-30tests: use `force-host` and `no-prefer-dynamic` in all proc_macro tests.Eduard-Mihai Burtescu-0/+1
2018-11-30tests: remove ignore-stage1 where possible in proc_macro tests.Eduard-Mihai Burtescu-1/+0
2018-10-02abolish ICE when pretty-printing async blockZack M. Davis-0/+7
Joshua Netterfield reported an ICE when the unused-parentheses lint triggered around an async block (#54752). In order to compose an autofixable suggestion, the lint invokes the pretty-printer on the unnecessarily-parenthesized expression. (One wonders why the lint doesn't just use `SourceMap::span_to_snippet` instead, to preserve the formatting of the original source?—but for that, you'd have to ask the author of 5c9f806d.) But then the pretty-printer panics when trying to call `<pprust::State as PrintState>::end` when `State.boxes` is empty. Empirically, the problem would seem to be solved if we start some "boxes" beforehand in the `ast::ExprKind::Async` arm of the big match in `print_expr_outer_attr_style`, exactly like we do in the immediately-preceding match arm for `ast::ExprKind::Block`—it would seem pretty ("pretty") reasonable for the pretty-printing of async blocks to work a lot like the pretty-printing of ordinary non-async blocks, right?? Of course, it would be shamefully cargo-culty to commit code on the basis of this kind of mere reasoning-by-analogy (in contrast to understanding the design of the pretty-printer in such detail that the correctness of the patch is comprehended with all the lucid certainty of mathematical proof, rather than being merely surmised by intuition). But maybe we care more about fixing the bug with high probability today, than with certainty in some indefinite hypothetical future? Maybe the effort is worth a fifth of a shirt?? Humbly resolves #54752.
2018-09-10update result of issue 12590 testTinco Andringa-1/+1
2018-09-10Fixed the test to match the compiler's output.Felix S. Klock II-6/+10
2018-09-10Correctly close indentation blocks when pretty printing non-inline moduleTinco Andringa-1/+2
2018-09-10pretty=expanded should expand mod declarationsTinco Andringa-0/+42
2018-09-10Track whether module declarations are inline (fixes #12590)Tinco Andringa-0/+31
2018-08-23Stabilize 'attr_literals' feature.Sergio Benitez-1/+1
2018-08-14syntax: gensym the injected std/core extern crates in the Rust 2018 edition.Eduard-Mihai Burtescu-2/+2
2018-08-06Address review commentsVadim Petrochenkov-1/+1
Adjust a few fulldeps and pretty-printing tests Fix rebase
2018-07-12fix expected output of pretty/cast-lt and issue-4264 testsTinco Andringa-4/+2
2018-04-03Remove all unstable placement featuresAidan Hobson Sayers-1/+0
Closes #22181, #27779
2018-02-17fix more typos found by codespell.Matthias Krüger-1/+1
2017-12-20Fix whitespacing issues in pretty-printing of boundsVadim Petrochenkov-4/+4
2017-12-12Fix fallout in tests.Jeffrey Seyfried-1/+1
2017-11-07Rollup merge of #45784 - harpocrates:fix/print-parens-cast-lt, r=kennytmkennytm-0/+46
Pretty print parens around casts on the LHS of `<`/`<<` When pretty printing a cast expression occuring on the LHS of a `<` or `<<` expression, we should add parens around the cast. Otherwise, the `<`/`<<` gets interpreted as the beginning of the generics for the type on the RHS of the cast. Consider: $ cat parens_cast.rs macro_rules! negative { ($e:expr) => { $e < 0 } } fn main() { negative!(1 as i32); } Before this PR, the output of the following is not valid Rust: $ rustc -Z unstable-options --pretty=expanded parens_cast.rs #![feature(prelude_import)] #![no_std] #[prelude_import] use std::prelude::v1::*; #[macro_use] extern crate std as std; macro_rules! negative(( $ e : expr ) => { $ e < 0 }); fn main() { 1 as i32 < 0; } After this PR, the output of the following is valid Rust: $ rustc -Z unstable-options --pretty=expanded parens_cast.rs #![feature(prelude_import)] #![no_std] #[prelude_import] use std::prelude::v1::*; #[macro_use] extern crate std as std; macro_rules! negative(( $ e : expr ) => { $ e < 0 }); fn main() { (1 as i32) < 0; } I've gone through several README/wiki style documents but I'm still not sure where to test this though. I'm not even sure if this sort of thing is tested...
2017-11-06Update comments in cast-lt.ppAlec Theriault-3/+1
2017-11-05Fix commentsAlec Theriault-3/+1
2017-11-05Added testsAlec Theriault-0/+50
2017-11-03Fix unsafe auto trait pretty print.leonardo.yvens-0/+2
It was being printed wrong as auto unsafe trait
2017-11-03Update pretty test for auto trait syntax.leonardo.yvens-3/+1
2017-10-08Fix testsWonwoo Choi-25/+25
2017-09-10Use rvalue promotion to 'static instead of static items.Eduard-Mihai Burtescu-16/+6
2017-02-05Update pretty test for derive attributesJosh Driver-51/+65
Remove attr-variant-data.rs since it relies on quirks in legacy custom derive resolution (undefined derives only print a warning). Add a new test which uses a defined proc macro derive, and tests pretty printing of proc macro derive attributes.
2017-01-17AST/HIR: Merge ObjectSum and PolyTraitRefVadim Petrochenkov-3/+3
2016-12-22Pretty-print `$crate::foo::bar` as `::foo::bar`.Jeffrey Seyfried-1/+1
2016-11-28rustc: desugar UFCS as much as possible during HIR lowering.Eduard Burtescu-1/+1
2016-11-10tests: fix fallout in pretty-printing output exact-match tests.Eduard Burtescu-66/+80
2016-10-31Changed most vec! invocations to use square bracesiirelu-2/+2
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-10-19Improve `$crate`.Jeffrey Seyfried-1/+1
2016-10-18Fix some pretty printing testsVadim Petrochenkov-1/+0
2016-08-25Implement RFC#1559: allow all literals in attributes.Sergio Benitez-0/+23
2016-06-29Fix pretty-printing of lifetime boundSeo Sanghyeon-1/+16
2016-06-17Pretty-print attributes on tuple structs and add testsErick Tryzelaar-0/+51
This adds support to the pretty printer to print attributes added to tuple struct elements. Furthermore, it adds a test that makes sure we will print attributes on all variant data types.
2016-03-30Fix fallout in testsJeffrey Seyfried-36/+36
2016-03-25Fix accursed issue-4264.ppNiko Matsakis-29/+29
2016-03-18Update the not-at-all-pretty pain-o-tron-4000+264 test.Eduard Burtescu-29/+29
2016-03-16Auto merge of #31746 - erickt:newline, r=sfacklerbors-0/+20
syntax: Always pretty print a newline after doc comments Before this patch, code that had a doc comment as the first line, as in: ```rust /// Foo struct Foo; ``` Was pretty printed into: ```rust ///Foostruct Foo; ``` This makes sure that that there is always a trailing newline after a doc comment. Closes #31722
2016-03-09Print fn type parameters for TyFnDef.Eduard Burtescu-2/+4
2016-03-07syntax: Always pretty print a newline after doc commentsErick Tryzelaar-0/+20
Before this patch, code that had a doc comment as the first line, as in: ```rust /// Foo struct Foo; ``` Was pretty printed into: ```rust ///Foostruct Foo; ``` This makes sure that that there is always a trailing newline after a doc comment. Closes #31722
2016-01-28libsyntax: fix pretty printing of macro with bracesTomasz Miąsko-0/+17
Pretty printing of macro with braces but without terminated semicolon removed more boxes from stack than it put there, resulting in panic. This fixes the issue #30731.