about summary refs log tree commit diff
path: root/src/libsyntax/print/pprust.rs
AgeCommit message (Collapse)AuthorLines
2018-05-02Allow Path for name of MetaItemSeiichi Uchida-16/+20
2018-04-26rustc_target: move in syntax::abi and flip dependency.Irina Popa-1/+1
2018-04-18Auto merge of #49993 - nnethercote:shrink-Token, r=alexcrichtonbors-3/+3
Change the hashcounts in raw `Lit` variants from usize to u16. This reduces the size of `Token` from 32 bytes to 24 bytes on 64-bit platforms.
2018-04-12AST/HIR: Merge field access expressions for named and numeric fieldsVadim Petrochenkov-7/+1
2018-04-12Change the hashcounts in raw `Lit` variants from usize to u16.Nicholas Nethercote-3/+3
This reduces the size of `Token` from 32 bytes to 24 bytes on 64-bit platforms.
2018-04-07Inject the `compiler_builtins` crate whenever the `core` crate is injectedOliver Schneider-1/+1
2018-04-06Use `Ident` instead of `Name` in `MetaItem`Vadim Petrochenkov-7/+7
2018-04-06Make lifetime nonterminals closer to identifier nonterminalsVadim Petrochenkov-1/+1
2018-04-06Rename `ast::Variant_::name` into `ident` + Fix rebaseVadim Petrochenkov-2/+2
2018-04-06Get rid of `SpannedIdent`Vadim Petrochenkov-26/+26
2018-04-06Rename `PathSegment::identifier` to `ident`Vadim Petrochenkov-12/+12
2018-04-06Use `Span` instead of `SyntaxContext` in `Ident`Vadim Petrochenkov-2/+2
2018-04-05Rollup merge of #49350 - abonander:macros-in-extern, r=petrochenkovAlex Crichton-0/+9
Expand macros in `extern {}` blocks This permits macro and proc-macro and attribute invocations (the latter only with the `proc_macro` feature of course) in `extern {}` blocks, gated behind a new `macros_in_extern` feature. A tracking issue is now open at #49476 closes #48747
2018-04-03expand macro invocations in `extern {}` blocksAustin Bonander-0/+9
2018-04-03Remove all unstable placement featuresAidan Hobson Sayers-13/+0
Closes #22181, #27779
2018-03-27Fix pretty-printing for raw identifiersVadim Petrochenkov-1/+5
2018-03-18Initial implementation of RFC 2151, Raw IdentifiersLymia Aluysia-19/+21
2018-03-18Auto merge of #48917 - petrochenkov:import, r=oli-obkbors-38/+27
syntax: Make imports in AST closer to the source and cleanup their parsing This is a continuation of https://github.com/rust-lang/rust/pull/45846 in some sense.
2018-03-17Rename `Span::empty` to `Span::shrink_to_lo`, add `Span::shrink_to_hi`Vadim Petrochenkov-2/+2
2018-03-17AST: Keep distinction between `path` and `::path` in imports and visibilitiesVadim Petrochenkov-24/+19
Add the root segment for name resolution purposes only
2018-03-17AST: Make renames in imports closer to the sourceVadim Petrochenkov-4/+3
Fix `unused_import_braces` lint false positive on `use prefix::{self as rename}`
2018-03-17AST/HIR: Clarify what the optional name in extern crate items meanVadim Petrochenkov-8/+3
2018-03-17syntax: Make `_` an identifierVadim Petrochenkov-1/+0
2018-03-14Remove syntax and syntax_pos thread localsJohn Kåre Alsaker-23/+28
2018-03-01Support parentheses in patterns under feature gateVadim Petrochenkov-0/+5
Improve recovery for trailing comma after `..`
2018-02-24Implement multiple patterns with `|` in `if let` and `while let`Vadim Petrochenkov-18/+23
2018-02-18Replace dummy spans with empty spansSeiichi Uchida-2/+2
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.