about summary refs log tree commit diff
path: root/src/libsyntax/ext
AgeCommit message (Collapse)AuthorLines
2014-07-08auto merge of #15493 : brson/rust/tostr, r=pcwaltonbors-33/+33
This updates https://github.com/rust-lang/rust/pull/15075. Rename `ToStr::to_str` to `ToString::to_string`. The naive renaming ends up with two `to_string` functions defined on strings in the prelude (the other defined via `collections::str::StrAllocating`). To remedy this I removed `StrAllocating::to_string`, making all conversions from `&str` to `String` go through `Show`. This has a measurable impact on the speed of this conversion, but the sense I get from others is that it's best to go ahead and unify `to_string` and address performance for all `to_string` conversions in `core::fmt`. `String::from_str(...)` still works as a manual fast-path. Note that the patch was done with a script, and ended up renaming a number of other `*_to_str` functions, particularly inside of rustc. All the ones I saw looked correct, and I didn't notice any additional API breakage. Closes #15046.
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-33/+33
[breaking-change]
2014-07-08Change DST syntax: type -> Sized?Nick Cameron-20/+18
closes #13367 [breaking-change] Use `Sized?` to indicate a dynamically sized type parameter or trait (used to be `type`). E.g., ``` trait Tr for Sized? {} fn foo<Sized? X: Share>(x: X) {} ```
2014-07-05rustc: Remove CrateId and all related supportAlex Crichton-7/+6
This commit removes all support in the compiler for the #[crate_id] attribute and all of its derivative infrastructure. A list of the functionality removed is: * The #[crate_id] attribute no longer exists * There is no longer the concept of a version of a crate * Version numbers are no longer appended to symbol names * The --crate-id command line option has been removed To migrate forward, rename #[crate_id] to #[crate_name] and only the name of the crate itself should be mentioned. The version/path of the old crate id should be removed. For a transitionary state, the #[crate_id] attribute is still accepted if the #[crate_name] is not present, but it is warned about if it is the only identifier present. RFC: 0035-remove-crate-id [breaking-change]
2014-07-04implement hygiene for ExprFnBlock and ExprProcJohn Clements-1/+15
2014-07-04added test cases for closure arg hygieneJohn Clements-0/+22
2014-07-04comments onlyJohn Clements-3/+2
2014-07-04hygiene for item fn argsJohn Clements-7/+49
also, introduce fn_decl_arg_bindings and expand_and_rename abstractions
2014-07-04comments & test cases for IdentRenamersJohn Clements-11/+63
2014-07-04use PatIdentRenamer for match bindingsJohn Clements-10/+5
2014-07-04comments onlyJohn Clements-3/+3
2014-07-04new_mark -> apply_mark, new_rename -> apply_renameJohn Clements-28/+28
2014-07-04add PatIdentRenamerJohn Clements-6/+37
2014-07-04move RenameList to mtwt, add new_renames abstractionJohn Clements-23/+40
2014-07-04comments, whitespace, rename NameFinderContext to PatIdentFinderJohn Clements-19/+15
2014-07-03simplify and uncomment item-fn-arg hygiene unit testJohn Clements-9/+6
2014-07-03Simplify creating a parser from a token treePiotr Jawniak-31/+11
Closes #15306
2014-07-03Fix spelling errors.Joseph Crail-3/+3
2014-07-03Simplify PatIdent to contain an Ident rather than a PathJohn Clements-34/+12
Rationale: for what appear to be historical reasons only, the PatIdent contains a Path rather than an Ident. This means that there are many places in the code where an ident is artificially promoted to a path, and---much more problematically--- a bunch of elements from a path are simply thrown away, which seems like an invitation to some really nasty bugs. This commit replaces the Path in a PatIdent with a SpannedIdent, which just contains an ident and a span.
2014-06-29Implement RFC#28: Add PartialOrd::partial_cmpSteven Fackler-5/+99
I ended up altering the semantics of Json's PartialOrd implementation. It used to be the case that Null < Null, but I can't think of any reason for an ordering other than the default one so I just switched it over to using the derived implementation. This also fixes broken `PartialOrd` implementations for `Vec` and `TreeMap`. RFC: 0028-partial-cmp
2014-06-28auto merge of #15233 : jbclements/rust/match-var-hygiene-etc, r=cmrbors-98/+137
This PR includes two big things and a bunch of little ones. 1) It enables hygiene for variables bound by 'match' expressions. 2) It fixes a bug discovered indirectly (#15221), wherein fold traversal failed to visit nonterminal nodes. 3) It fixes a small bug in the macro tutorial. It also adds tests for the first two, and makes a bunch of small comment improvements and cleanup.
2014-06-27comments onlyJohn Clements-1/+2
2014-06-27adjust fold to fold over interpolated items/exprs/etc.John Clements-2/+2
Closes #15221
2014-06-27added unit and standalone test for 15221, extra debugging outputJohn Clements-5/+26
2014-06-27undo helpful attempt to spell-checkJohn Clements-1/+1
Yes, that word is spelled \'memoization\'
2014-06-27remove trailing whitespaceJohn Clements-1/+1
2014-06-27hygiene for match-bound vars now implementedJohn Clements-24/+33
Closes #9384
2014-06-27improve match test case to include guardJohn Clements-4/+4
2014-06-27remove unnecessary abstractionJohn Clements-10/+5
2014-06-27cleanup and shiny new more-functional interfaceJohn Clements-55/+36
2014-06-27WIP match hygiene, compilesJohn Clements-12/+12
2014-06-27get rid of needless wrapper functionJohn Clements-14/+8
2014-06-27working on hygieneJohn Clements-12/+50
2014-06-26Remove unnecessary to_string callsPiotr Jawniak-1/+1
This commit removes superfluous to_string calls from various places
2014-06-25don't expand subexprs of for loop, just re-expand whole thing.John Clements-5/+6
Fixes #15167
2014-06-25remove misleading and unnecessary underscoresJohn Clements-2/+3
2014-06-25remove unneccessary pubs, shorten namesJohn Clements-9/+9
2014-06-25remove unneeded visit_ty methodsJohn Clements-9/+0
2014-06-25add unit test for match var hygieneJohn Clements-0/+12
2014-06-25enrich and rename crate_idents test caseJohn Clements-6/+12
2014-06-25comments onlyJohn Clements-4/+9
2014-06-25revive old commented-out test cases as ignored test cases for hygieneJohn Clements-6/+58
2014-06-25auto merge of #15160 : alexcrichton/rust/remove-f128, r=brsonbors-1/+0
The f128 type has very little support in the compiler and the feature is basically unusable today. Supporting half-baked features in the compiler can be detrimental to the long-term development of the compiler, and hence this feature is being removed.
2014-06-24Allow splicing more things in quotesKeegan McAllister-0/+16
2014-06-24Use macros to implement syntax::ext::quote::ToSourceKeegan McAllister-125/+74
This code deserves a bigger refactor, but here's a local improvement.
2014-06-24Remove the quad_precision_float feature gateAlex Crichton-1/+0
The f128 type has very little support in the compiler and the feature is basically unusable today. Supporting half-baked features in the compiler can be detrimental to the long-term development of the compiler, and hence this feature is being removed.
2014-06-23Allow trailing comma in `concat!`Stepan Koltsov-2/+5
(And in other extensions implemented with `get_exprs_from_tts` function).
2014-06-18Revert bytes!() docstring change, and fix a typo.Simon Sapin-1/+1
2014-06-18Deprecate the bytes!() macro.Simon Sapin-0/+8
Replace its usage with byte string literals, except in `bytes!()` tests. Also add a new snapshot, to be able to use the new b"foo" syntax. The src/etc/2014-06-rewrite-bytes-macros.py script automatically rewrites `bytes!()` invocations into byte string literals. Pass it filenames as arguments to generate a diff that you can inspect, or `--apply` followed by filenames to apply the changes in place. Diffs can be piped into `tip` or `pygmentize -l diff` for coloring.
2014-06-18auto merge of #14880 : SimonSapin/rust/byte-literals, r=alexcrichtonbors-0/+7
See #14646 (tracking issue) and rust-lang/rfcs#69. This does not close the tracking issue, as the `bytes!()` macro still needs to be removed. It will be later, after a snapshot is made with the changes in this PR, so that the new syntax can be used when bootstrapping the compiler.