about summary refs log tree commit diff
path: root/src/libsyntax/print
AgeCommit message (Collapse)AuthorLines
2018-02-18Change ast::Visibility to Spanned typeSeiichi Uchida-11/+19
2018-01-25Rollup merge of #47502 - petrochenkov:label, r=eddybAlex Crichton-18/+18
AST/HIR: Add a separate structure for labels
2018-01-23Adds support for immovable generators. Move checking of invalid borrows ↵John Kåre Alsaker-1/+10
across suspension points to borrowck. Fixes #44197, #45259 and #45093.
2018-01-22AST/HIR: Add a separate structure for labelsVadim Petrochenkov-18/+18
2018-01-15Use single source of truth for expr precedenceEsteban Küber-1/+1
Introduce a new unified type that holds the expression precedence for both AST and HIR nodes.
2018-01-13Remove `impl Foo for ..` in favor of `auto trait Foo`leonardo.yvens-12/+0
No longer parse it. Remove AutoTrait variant from AST and HIR. Remove backwards compatibility lint. Remove coherence checks, they make no sense for the new syntax. Remove from rustdoc.
2017-12-28Resurrecting #33135Michael Hewson-0/+1
Started rebasing @sgrif's PR #33135 off of current master. (Well, actually merging it into a new branch based off current master.) The following files still need to be fixed or at least reviewed: - `src/libsyntax/ext/tt/macro_parser.rs`: calls `Parser::parse_lifetime`, which doesn't exist anymore - `src/libsyntax/parse/parser.rs`: @sgrif added an error message to `Parser::parse_lifetime`. Code has since been refactored, so I just took it out for now. - `src/libsyntax/ext/tt/transcribe.rs`: This code has been refactored bigtime. Not sure whether @sgrif's changes here are still necessary. Took it out for this commit.
2017-12-21Add GenericParam, refactor Generics in ast, hir, rustdocJonas Platte-67/+44
The Generics now contain one Vec of an enum for the generic parameters, rather than two separate Vec's for lifetime and type parameters. Additionally, places that previously used Vec<LifetimeDef> now use Vec<GenericParam> instead.
2017-12-20Fix whitespacing issues in pretty-printing of boundsVadim Petrochenkov-17/+18
2017-12-14add trait aliases to ASTAlex Burka-0/+21
2017-12-14Use PathBuf instead of String where applicableOliver Schneider-3/+3
2017-12-12Improve pretty printing `$crate::` paths.Jeffrey Seyfried-1/+19
2017-11-30Implement RFC 2128 (use_nested_groups)Pietro Albini-28/+22
This commit adds support for nested groups inside `use` declarations, such as `use foo::{bar, sub::{baz::Foo, *}};`.
2017-11-10Auto merge of #45773 - Badel2:dotdoteq, r=petrochenkovbors-1/+1
Add error for `...` in expressions Follow-up to https://github.com/rust-lang/rust/pull/44709 Tracking issue: https://github.com/rust-lang/rust/issues/28237 * Using `...` in expressions was a warning, now it's an error * The error message suggests using `..` or `..=` instead, and explains the difference * Updated remaining occurrences of `...` to `..=` r? petrochenkov
2017-11-07Rollup merge of #45784 - harpocrates:fix/print-parens-cast-lt, r=kennytmkennytm-0/+9
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-06Inclusive range updated to `..=` syntaxBadel2-1/+1
2017-11-05Pretty print parens around casts on the LHS of '<'Alec Theriault-0/+9
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.
2017-11-03Fix unsafe auto trait pretty print.leonardo.yvens-1/+1
It was being printed wrong as auto unsafe trait
2017-11-03add `auto` keyword, parse `auto trait`, lower to HIRleonardo.yvens-1/+9
Adds an `IsAuto` field to `ItemTrait` which flags if the trait was declared as an `auto trait`. Auto traits cannot have generics nor super traits.
2017-11-03[Syntax Breaking] Rename DefaultImpl to AutoImplleonardo.yvens-1/+1
DefaultImpl is a highly confusing name for what we now call auto impls, as in `impl Send for ..`. The name auto impl is not formally decided but for sanity anything is better than `DefaultImpl` which refers neither to `default impl` nor to `impl Default`.
2017-10-27Implement RFC 1861: Extern typesPaul Lietar-0/+7
2017-10-24Auto merge of #45401 - zackmdavis:crate_shorthand_visibility_modifier, ↵bors-1/+4
r=nikomatsakis `crate` shorthand visibility modifier cc #45388. r? @nikomatsakis
2017-10-22`crate` shorthand visibility modifierZack M. Davis-1/+4
With regrets, this breaks rustfmt and rls. This is in the matter of #45388.
2017-10-17Lifting Generics from MethodSig to TraitItem and ImplItem since we want to ↵Sunjay Varma-3/+4
support generics in each variant of TraitItem and ImplItem
2017-10-14Implement `dyn Trait` syntaxVadim Petrochenkov-2/+3
2017-09-22Add information about the syntax used in rangesBadel2-2/+3
... or ..=
2017-09-22Add support for `..=` syntaxAlex Burka-0/+2
Add ..= to the parser Add ..= to libproc_macro Add ..= to ICH Highlight ..= in rustdoc Update impl Debug for RangeInclusive to ..= Replace `...` to `..=` in range docs Make the dotdoteq warning point to the ... Add warning for ... in expressions Updated more tests to the ..= syntax Updated even more tests to the ..= syntax Updated the inclusive_range entry in unstable book
2017-09-06pprust: fix parenthesization of exprsStuart Pernsteiner-65/+82
2017-08-30Make fields of `Span` privateVadim Petrochenkov-26/+26
2017-08-16Merge remote-tracking branch 'origin/master' into genAlex Crichton-4/+4
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-4/+4
Like #43008 (f668999), but _much more aggressive_.
2017-08-09Merge remote-tracking branch 'origin/master' into genAlex Crichton-0/+2
2017-07-29Add Span to ast::WhereClausetopecongiro-0/+2
2017-07-28Remove support for `gen arg`Alex Crichton-3/+0
2017-07-28Fix printingJohn Kåre Alsaker-5/+3
2017-07-28Generator literal supportJohn Kåre Alsaker-0/+15
2017-07-11Make a few functions non-publicMark Simulacrum-9/+4
2017-07-11Refactor cur_cmnt_and_lit away.Mark Simulacrum-46/+38
The literal index was increased in only next_lit, so it isn't necessary: code now uses an iterator. The cur_cmnt field is also moved to be increased in print_comment instead of after each call to print_comment.
2017-07-11Refactor methods onto Printer struct.Mark Simulacrum-316/+311
No (intentional) changes to behavior. This is intended to avoid the anti-pattern of having to import individual methods throughout code.
2017-07-10Store all generic arguments for method calls in ASTVadim Petrochenkov-10/+6
2017-07-05Merge remote-tracking branch 'origin/master' into proc_macro_apiAlex Crichton-2/+2
2017-06-29Make `$crate` a keywordVadim Petrochenkov-2/+2
2017-06-26Add `LazyTokenStream`.Jeffrey Seyfried-1/+1
2017-06-26Simplify `hygiene::Mark` application, andJeffrey Seyfried-1/+0
remove variant `Token::SubstNt` in favor of `quoted::TokenTree::MetaVar`.
2017-06-23Removed as many "```ignore" as possible.kennytm-1/+1
Replaced by adding extra imports, adding hidden code (`# ...`), modifying examples to be runnable (sorry Homura), specifying non-Rust code, and converting to should_panic, no_run, or compile_fail. Remaining "```ignore"s received an explanation why they are being ignored.
2017-06-12Add a sig module to save-analysisNick Cameron-7/+20
Generates signatures for use in Rustdoc and similar tools.
2017-05-25Hygienize lifetimes.Jeffrey Seyfried-1/+1
2017-05-25Refactor out `ast::MacroDef`.Jeffrey Seyfried-1/+1
2017-05-16(hopefully) fix pprust errorAndre Bogus-1/+3
2017-05-15adressed comments by @kennytm and @petrochenkovAndre Bogus-1/+1