about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2013-08-08auto merge of #8245 : alexcrichton/rust/fmt2, r=graydonbors-1/+726
This is a reopening of #8182, although this removes any abuse of the compiler internals. Now it's just a pure syntax extension (hard coded what the attribute names are).
2013-08-07Forbid `priv` where it has no effectAlex Crichton-6/+23
This is everywhere except struct fields and enum variants.
2013-08-07Add initial support for a new formatting syntaxAlex Crichton-1/+726
The new macro is available under the name ifmt! (only an intermediate name)
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-18/+18
2013-08-07Enable privacy check for enum methods.Michael Woerister-22/+22
2013-08-07auto merge of #8285 : huonw/rust/deriving+++, r=alexcrichtonbors-16/+47
Some general clean-up relating to deriving: - `TotalOrd` was too eager, and evaluated the `.cmp` call for every field, even if it could short-circuit earlier. - the pointer types didn't have impls for `TotalOrd` or `TotalEq`. - the Makefiles didn't reach deep enough into libsyntax for dependencies. (Split out from https://github.com/mozilla/rust/pull/8258.)
2013-08-06auto merge of #8313 : msullivan/rust/cleanup, r=catamorphismbors-5/+5
2013-08-05auto merge of #8278 : cmr/rust/workaround, r=brsonbors-4/+11
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-28/+28
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
2013-08-05Fix an unused variable warning and clean up some dead code/names.Michael Sullivan-1/+1
2013-08-05Make node_id_to_str print more useful info in some cases. Closes #2410.Michael Sullivan-4/+4
2013-08-04syntax: make #[deriving(TotalOrd)] lazy.Huon Wilson-16/+47
Previously it would call: f(sf1.cmp(&of1), f(sf2.cmp(&of2), ...)) (where s/of1 = 'self/other field 1', and f was std::cmp::lexical_ordering) This meant that every .cmp subcall got evaluated when calling a derived TotalOrd.cmp. This corrects this to use let test = sf1.cmp(&of1); if test == Equal { let test = sf2.cmp(&of2); if test == Equal { // ... } else { test } } else { test } This gives a lexical ordering by short-circuiting on the first comparison that is not Equal.
2013-08-04rm obsolete `for` support from the compilerDaniel Micay-12/+2
2013-08-03remove obsolete `foreach` keywordDaniel Micay-204/+199
this has been replaced by `for`
2013-08-03Work around #8256, do not fail the task, just return NoneCorey Richardson-4/+11
2013-08-03auto merge of #8206 : omasanori/rust/blk-to-block, r=graydonbors-35/+35
Just for consistency.
2013-08-03make `for` parse as `foreach` doesDaniel Micay-6/+5
Closes #6997
2013-08-03replace all remaining `for` with `foreach` or `do`Daniel Micay-52/+61
2013-08-02librustc: Disallow "unsafe" for external functionsPatrick Walton-10/+22
2013-08-02librustc: Introduce a new visitor type based on traits and port syntax to it.Patrick Walton-918/+2070
This is preparation for removing `@fn`. This does *not* use default methods yet, because I don't know whether they work. If they do, a forthcoming PR will use them. This also changes the precedence of `as`.
2013-08-02auto merge of #8188 : huonw/rust/cfg-macro, r=pcwaltonbors-0/+48
Example: if cfg!(test) { calculation_to_run_only_when_testing(); } Closes #8130.
2013-08-02replace `range` with an external iteratorDaniel Micay-16/+10
2013-08-02Replace 'blk' -> 'block' in AstBuilder.OGINO Masanori-35/+35
I didn't rename variables because they are local and are not parts of the public interfaces. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-08-01auto merge of #8170 : brson/rust/nopipes, r=pcwaltonbors-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` protcol and the unbounded `stream` protocol 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. Concerned parties may include: @graydon, @pcwalton, @eholk, @bblum The most likely candidates for closing are #7666, #3018, #3020, #7021, #7667, #7303, #3658, #3295.
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.