about summary refs log tree commit diff
path: root/src/libsyntax/ast.rs
AgeCommit message (Collapse)AuthorLines
2018-05-24Auto merge of #50971 - alexcrichton:no-stringify, r=petrochenkovbors-0/+8
rustc: Correctly pretty-print macro delimiters 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-24implement Ord for OutlivesPredicate and other typestoidiu-1/+1
2018-05-22add `Span` information into `Qself`Niko Matsakis-0/+5
2018-05-22rustc: Correctly pretty-print macro delimitersAlex Crichton-0/+8
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/+18
constants".
2018-05-17Turn some functions from `token.rs` into methods on `Ident`Vadim Petrochenkov-2/+1
2018-05-16label-break-value: Parsing and AST/HIR changesest31-3/+3
2018-05-02make it compile againflip1995-1/+1
2018-05-02Allow Path for name of MetaItemSeiichi Uchida-2/+2
2018-04-30Auto merge of #50092 - abonander:issue-49934, r=petrochenkovbors-1/+1
Warn on pointless #[derive] in more places This fixes the regression in #49934 and ensures that unused `#[derive]` invocations on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. There is a separate warning hardcoded for `#[derive]` on macro invocations since linting (even the early-lint pass) occurs after expansion. This also adds regression tests for some nodes that were already warning properly. closes #49934
2018-04-29Warn on pointless `#[derive]` in more placesAustin Bonander-1/+1
This fixes the regression in #49934 and ensures that unused `#[derive]`s on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. For `#[derive]` on macro invocations it has a hardcoded warning since linting occurs after expansion. This also adds regression testing for some nodes that were already warning properly. closes #49934
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-2/+2
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-6/+1
2018-04-12Change the hashcounts in raw `Lit` variants from usize to u16.Nicholas Nethercote-2/+2
This reduces the size of `Token` from 32 bytes to 24 bytes on 64-bit platforms.
2018-04-06Use `Ident` instead of `Name` in `MetaItem`Vadim Petrochenkov-1/+1
2018-04-06Remove more duplicated spansVadim Petrochenkov-16/+8
2018-04-06Rename `ast::Variant_::name` into `ident` + Fix rebaseVadim Petrochenkov-2/+2
2018-04-06Get rid of `SpannedIdent`Vadim Petrochenkov-9/+7
2018-04-06Rename `PathSegment::identifier` to `ident`Vadim Petrochenkov-12/+8
2018-04-06Use `Span` instead of `SyntaxContext` in `Ident`Vadim Petrochenkov-1/+1
2018-04-05Rollup merge of #49350 - abonander:macros-in-extern, r=petrochenkovAlex Crichton-0/+3
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/+3
2018-04-03Remove all unstable placement featuresAidan Hobson Sayers-3/+0
Closes #22181, #27779
2018-04-02Expand attribute macros on statements and expressions.Austin Bonander-0/+7
Retains the `stmt_expr_attributes` feature requirement for attributes on expressions. closes #41475 cc #38356
2018-03-18Initial implementation of RFC 2151, Raw IdentifiersLymia Aluysia-1/+1
2018-03-17Add some docs + Fix rebaseVadim Petrochenkov-0/+6
2018-03-17Rename `Span::empty` to `Span::shrink_to_lo`, add `Span::shrink_to_hi`Vadim Petrochenkov-1/+1
2018-03-17AST: Keep distinction between `path` and `::path` in imports and visibilitiesVadim Petrochenkov-9/+8
Add the root segment for name resolution purposes only
2018-03-17AST: Make renames in imports closer to the sourceVadim Petrochenkov-3/+14
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-1/+1
2018-03-09Auto merge of #48326 - RalfJung:generic-bounds, r=petrochenkovbors-0/+19
Warn about ignored generic bounds in `for` This adds a new lint to fix #42181. For consistency and to avoid code duplication, I also moved the existing "bounds in type aliases are ignored" here. Questions to the reviewer: * Is it okay to just remove a diagnostic error code like this? Should I instead keep the warning about type aliases where it is? The old code provided a detailed explanation of what's going on when asked, that information is now lost. On the other hand, `span_warn!` seems deprecated (after this patch, it has exactly one user left!). * Did I miss any syntactic construct that can appear as `for` in the surface syntax? I covered function types (`for<'a> fn(...)`), generic traits (`for <'a> Fn(...)`, can appear both as bounds as as trait objects) and bounds (`for<'a> F: ...`). * For the sake of backwards compatibility, this adds a warning, not an error. @nikomatsakis suggested an error in https://github.com/rust-lang/rust/issues/42181#issuecomment-306924389, but I feel that can only happen in a new epoch -- right? Cc @eddyb
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-2/+2
2018-03-01Support parentheses in patterns under feature gateVadim Petrochenkov-1/+3
Improve recovery for trailing comma after `..`
2018-02-27add lint to detect ignored generic bounds; this subsumes the previous ↵Ralf Jung-0/+19
'generic bounds in type aliases are ignored' warning
2018-02-24Implement multiple patterns with `|` in `if let` and `while let`Vadim Petrochenkov-2/+2
2018-02-23Auto merge of #47799 - topecongiro:fix-span-of-visibility, r=petrochenkovbors-2/+4
Fix span of visibility This PR 1. adds a closing parenthesis to the span of `Visibility::Crate` (e.g. `pub(crate)`). The current span only covers `pub(crate`. 2. adds a `span` field to `Visibility::Restricted`. This span covers the entire visibility expression (e.g. `pub (in self)`). Currently all we can have is a span for `Path`. This PR is motivated by the bug found in rustfmt (https://github.com/rust-lang-nursery/rustfmt/issues/2398). The first change is a strict improvement IMHO. The second change may not be desirable, as it adds a field which is currently not used by the compiler.
2018-02-17fix more typos found by codespell.Matthias Krüger-1/+1
2018-02-18Change ast::Visibility to Spanned typeSeiichi Uchida-3/+5
2018-02-18Add a span field to Visibility::RestrictedSeiichi Uchida-1/+1
This span covers the whole visibility expression: e.g. `pub (in path)`.
2018-01-30stabilize match_beginning_vertJonathan Goodman-1/+0
2018-01-25Rollup merge of #47502 - petrochenkov:label, r=eddybAlex Crichton-6/+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/+8
across suspension points to borrowck. Fixes #44197, #45259 and #45093.
2018-01-22AST/HIR: Add a separate structure for labelsVadim Petrochenkov-6/+18
2018-01-15Move `ExprPrecedence` to `libsyntax/util/parser.rs`Esteban Küber-135/+1
2018-01-15Use single source of truth for expr precedenceEsteban Küber-0/+180
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-6/+1
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.
2018-01-04rustc: use {U,I}size instead of {U,I}s shorthands.Eduard-Mihai Burtescu-6/+6
2018-01-01Fix docs for future pulldown migrationMalo Jaffré-2/+2
2017-12-22Auto merge of #46732 - estebank:silence-recovered-blocks, r=petrochenkovbors-0/+1
Do not emit type errors on recovered blocks When a parse error occurs on a block, the parser will recover and create a block with the statements collected until that point. Now a flag stating that a recovery has been performed in this block is propagated so that the type checker knows that the type of the block (which will be identified as `()`) shouldn't be checked against the expectation to reduce the amount of irrelevant diagnostic errors shown to the user. Fix #44579.