summary refs log tree commit diff
path: root/src/libsyntax/visit.rs
AgeCommit message (Collapse)AuthorLines
2018-03-17AST: Make renames in imports closer to the sourceVadim Petrochenkov-3/+4
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-3/+3
2018-03-01Support parentheses in patterns under feature gateVadim Petrochenkov-1/+2
Improve recovery for trailing comma after `..`
2018-02-24Implement multiple patterns with `|` in `if let` and `while let`Vadim Petrochenkov-4/+4
2018-02-18Change ast::Visibility to Spanned typeSeiichi Uchida-1/+1
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-25Rollup merge of #47502 - petrochenkov:label, r=eddybAlex Crichton-33/+25
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/+1
across suspension points to borrowck. Fixes #44197, #45259 and #45093.
2018-01-22AST/HIR: Add a separate structure for labelsVadim Petrochenkov-33/+25
2018-01-13Remove `impl Foo for ..` in favor of `auto trait Foo`leonardo.yvens-3/+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-21Add GenericParam, refactor Generics in ast, hir, rustdocJonas Platte-20/+22
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-14add trait aliases to ASTAlex Burka-0/+4
2017-11-30Implement RFC 2128 (use_nested_groups)Pietro Albini-23/+20
This commit adds support for nested groups inside `use` declarations, such as `use foo::{bar, sub::{baz::Foo, *}};`.
2017-11-03add `auto` keyword, parse `auto trait`, lower to HIRleonardo.yvens-1/+1
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/+1
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 ^_^