about summary refs log tree commit diff
path: root/src/libsyntax/fold.rs
AgeCommit message (Collapse)AuthorLines
2015-10-13Dict -> Struct, StructDef -> VariantData, def -> dataVadim Petrochenkov-6/+6
2015-10-13Provide span for visit_struct_def + remove some dead codeVadim Petrochenkov-12/+0
2015-10-13Remove now redundant NodeId from VariantVadim Petrochenkov-2/+1
2015-10-13Decouple structure kinds from NodeIdsVadim Petrochenkov-2/+3
2015-10-13Unify structures and enum variants in ASTVadim Petrochenkov-10/+2
2015-10-09Some cleanup of no longer used AST thingsNick Cameron-3/+2
2015-09-24Remove the deprecated box(PLACE) syntax.Eduard Burtescu-2/+5
2015-09-20Replace `ast::Mac_` enum with structAndrew Paseltiner-4/+4
Closes #28527.
2015-09-17Remove Visibility field from enum variantsSimonas Kazlauskas-2/+1
Followup on #28440
2015-09-03Use proper span for break and continue labelsSimonas Kazlauskas-2/+8
Fixes #28109
2015-08-10Auto merge of #27451 - seanmonstar:use-groups-as, r=alexcrichtonbors-3/+7
An implementation of [RFC 1219](https://github.com/rust-lang/rfcs/pull/1219). The RFC is not merged yet, but once merged, this could be.
2015-08-08rustc: rename multiple imports in a listSean McArthur-3/+7
2015-08-04Add a macro invocation to the type ASTJared Roesch-0/+3
Reapplied the changes from https://github.com/freebroccolo/rust/commit/dc64b731d7f66c2b43d5e5e8c721be7bd3b59540 to a clean branch of master
2015-07-26Remove `ast::LocalSource` with only one used variantmitaa-2/+1
`LocalSource` indicated wether a let binding originated from for-loop desugaring to enable specialized error messages, but for-loop expansion has changed and this is now achieved through `MatchSource::ForLoopDesugar`.
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-1/+1
2015-05-21Make various fixes:Niko Matsakis-2/+1
- add feature gate - add basic tests - adjust parser to eliminate conflict between `const fn` and associated constants - allow `const fn` in traits/trait-impls, but forbid later in type check - correct some merge conflicts
2015-05-21syntax: parse `const fn` for free functions and inherent methods.Eduard Burtescu-1/+4
2015-05-15syntax: Add unquoting ast::{Generics,WhereClause}Erick Tryzelaar-0/+3
2015-04-27Auto merge of #23606 - quantheory:associated_const, r=nikomatsakisbors-0/+11
Closes #17841. The majority of the work should be done, e.g. trait and inherent impls, different forms of UFCS syntax, defaults, and cross-crate usage. It's probably enough to replace the constants in `f32`, `i8`, and so on, or close to good enough. There is still some significant functionality missing from this commit: - ~~Associated consts can't be used in match patterns at all. This is simply because I haven't updated the relevant bits in the parser or `resolve`, but it's *probably* not hard to get working.~~ - Since you can't select an impl for trait-associated consts until partway through type-checking, there are some problems with code that assumes that you can check constants earlier. Associated consts that are not in inherent impls cause ICEs if you try to use them in array sizes or match ranges. For similar reasons, `check_static_recursion` doesn't check them properly, so the stack goes ka-blooey if you use an associated constant that's recursively defined. That's a bit trickier to solve; I'm not entirely sure what the best approach is yet. - Dealing with consts associated with type parameters will raise some new issues (e.g. if you have a `T: Int` type parameter and want to use `<T>::ZERO`). See rust-lang/rfcs#865. - ~~Unused associated consts don't seem to trigger the `dead_code` lint when they should. Probably easy to fix.~~ Also, this is the first time I've been spelunking in rustc to such a large extent, so I've probably done some silly things in a couple of places.
2015-04-25Interpolate AST nodes in quasiquote.Geoffry Song-0/+7
This changes the `ToTokens` implementations for expressions, statements, etc. with almost-trivial ones that produce `Interpolated(*Nt(...))` pseudo-tokens. In this way, quasiquote now works the same way as macros do: already-parsed AST fragments are used as-is, not reparsed. The `ToSource` trait is removed. Quasiquote no longer involves pretty-printing at all, which removes the need for the `encode_with_hygiene` hack. All associated machinery is removed. A new `Nonterminal` is added, NtArm, which the parser now interpolates. This is just for quasiquote, not macros (although it could be in the future). `ToTokens` is no longer implemented for `Arg` (although this could be added again) and `Generics` (which I don't think makes sense). This breaks any compiler extensions that relied on the ability of `ToTokens` to turn AST fragments back into inspectable token trees. For this reason, this closes #16987. As such, this is a [breaking-change]. Fixes #16472. Fixes #15962. Fixes #17397. Fixes #16617.
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-1/+1
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
2015-04-23Get associated consts working in match patterns.Sean Patrick Santos-0/+4
2015-04-23Structural changes for associated constantsSean Patrick Santos-0/+7
Introduces new variants and types in syntax::ast, middle::ty, and middle::def.
2015-04-21syntax: remove #![feature(box_syntax, box_patterns)]Erick Tryzelaar-3/+3
2015-04-11Propagate macro backtraces more often, improve formatting diagnosticsRyan Prichard-3/+5
* In noop_fold_expr, call new_span in these cases: - ExprMethodCall's identifier - ExprField's identifier - ExprTupField's integer Calling new_span for ExprMethodCall's identifier is necessary to print an acceptable diagnostic for write!(&2, ""). We see this error: <std macros>:2:20: 2:66 error: type `&mut _` does not implement any method in scope named `write_fmt` <std macros>:2 ( & mut * $ dst ) . write_fmt ( format_args ! ( $ ( $ arg ) * ) ) ) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ With this change, we also see a macro expansion backtrace leading to the write!(&2, "") call site. * After fully expanding a macro, we replace the expansion expression's span with the original span. Call fld.new_span to add a backtrace to this span. (Note that I'm call new_span after bt.pop(), so the macro just expanded isn't on the backtrace.) The motivating example for this change is println!("{}"). The format string literal is concat!($fmt, "arg") and is inside the libstd macro. We need to see the backtrace to find the println! call site. * Add a backtrace to the format_args! format expression span. Addresses #23459
2015-03-26Switch drop-flag to `u8` to allow special tags to instrument state.Felix S. Klock II-1/+1
Refactored code so that the drop-flag values for initialized (`DTOR_NEEDED`) versus dropped (`DTOR_DONE`) are given explicit names. Add `mem::dropped()` (which with `DTOR_DONE == 0` is semantically the same as `mem::zeroed`, but the point is that it abstracts away from the particular choice of value for `DTOR_DONE`). Filling-drop needs to use something other than `ptr::read_and_zero`, so I added such a function: `ptr::read_and_drop`. But, libraries should not use it if they can otherwise avoid it. Fixes to tests to accommodate filling-drop.
2015-03-11syntax: move MethMac to MacImplItem and combine {Provided,Required}Method ↵Eduard Burtescu-19/+10
into MethodTraitItem.
2015-03-11syntax: rename TypeMethod to MethodSig and use it in MethDecl.Eduard Burtescu-20/+13
2015-03-11syntax: gather common fields of impl & trait items into their respective types.Eduard Burtescu-118/+47
2015-03-11syntax: move indirection around {Trait,Impl}Item, from within.Eduard Burtescu-26/+23
2015-03-04std: Deprecate std::old_io::fsAlex Crichton-2/+2
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
2015-02-24Implement `<T>::method` UFCS expression syntax.Eduard Burtescu-11/+17
2015-02-24syntax: use a single Path for Trait::Item in QPath.Eduard Burtescu-19/+8
2015-02-24syntax: don't use TraitRef in QPath.Eduard Burtescu-4/+4
2015-02-24syntax: don't store a secondary NodeId for TyPath.Eduard Burtescu-4/+1
2015-02-22Rename DefTrait to DefaultImplFlavio Percoco-2/+2
2015-02-22Add support for default trait impls in libsyntaxFlavio Percoco-1/+4
2015-02-10rollup merge of #22116: kmcallister/cfg_attrAlex Crichton-14/+18
Fixes #22070. Fixes #19372. r? @sfackler
2015-02-09syntax::fold: Allow removing attributesKeegan McAllister-14/+18
2015-02-09Accept quantification of lifetimes outside the self type in where clauses.Nick Cameron-2/+5
Closes #20022
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-5/+5
2015-02-03Remove the explicit closure kind syntax from the parser and AST;Niko Matsakis-2/+1
upgrade the inference based on expected type so that it is able to infer the fn kind in isolation even if the full signature is not available (and we could perhaps do better still in some cases, such as extracting just the types of the arguments but not the return value).
2015-02-02`for x in xs.iter_mut()` -> `for x in &mut xs`Jorge Aparicio-2/+2
Also `for x in option.iter_mut()` -> `if let Some(ref mut x) = option`
2015-01-28Move return type an associated type of the `Fn*` traits. Mostly this ↵Niko Matsakis-2/+3
involves tweaking things in the compiler that assumed two input types to assume two ouputs; we also have to teach `project.rs` to project `Output` from the unboxed closure and fn traits.
2015-01-26Fallout of io => old_ioAlex Crichton-2/+2
2015-01-21rollup merge of #20179: eddyb/blind-itemsAlex Crichton-41/+15
Conflicts: src/librustc/diagnostics.rs src/librustdoc/clean/mod.rs src/librustdoc/html/format.rs src/libsyntax/parse/parser.rs
2015-01-21rollup merge of #21340: pshc/libsyntax-no-more-intsAlex Crichton-4/+4
Collaboration with @rylev! I didn't change `int` in the [quasi-quoter](https://github.com/pshc/rust/blob/99ae1a30f3ca28c0f7e431620560d30e44627124/src/libsyntax/ext/quote.rs#L328), because I'm not sure if there will be adverse effects. Addresses #21095.
2015-01-21syntax: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-41/+15
2015-01-18Make output type in ast::FnDecl optionalSeo Sanghyeon-8/+2
2015-01-17libsyntax: rename functions from uint to usizePaul Collier-4/+4