summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2013-08-01Remove the pipes compilerBrian Anderson-1160/+3
The pipes compiler produced data types that encoded efficient and safe bounded message passing protocols between two endpoints. It was also capable of producing unbounded protocols. It was useful research but was arguably done before its proper time. I am removing it for the following reasons: * In practice we used it only for producing the `oneshot` and `stream` unbounded protocols and all communication in Rust use those. * The interface between the proto! macro and the standard library has a large surface area and was difficult to maintain through language and library changes. * It is now written in an old dialect of Rust and generates code which would likely be considered non-idiomatic. * Both the compiler and the runtime are difficult to understand, and likewise the relationship between the generated code and the library is hard to understand. Debugging is difficult. * The new scheduler implements `stream` and `oneshot` by hand in a way that will be significantly easier to maintain. This shouldn't be taken as an indication that 'channel protocols' for Rust are not worth pursuing again in the future.
2013-08-01std: Change `Times` trait to use `do` instead of `for`blake2-ppc-3/+3
Change the former repetition:: for 5.times { } to:: do 5.times { } .times() cannot be broken with `break` or `return` anymore; for those cases, use a numerical range loop instead.
2013-08-01syntax: implement cfg!() which evaluates to true/false where #[cfg] would ↵Huon Wilson-0/+48
keep/remove. Example: if cfg!(test) { calculation_to_run_only_when_testing(); }
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-152/+151
2013-07-31auto merge of #8162 : thestinger/rust/no-copy, r=brsonbors-115/+84
2013-08-01convert `pure` to a reserved keywordDaniel Micay-31/+31
2013-08-01make `in` and `foreach` get treated as keywordsDaniel Micay-26/+26
2013-07-31remove `copy` as a keywordDaniel Micay-70/+68
2013-07-31rm ancient error for lowercase kindsDaniel Micay-32/+3
3 of these kinds no longer even exist in the CamelCase form
2013-07-31auto merge of #8150 : dotdash/rust/assert_bloat, r=huonwbors-1/+1
Assertions without a message get a generated message that consists of a prefix plus the stringified expression that is being asserted. That prefix is currently a unique string, while a static string would be sufficient and needs less code.
2013-07-31Reduce code bloat from assert!()Björn Steinbrink-1/+1
Assertions without a message get a generated message that consists of a prefix plus the stringified expression that is being asserted. That prefix is currently a unique string, while a static string would be sufficient and needs less code.
2013-07-30rustc: fix a pp bug.Graydon Hoare-0/+1
2013-07-30syntax: implement foreach .. in .. { .. } via desugaring.Graydon Hoare-2/+193
2013-07-30syntax: add temporary 'foreach' keyword.Graydon Hoare-0/+3
2013-07-30syntax: add 'in' keywordGraydon Hoare-0/+3
2013-07-30Added str::char_offset_iter() and str::rev_char_offset_iter()Marvin Löbel-1/+1
Renamed bytes_iter to byte_iter to match other iterators Refactored str Iterators to use DoubleEnded Iterators and typedefs instead of wrapper structs Reordered the Iterator section Whitespace fixup Moved clunky `each_split_within` function to the one place in the tree where it's actually needed Replaced all block doccomments in str with line doccomments
2013-07-30auto merge of #8107 : michaelwoerister/rust/end_of_spanned, r=cmrbors-158/+153
Contiunation of naming cleanup in `libsyntax::ast`: ```rust ast::node_id => ast::NodeId ast::local_crate => ast::LOCAL_CRATE ast::crate_node_id => ast::CRATE_NODE_ID ast::blk_check_mode => ast::BlockCheckMode ast::ty_field => ast::TypeField ast::ty_method => ast::TypeMethod ``` Also moved span field directly into `TypeField` struct and cleaned up overlooked `ast::CrateConfig` renamings from last pull request. Cheers, Michael
2013-07-29New naming convention for ast::{node_id, local_crate, crate_node_id, ↵Michael Woerister-158/+153
blk_check_mode, ty_field, ty_method}
2013-07-29auto merge of #8085 : mrordinaire/rust/percent-p, r=huonwbors-0/+2
pull request for #8011
2013-07-29Added %p directive to fmt!, which expects *T as argumentDo Nhat Minh-0/+2
2013-07-28Add support for `..base` on static struct initializers.Kevin Mehall-1/+1
2013-07-27auto merge of #8076 : omasanori/rust/cleanup, r=huonwbors-3/+0
A cleanup suggested on #7922.
2013-07-27auto merge of #8060 : Blei/rust/fix-obsolete-extern-visibility-span, r=pcwaltonbors-1/+1
2013-07-27Remove unnecessary #[path = "***/mod.rs"] lines.OGINO Masanori-3/+0
Fixes #7922. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-07-26syntax: fix span for obsolete extern visibility errorPhilipp Brüschweiler-1/+1
2013-07-26auto merge of #8037 : graydon/rust/issue-6416, r=cmrbors-9/+24
Errors only turn into failures in the parser when you force them.
2013-07-25auto merge of #8027 : ↵bors-1/+0
nikomatsakis/rust/issue-4846-multiple-lifetime-parameters-1, r=pcwalton Small step towards #4846. r? @msullivan
2013-07-25syntax: Fix #6416 by aborting on errors after test parse.Graydon Hoare-9/+24
2013-07-24Generalize the `ty::substs` struct so that it can representNiko Matsakis-1/+0
multiple lifetime parameters, and not just one. Also add an option for erasing lifetimes, which makes trans code somewhat simpler and cleaner.
2013-07-24Disallow non-comma-delimited arguments to fmt! and bytes!Birunthan Mohanathas-6/+7
Closes #4982.
2013-07-24Change 'print(fmt!(...))' to printf!/printfln! in src/lib*Birunthan Mohanathas-9/+7
2013-07-22auto merge of #7873 : sstewartgallus/rust/cleanup_syntax, r=alexcrichtonbors-100/+100
2013-07-22auto merge of #7940 : cmr/rust/comments, r=pnkfelixbors-8/+12
2013-07-22De-spanned<T> and renamed ast::field (now ast::Field)Michael Woerister-27/+25
2013-07-22Ast spanned<T> refactoring, renaming: crate, local, blk, crate_num, crate_cfg.Michael Woerister-185/+181
`crate => Crate` `local => Local` `blk => Block` `crate_num => CrateNum` `crate_cfg => CrateConfig` Also, Crate and Local are not wrapped in spanned<T> anymore.
2013-07-22auto merge of #7926 : brson/rust/issue-4116, r=graydonbors-12/+25
When loading a module the parser will look for either foo.rs or foo/mod.rs and generate an error when both are found.
2013-07-21auto merge of #7955 : thestinger/rust/snapshot, r=huonwbors-9/+0
2013-07-22new snapshotDaniel Micay-9/+0
2013-07-21auto merge of #7938 : crabtw/rust/foreign-vis, r=huonwbors-2/+2
2013-07-21Cleanup libsyntax a bitSteven Stewart-Gallus-100/+100
2013-07-21Merge pull request #7936 from thestinger/cleanupDaniel Micay-2/+0
rm obsolete no-op lints
2013-07-21syntax: Bless mod.rs. #4116Brian Anderson-12/+25
When loading a module the parser will look for either foo.rs or foo/mod.rs and generate an error when both are found.
2013-07-21Doc for ast::PathCorey Richardson-8/+12
2013-07-21syntax: print visibilities of foreign itemsJyun-Yan You-2/+2
2013-07-20auto merge of #7902 : huonw/rust/attr++, r=cmr,pcwaltonbors-438/+441
This does a number of things, but especially dramatically reduce the number of allocations performed for operations involving attributes/ meta items: - Converts ast::meta_item & ast::attribute and other associated enums to CamelCase. - Converts several standalone functions in syntax::attr into methods, defined on two traits AttrMetaMethods & AttributeMethods. The former is common to both MetaItem and Attribute since the latter is a thin wrapper around the former. - Deletes functions that are unnecessary due to iterators. - Converts other standalone functions to use iterators and the generic AttrMetaMethods rather than allocating a lot of new vectors (e.g. the old code would have to allocate a new vector to use functions that operated on &[meta_item] on &[attribute].) - Moves the core algorithm of the #[cfg] matching to syntax::attr, similar to find_inline_attr and find_linkage_metas. This doesn't have much of an effect on the speed of #[cfg] stripping, despite hugely reducing the number of allocations performed; presumably most of the time is spent in the ast folder rather than doing attribute checks. Also fixes the Eq instance of MetaItem_ to correctly ignore spans, so that `rustc --cfg 'foo(bar)'` now works.
2013-07-20librustc: Remove `pub extern` and `priv extern` from the language.Patrick Walton-6/+19
Place `pub` or `priv` on individual items instead.
2013-07-20rm obsolete no-op lintsDaniel Micay-2/+0
2013-07-20syntax: modernise attribute handling in syntax::attr.Huon Wilson-438/+441
This does a number of things, but especially dramatically reduce the number of allocations performed for operations involving attributes/ meta items: - Converts ast::meta_item & ast::attribute and other associated enums to CamelCase. - Converts several standalone functions in syntax::attr into methods, defined on two traits AttrMetaMethods & AttributeMethods. The former is common to both MetaItem and Attribute since the latter is a thin wrapper around the former. - Deletes functions that are unnecessary due to iterators. - Converts other standalone functions to use iterators and the generic AttrMetaMethods rather than allocating a lot of new vectors (e.g. the old code would have to allocate a new vector to use functions that operated on &[meta_item] on &[attribute].) - Moves the core algorithm of the #[cfg] matching to syntax::attr, similar to find_inline_attr and find_linkage_metas. This doesn't have much of an effect on the speed of #[cfg] stripping, despite hugely reducing the number of allocations performed; presumably most of the time is spent in the ast folder rather than doing attribute checks. Also fixes the Eq instance of MetaItem_ to correctly ignore spaces, so that `rustc --cfg 'foo(bar)'` now works.
2013-07-18librustc: Forbid `&` pointers (other than `&'static`) inside `@` boxes.Patrick Walton-3/+2
This makes custom borrowing implementations for custom smart pointers sound.
2013-07-18Silence various warnings in bootstrap build.Felix S. Klock II-8/+1