about summary refs log tree commit diff
path: root/src/libsyntax/ast.rs
AgeCommit message (Collapse)AuthorLines
2017-12-21Do not emit type errors on recovered blocksEsteban Küber-0/+1
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.
2017-12-21Auto merge of #45930 - jplatte:generics_refactoring, r=eddybbors-18/+43
Generics refactoring (groundwork for const generics) These changes were suggested by @eddyb. After this change, the `Generics` contain one `Vec` of an enum for the generic parameters, rather than two separate `Vec`s for lifetime and type parameters. Type params and const params will need to be in a shared `Vec` to preserve their ordering, and moving lifetimes into the same `Vec` should simplify the code that processes `Generics`.
2017-12-21Add GenericParam, refactor Generics in ast, hir, rustdocJonas Platte-18/+43
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-20Move impls for qpath recovery trait from `ast.rs`Vadim Petrochenkov-56/+25
2017-12-17syntax: recovery for incorrect associated item paths like `[T; N]::clone`Vadim Petrochenkov-0/+94
2017-12-14add trait aliases to ASTAlex Burka-0/+5
2017-11-30Implement RFC 2128 (use_nested_groups)Pietro Albini-37/+10
This commit adds support for nested groups inside `use` declarations, such as `use foo::{bar, sub::{baz::Foo, *}};`.
2017-11-21Support `::crate` in pathsVadim Petrochenkov-3/+8
2017-11-03add `auto` keyword, parse `auto trait`, lower to HIRleonardo.yvens-2/+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-2/+2
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-11-01Rollup merge of #45579 - ↵kennytm-1/+3
leodasvacas:document-that-call-can-be-adt-constructor, r=estebank Document that call expressions also represent ADT constructors. This is a rather obscure part of the language.
2017-10-27Implement RFC 1861: Extern typesPaul Lietar-1/+4
2017-10-27Document that call expressions also represent ADT constructors.leonardo.yvens-1/+3
This is a rather obscure part of the language.
2017-10-24Auto merge of #45401 - zackmdavis:crate_shorthand_visibility_modifier, ↵bors-1/+10
r=nikomatsakis `crate` shorthand visibility modifier cc #45388. r? @nikomatsakis
2017-10-22`crate` shorthand visibility modifierZack M. Davis-1/+10
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-1/+2
support generics in each variant of TraitItem and ImplItem
2017-10-14Implement `dyn Trait` syntaxVadim Petrochenkov-1/+8
2017-10-05Auto merge of #44943 - nivkner:fixme_fixup, r=dtolnaybors-2/+0
address some FIXME whose associated issues were marked as closed part of #44366
2017-10-02fix comment on DefaultImplAlex Burka-2/+2
2017-10-02fix ItemKind::DefaultImpl doc commentAlex Burka-2/+2
Upgrade comment to doc comment.
2017-09-30remove "refinement on pat" FIXMENiv Kaminer-1/+0
2017-09-30address some `FIXME`s whose associated issues were marked as closedNiv Kaminer-2/+1
remove FIXME(#13101) since `assert_receiver_is_total_eq` stays. remove FIXME(#19649) now that stability markers render. remove FIXME(#13642) now the benchmarks were moved. remove FIXME(#6220) now that floating points can be formatted. remove FIXME(#18248) and write tests for `Rc<str>` and `Rc<[u8]>` remove reference to irelevent issues in FIXME(#1697, #2178...) update FIXME(#5516) to point to getopts issue 7 update FIXME(#7771) to point to RFC 628 update FIXME(#19839) to point to issue 26925
2017-09-22Add information about the syntax used in rangesBadel2-2/+8
... or ..=
2017-09-18incr.comp.: Compute hashes of all query results.Michael Woerister-3/+6
2017-09-05Remove trailing white spaceZaki Manian-1/+1
2017-09-03Minor documentation improvements for StmtKindZaki Manian-2/+2
2017-09-01Implement RFC 1925Matt Ickstadt-0/+1
2017-08-30Make fields of `Span` privateVadim Petrochenkov-1/+1
2017-08-25Merge remote-tracking branch 'origin/master' into genAlex Crichton-0/+26
2017-08-22Auto merge of #43854 - estebank:missing-cond, r=nikomatsakisbors-0/+26
Point out missing if conditional On a case where an else conditional is missing, point this out instead of the token immediately after the (incorrect) else block: ``` error: missing condition for `if` statemementt push fork -f --> $DIR/issue-13483.rs:16:5 | 13 | } else if { | ^ expected if condition here ``` instead of ``` error: expected `{`, found `else` --> ../../src/test/ui/issue-13483.rs:14:7 | 14 | } else { | ^^^^ ``` Fix #13483.
2017-08-17Verify that an `if` condition block returns a valueEsteban Küber-0/+26
2017-08-16Merge remote-tracking branch 'origin/master' into genAlex Crichton-6/+6
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-6/+6
Like #43008 (f668999), but _much more aggressive_.
2017-08-14Merge remote-tracking branch 'origin/master' into genAlex Crichton-3/+3
2017-08-12Fix some typosBastien Orivel-3/+3
2017-08-09Merge remote-tracking branch 'origin/master' into genAlex Crichton-0/+22
2017-07-30Auto merge of #43551 - Mark-Simulacrum:rollup, r=Mark-Simulacrumbors-0/+2
Rollup of 8 pull requests - Successful merges: #43409, #43501, #43509, #43512, #43513, #43536, #43544, #43549 - Failed merges:
2017-07-29Rollup merge of #43501 - topecongiro:span-to-whereclause, r=nrcMark Simulacrum-0/+2
Add Span to ast::WhereClause This PR adds `Span` field to `ast::WhereClause`. The motivation here is to make rustfmt's life easier when recovering comments before and after where clause. r? @nrc
2017-07-29Auto merge of #43009 - GuillaumeGomez:unused-doc-comments, r=nrcbors-0/+7
Throw errors when doc comments are added where they're unused #42617
2017-07-28syntax: Capture a `TokenStream` when parsing itemsAlex Crichton-0/+7
This is then later used by `proc_macro` to generate a new `proc_macro::TokenTree` which preserves span information. Unfortunately this isn't a bullet-proof approach as it doesn't handle the case when there's still other attributes on the item, especially inner attributes. Despite this the intention here is to solve the primary use case for procedural attributes, attached to functions as outer attributes, likely bare. In this situation we should be able to now yield a lossless stream of tokens to preserve span information.
2017-07-29Add Span to ast::WhereClausetopecongiro-0/+2
2017-07-28syntax: Add `tokens: Option<TokenStream>` to ItemAlex Crichton-0/+6
This commit adds a new field to the `Item` AST node in libsyntax to optionally contain the original token stream that the item itself was parsed from. This is currently `None` everywhere but is intended for use later with procedural macros.
2017-07-28Remove support for `gen arg`Alex Crichton-3/+0
2017-07-28Generator literal supportJohn Kåre Alsaker-0/+6
2017-07-27Give span to angle bracketed generic argumentsVadim Petrochenkov-7/+5
2017-07-27Discern between `Path` and `Path<>` in ASTVadim Petrochenkov-8/+6
2017-07-27Simplify parsing of pathsVadim Petrochenkov-0/+19
2017-07-27Make a lint insteadGuillaume Gomez-0/+7
2017-07-10Store all generic arguments for method calls in ASTVadim Petrochenkov-7/+4
2017-07-05Merge remote-tracking branch 'origin/master' into proc_macro_apiAlex Crichton-3/+2