about summary refs log tree commit diff
path: root/src/libsyntax/print
AgeCommit message (Collapse)AuthorLines
2018-06-20Make method and variable names more consistentvarkor-6/+8
2018-06-20Rename "parameter" to "arg"varkor-14/+14
2018-06-20Rename PathParameter(s) to GenericArg(s)varkor-7/+7
2018-06-20Rename *Parameter to *Paramvarkor-4/+4
2018-06-20Consolidate PathParameters and AngleBracketedParameterDatavarkor-19/+10
2018-06-14create multiple HIR items for a use statementQuietMisdreavus-1/+1
2018-05-26Auto merge of #51072 - petrochenkov:ifield, r=eddybbors-2/+2
Use `Ident`s for fields in HIR Continuation of https://github.com/rust-lang/rust/pull/49718, part of https://github.com/rust-lang/rust/issues/49300
2018-05-26Add `Ident::as_str` helperVadim Petrochenkov-2/+2
2018-05-24restore emplacement syntax (obsolete)Niko Matsakis-0/+7
2018-05-22rustc: Correctly pretty-print macro delimitersAlex Crichton-54/+50
This commit updates the `Mac_` AST structure to keep track of the delimiters that it originally had for its invocation. This allows us to faithfully pretty-print macro invocations not using parentheses (e.g. `vec![...]`). This in turn helps procedural macros due to #43081. Closes #50840
2018-05-19rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded ↵Eduard-Mihai Burtescu-6/+6
constants".
2018-05-17Turn some functions from `token.rs` into methods on `Ident`Vadim Petrochenkov-1/+1
2018-05-16Auto merge of #50045 - est31:label_break_value, r=eddybbors-3/+12
Implement label break value (RFC 2046) Implement label-break-value (#48594).
2018-05-16label-break-value: Parsing and AST/HIR changesest31-3/+12
2018-05-15Represent lifetimes as two joint tokens in proc macrosVadim Petrochenkov-0/+1
2018-05-13Macros: Add a 'literal' fragment specifierDan Aloni-0/+1
Implements RFC 1576. See: https://github.com/rust-lang/rfcs/blob/master/text/1576-macros-literal-matcher.md Changes are mostly in libsyntax, docs, and tests. Feature gate is enabled for 1.27.0. Many thanks to Vadim Petrochenkov for following through code reviews and suggestions. Example: ````rust macro_rules! test_literal { ($l:literal) => { println!("literal: {}", $l); }; ($e:expr) => { println!("expr: {}", $e); }; } fn main() { let a = 1; test_literal!(a); test_literal!(2); test_literal!(-3); } ``` Output: ``` expr: 1 literal: 2 literal: -3 ```
2018-05-06Fix assertion message generationShotaro Yamada-1/+1
2018-05-03Auto merge of #50030 - flip1995:rfc2103, r=petrochenkovbors-16/+21
Implement tool_attributes feature (RFC 2103) cc #44690 This is currently just a rebased and compiling (hopefully) version of #47773. Let's see if travis likes this. I will add the implementation for `tool_lints` this week.
2018-05-03Auto merge of #50391 - nnethercote:escape_unicode, r=eddybbors-1/+1
Use escape_default() for strings in LitKind::token(). This avoids converting every char to \u{...} form, which bloats the resulting strings unnecessarily. It also provides consistency with the existing escape_default() calls in LitKind::token() used for raw string literals, char literals, and raw byte char literals. There are two benefits from this change. - Compilation is faster. Most of the rustc-perf benchmarks see a non-trivial speedup, particularly for incremental rebuilds, with the best speedup over 13%, and multiple others over 10%. - Generated rlibs are smaller. An extreme example is libfutures.rlib, which shrinks from 2073306 bytes to 1765927 bytes, a 15% reduction. r? @jseyfried <details><summary>Here are full numbers for all the rustc-perf runs where the improvement was > 1%.</summary> ``` regex-check avg: -11.1% min: -13.4% max: -5.5% futures-check avg: -7.6% min: -11.4% max: -3.5% futures-opt avg: -6.3% min: -10.3% max: -2.3% futures avg: -6.6% min: -10.3% max: -2.8% regex-opt avg: -4.7% min: -10.2% max: -0.4% regex avg: -5.3% min: -10.2% max: -1.2% hyper-check avg: -4.8% min: -6.6% max: -2.7% encoding-check avg: -4.1% min: -5.5% max: -2.5% issue-46449-check avg: -4.7% min: -5.2% max: -4.1% clap-rs-check avg: -2.9% min: -5.2% max: -1.1% hyper avg: -3.0% min: -5.1% max: -0.8% parser-check avg: -4.2% min: -4.9% max: -3.2% hyper-opt avg: -2.6% min: -4.9% max: -0.3% encoding-opt avg: -2.3% min: -4.6% max: -0.5% encoding avg: -2.5% min: -4.4% max: -0.6% issue-46449 avg: -2.3% min: -4.4% max: -1.8% issue-46449-opt avg: -1.7% min: -4.3% max: -0.9% clap-rs-opt avg: -1.6% min: -4.2% max: -0.2% serde-check avg: -1.4% min: -4.1% max: -0.2% clap-rs avg: -1.6% min: -3.9% max: -0.7% unify-linearly-check avg: -3.2% min: -3.7% max: -2.7% serde avg: -1.1% min: -3.5% max: -0.1% regression-31157-check avg: -2.6% min: -3.4% max: -1.6% helloworld-check avg: -2.5% min: -3.4% max: -0.6% serde-opt avg: -1.3% min: -3.3% max: -0.5% tokio-webpush-simple-check avg: -2.4% min: -3.2% max: -1.8% piston-image-check avg: -1.7% min: -3.2% max: -0.9% deeply-nested-opt avg: -1.5% min: -3.0% max: -0.6% deeply-nested-check avg: -1.9% min: -2.9% max: -0.4% deeply-nested avg: -1.9% min: -2.9% max: -1.2% syn-check avg: -1.8% min: -2.8% max: -0.6% coercions avg: -0.5% min: -2.8% max: 0.4% syn-opt avg: -0.9% min: -2.4% max: -0.1% syn avg: -1.1% min: -2.2% max: -0.3% parser-opt avg: -1.9% min: -2.1% max: -1.6% parser avg: -1.9% min: -2.1% max: -1.6% style-servo-check avg: -1.3% min: -2.0% max: -0.8% regression-31157-opt avg: -0.8% min: -2.0% max: 0.0% piston-image avg: -0.7% min: -1.8% max: -0.2% piston-image-opt avg: -0.6% min: -1.8% max: -0.0% regression-31157 avg: -1.0% min: -1.7% max: -0.3% html5ever-opt avg: -0.6% min: -1.5% max: -0.1% unify-linearly-opt avg: -1.3% min: -1.5% max: -1.1% unify-linearly avg: -1.3% min: -1.4% max: -1.2% tokio-webpush-simple-opt avg: -0.4% min: -1.2% max: -0.0% helloworld-opt avg: -1.0% min: -1.1% max: -0.6% helloworld avg: -1.0% min: -1.1% max: -0.7% inflate-opt avg: -0.3% min: -1.1% max: 0.1% html5ever-check avg: -0.6% min: -1.0% max: -0.3% inflate-check avg: -0.3% min: -1.0% max: -0.1% ``` </details>
2018-05-03Remove parse::escape_default().Nicholas Nethercote-1/+1
str::escape_default() can be used instead.
2018-05-02make it compile againflip1995-8/+8
2018-05-02Remove Option from the return type of Attribute::name()Seiichi Uchida-0/+1
2018-05-02Allow Path for name of MetaItemSeiichi Uchida-16/+20
2018-04-30Extend Printer::buf on demand.Nicholas Nethercote-7/+23
So that 55 entries (at 48 bytes each) don't need to be eagerly initialized on creation. This speeds up numerous rust-perf benchmark runs, by up to 3%.
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