about summary refs log tree commit diff
path: root/src/libsyntax/visit.rs
AgeCommit message (Collapse)AuthorLines
2017-10-26Auto merge of #45464 - sinkuu:ice_44851, r=jseyfriedbors-1/+30
Visit attribute tokens in `DefCollector` and `BuildReducedGraphVisitor` Fixes #44851.
2017-10-26Add FIXMEsinkuu-0/+1
2017-10-23Fix #44851 by visiting tokens in `DefCollector` and `BuildReducedGraphVisitor`sinkuu-1/+29
2017-10-17Removed Generics from FnKind::ItemFn in libsyntaxSunjay Varma-4/+4
2017-10-17Lifting Generics from MethodSig to TraitItem and ImplItem since we want to ↵Sunjay Varma-3/+3
support generics in each variant of TraitItem and ImplItem
2017-10-14Implement `dyn Trait` syntaxVadim Petrochenkov-1/+1
2017-07-28Remove support for `gen arg`Alex Crichton-1/+0
2017-07-28Generator literal supportJohn Kåre Alsaker-0/+4
2017-07-10Store all generic arguments for method calls in ASTVadim Petrochenkov-3/+2
2017-05-25Hygienize lifetimes.Jeffrey Seyfried-1/+1
2017-05-25Refactor out `ast::MacroDef`.Jeffrey Seyfried-2/+1
2017-05-17Auto merge of #42049 - Mark-Simulacrum:rollup, r=Mark-Simulacrumbors-5/+3
Rollup of 5 pull requests - Successful merges: #41937, #41957, #42017, #42039, #42046 - Failed merges:
2017-05-16Rollup merge of #41957 - llogiq:clippy-libsyntax, r=petrochenkovMark Simulacrum-5/+3
Fix some clippy warnings in libsyntax This is mostly removing stray ampersands, needless returns and lifetimes. Basically a lot of small changes.
2017-05-16Auto merge of #41907 - est31:macro_unused, r=jseyfriedbors-1/+5
Add lint for unused macros Addresses parts of #34938, to add a lint for unused macros. We now output warnings by default when we encounter a macro that we didn't use for expansion. Issues to be resolved before this PR is ready for merge: - [x] fix the NodeId issue described above - [x] remove all unused macros from rustc and the libraries or set `#[allow(unused_macros)]` next to them if they should be kept for some reason. This is needed for successful boostrap and bors to accept the PR. -> #41934 - [x] ~~implement the full extent of #34938, that means the macro match arm checking as well.~~ *let's not do this for now*
2017-05-13Extend the libsyntax visitor to work over macro defsest31-1/+5
2017-05-12Fix some clippy warnings in libsyntaxAndre Bogus-5/+3
This is mostly removing stray ampersands, needless returns and lifetimes.
2017-05-12Pass crate attributes in visit.rsNick Cameron-3/+5
2017-04-24support `default impl` for specializationGianni Ciccarelli-1/+1
this commit implements the first step of the `default impl` feature: all items in a `default impl` are (implicitly) `default` and hence specializable. In order to test this feature I've copied all the tests provided for the `default` method implementation (in run-pass/specialization and compile-fail/specialization directories) and moved the `default` keyword from the item to the impl. See referenced issue for further info
2017-04-12First attempt at global_asm! macroA.J. Gardner-0/+6
2017-04-02Introduce `TyErr` independent from `TyInfer`Esteban Küber-1/+1
Add a `TyErr` type to represent unknown types in places where parse errors have happened, while still able to build the AST. Initially only used to represent incorrectly written fn arguments and avoid "expected X parameters, found Y" errors when called with the appropriate amount of parameters. We cannot use `TyInfer` for this as `_` is not allowed as a valid argument type. Example output: ```rust error: expected one of `:` or `@`, found `,` --> file.rs:12:9 | 12 | fn bar(x, y: usize) {} | ^ error[E0061]: this function takes 2 parameters but 3 parameters were supplied --> file.rs:19:9 | 12 | fn bar(x, y) {} | --------------- defined here ... 19 | bar(1, 2, 3); | ^^^^^^^ expected 2 parameters ```
2017-03-11Add catch expr to AST and disallow catch as a struct nameTaylor Cramer-0/+3
2017-03-10Refactor out `ast::ItemKind::MacroDef`.Jeffrey Seyfried-9/+1
2017-02-25rustc: store type parameter defaults outside of ty::Generics.Eduard-Mihai Burtescu-22/+27
2017-01-19add exclusive range patterns under a feature gateOliver Schneider-2/+2
2017-01-17Auto merge of #39110 - petrochenkov:sum, r=eddybbors-10/+5
Merge ObjectSum and PolyTraitRef in AST/HIR + some other refactoring `ObjectSum` and `PolyTraitRef` are the same thing (list of bounds), they exist separately only due to parser quirks. The second commit merges them. The first commit replaces `Path` with `Ty` in (not yet supported) equality predicates. They are parsed as types anyway and arbitrary types can always be disguised as paths using aliases, so this doesn't add any new functionality. The third commit uses `Vec` instead of `P<[T]>` in AST. AST is not immutable like HIR and `Vec`s are more convenient for it, unnecessary conversions are also avoided. The last commit renames `parse_ty_sum` (which is used for parsing types in general) into `parse_ty`, and renames `parse_ty` (which is used restricted contexts where `+` is not permitted due to operator priorities or other reasons) into `parse_ty_no_plus`. This is the first part of https://github.com/rust-lang/rust/issues/39085#issuecomment-272743755 and https://github.com/rust-lang/rust/issues/39080 focused on data changes and mechanical renaming, I'll submit a PR with parser changes a bit later. r? @eddyb
2017-01-17Rename ObjectSum into TraitObject in AST/HIRVadim Petrochenkov-1/+1
2017-01-17AST/HIR: Merge ObjectSum and PolyTraitRefVadim Petrochenkov-5/+1
2017-01-16AST/HIR: Replace Path with Type in WhereEqPredicateVadim Petrochenkov-5/+4
2017-01-16Rename ExprKind::Vec to Array in HIR and HAIR.Scott Olson-1/+1
This is a clearer name since they represent [a, b, c] array literals.
2017-01-11syntax: struct field attributes and cfgBenjamin Saunders-0/+2
2016-12-19Optimize `ast::PathSegment`.Jeffrey Seyfried-1/+3
2016-12-18Remove `MacroDef`'s fields `imported_from` and `allow_internal_unstable`,Jeffrey Seyfried-1/+0
remove `export` argument of `resolver.add_macro()`.
2016-12-06annotate stricter lifetimes on LateLintPass methods to allow them to forward ↵Oliver Schneider-81/+94
to a Visitor
2016-11-21Implement the `loop_break_value` feature.Geoffry Song-1/+5
This implements RFC 1624, tracking issue #37339. - `FnCtxt` (in typeck) gets a stack of `LoopCtxt`s, which store the currently deduced type of that loop, the desired type, and a list of break expressions currently seen. `loop` loops get a fresh type variable as their initial type (this logic is stolen from that for arrays). `while` loops get `()`. - `break {expr}` looks up the broken loop, and unifies the type of `expr` with the type of the loop. - `break` with no expr unifies the loop's type with `()`. - When building MIR, `loop` loops no longer construct a `()` value at termination of the loop; rather, the `break` expression assigns the result of the loop. `while` loops are unchanged. - `break` respects contexts in which expressions may not end with braced blocks. That is, `while break { break-value } { while-body }` is illegal; this preserves backwards compatibility. - The RFC did not make it clear, but I chose to make `break ()` inside of a `while` loop illegal, just in case we wanted to do anything with that design space in the future. This is my first time dealing with this part of rustc so I'm sure there's plenty of problems to pick on here ^_^
2016-11-10syntax: don't fake a block around closures' bodies during parsing.Eduard Burtescu-27/+26
2016-10-01Rollup merge of #34764 - pnkfelix:attrs-on-generic-formals, r=eddybManish Goregaokar-0/+2
First step for #34761
2016-09-28libsyntax: clearer names for some AST partsJonas Schievink-3/+3
This applies the HIR changes from the previous commits to the AST, and is thus a syntax-[breaking-change] Renames `PatKind::Vec` to `PatKind::Slice`, since these are called slice patterns, not vec patterns. Renames `TyKind::Vec`, which represents the type `[T]`, to `TyKind::Slice`. Renames `TyKind::FixedLengthVec` to `TyKind::Array`.
2016-09-23Add attribute support to generic lifetime and type parameters.Felix S. Klock II-0/+2
I am using `ThinAttributes` rather than a vector for attributes attached to generics, since I expect almost all lifetime and types parameters to not carry any attributes.
2016-09-17Ensure that macro invocations are folded and visited the same order.Jeffrey Seyfried-5/+5
2016-08-29Future proof the AST for `union`.Jeffrey Seyfried-1/+2
2016-08-28Rollup merge of #35480 - KiChjang:e0379-bonus, r=nikomatsakisJeffrey Seyfried-1/+1
Move E0379 check from typeck to ast validation Part of #35233. Extension of #35338, #35364. Fixes #35404.
2016-08-27Change Constness to Spanned<Constness>Keith Yeung-1/+1
2016-08-21Refactor away variant `ast::PathListItemKind::Mod`Jeffrey Seyfried-2/+2
and refactor `ast::PathListItemKind::Ident` -> `ast::PathListItem_`.
2016-08-13Minor fixup.Andrew Cann-2/+1
2016-08-13Rename empty/bang to neverAndrew Cann-1/+1
Split Ty::is_empty method into is_never and is_uninhabited
2016-08-13Control usage of `!` through a feature gate.Andrew Cann-2/+6
Adds the `bang_type` feature gate. `!` in a non-return-type position now relies on that feature.
2016-08-13Start implementation of RFC 1216 (make ! a type)Andrew Cann-0/+1
Add `TyKind::Empty` and fix resulting build errors.
2016-08-12syntax: add anonymized type syntax, i.e. impl TraitA+TraitB.Eduard Burtescu-0/+3
2016-06-26Rollup merge of #34436 - jseyfried:no_block_expr, r=eddybJeffrey Seyfried-1/+0
To allow these braced macro invocation, this PR removes the optional expression from `ast::Block` and instead uses a `StmtKind::Expr` at the end of the statement list. Currently, braced macro invocations in blocks can expand into statements (and items) except when they are last in a block, in which case they can only expand into expressions. For example, ```rust macro_rules! make_stmt { () => { let x = 0; } } fn f() { make_stmt! {} //< This is OK... let x = 0; //< ... unless this line is commented out. } ``` Fixes #34418.
2016-06-26Rollup merge of #34339 - jseyfried:thin_vec, r=petrochenkov,ManishearthJeffrey Seyfried-4/+3
Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`.