Commit Graph

19413 Commits

Author SHA1 Message Date
bors
0409f86106 auto merge of #6938 : jbclements/rust/hygiene_fns_and_cleanup, r=jbclements
I'm close to flipping the switch on hygiene for let-bound identifiers.  This commit adds a bunch of support functions for that change... but also a huge amount of cleanup in syntax.rc. The most interesting of these are

- the use of TLS for the interners everywhere.  We had already breached the "no-global-state" dam by using TLS for encoding, and it saves a lot of code just to use it everywhere.
Also, there were many places where two or more interners were passed in attached to different structures, and the danger of having those diverge seemed greater that the danger of having a single one get big and heavy. If the interner size proves to be a problem, it should be quite simple to add a "parameterize"-like dynamic binding form--because we don't have interesting continuation operations (or tail calling, mostly) this should just be a case of a mutation followed by another later mutation. Again, this is only if the interner gets too big.

- I renamed the "repr" field of the identifier to "name". I can see the case for "repr" when there's only one field in the structure, but that's no longer the case; there's now a name and a context (both are uints).

- the interner now just maps between strings and uints, rather than between idents and uints. The former state made perfect sense when identifiers didn't have syntax contexts, but that's no longer the case.

I've run this patch against a fairly recent incoming, and it appears to pass all tests. Let's see if it can be merged....
2013-06-05 13:10:45 -07:00
bors
c5fea4a673 auto merge of #6955 : artagnon/rust/mailmap, r=brson
Write a conservative .mailmap as an example for contributors to write
their preferred names/ email addresses to.  This patch makes no
assumptions about the same author using different email addresses, and
only collects cases where the full-name of the person is spelt
differently for the same email address.  Verify with:

  $ git shortlog -se | cut -f 2 | cut -d\< -f 2 | sort | uniq -d

It only assumes that the author prefers the full-name that appears
dominantly, by number of contributions.

For the purposes of merging, a strictly alphabetical ordering is
advised.  See MAPPING AUTHORS section of git-shortlog(1) to understand
the format of this file.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-06-05 12:10:52 -07:00
John Clements
91b652695b moved TLS of sctable to ast_util, hid parameter in hygiene calls 2013-06-05 12:01:40 -07:00
John Clements
fe6baa9023 added fresh-name fn 2013-06-05 12:01:40 -07:00
John Clements
5a158f1d19 add hygiene support functions 2013-06-05 12:01:40 -07:00
John Clements
ecdb6e4722 remove unused get_ident_interner's 2013-06-05 12:01:40 -07:00
John Clements
8dad2bb281 removed unused imports (and one unused argument) 2013-06-05 12:01:39 -07:00
John Clements
367eddf5b1 remove interner field from string_reader 2013-06-05 12:01:39 -07:00
John Clements
19cbd0d284 remove interner from tt_reader 2013-06-05 12:01:39 -07:00
John Clements
be22fddba0 rand example fixup 2013-06-05 12:01:39 -07:00
John Clements
c88f337fc9 remove unused cx's 2013-06-05 12:01:39 -07:00
John Clements
04a691a511 token_to_ident takes argument by reference 2013-06-05 12:01:38 -07:00
John Clements
3203595471 interner just uses uints, not idents with syntax context 2013-06-05 12:01:38 -07:00
John Clements
ae02bf70e0 removed some interner fields 2013-06-05 12:01:38 -07:00
John Clements
1537056982 just use TLS interner 2013-06-05 12:01:37 -07:00
John Clements
22d21ab4c2 rename repr to name 2013-06-05 12:01:37 -07:00
John Clements
7266981b4c removed obsolete reference to purity 2013-06-05 12:01:37 -07:00
John Clements
e99657c7e7 parser comments 2013-06-05 12:01:37 -07:00
John Clements
b24b453e4a comments & whitespace 2013-06-05 12:01:37 -07:00
John Clements
d7638f9dba change to newer macro escape mechanism, using uints in more places 2013-06-05 12:01:36 -07:00
John Clements
77c2c0900f add renaming and sctable funs 2013-06-05 12:01:31 -07:00
Ramkumar Ramachandra
50f96c1f35 .mailmap: tolerate different names, emails in shortlog
Write a conservative .mailmap as an example for contributors to write
their preferred names/ email addresses to.  This patch makes no
assumptions about the same author using different email addresses, and
only collects cases where the full-name of the person is spelt
differently for the same email address.  Verify with:

  $ git shortlog -se | cut -f 2 | cut -d\< -f 2 | sort | uniq -d

It only assumes that the author prefers the full-name that appears
dominantly, by number of contributions.

For the purposes of merging, a strictly alphabetical ordering is
advised.  See MAPPING AUTHORS section of git-shortlog(1) to understand
the format of this file.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-06-05 23:26:00 +05:30
bors
38b1d60e0d auto merge of #6952 : artagnon/rust/contributing-wrap, r=bstrie
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-06-05 08:55:50 -07:00
Ramkumar Ramachandra
1a98726d07 Makefile.in: simplify logic for CFG_VER_HASH
git log -1 --pretty=format:'%H' is a very convoluted way of saying git
rev-parse HEAD.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-06-05 19:39:31 +05:30
Ramkumar Ramachandra
4936421031 contributing: wrap lines for readability
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-06-05 19:34:39 +05:30
bors
de3000af8f auto merge of #6948 : huonw/rust/less-alloc, r=bstrie 2013-06-05 06:46:51 -07:00
bors
e2d0a30fa2 auto merge of #6947 : Blei/rust/fix-dup-freevars, r=bstrie 2013-06-05 05:19:41 -07:00
Huon Wilson
b871c46934 syntax: Remove an unnecessary allocation. 2013-06-05 21:57:24 +10:00
Philipp Brüschweiler
c08df70f2b rust::driver: remove accidental double freevar calculation 2013-06-05 13:31:19 +02:00
bors
de82bde00d auto merge of #6944 : pcwalton/rust/multiple-patterns-in-let, r=nikomatsakis
r? @nikomatsakis
2013-06-05 04:22:34 -07:00
Patrick Walton
8114d0e950 librustc: Disallow multiple patterns from appearing in a "let" declaration.
You can still initialize multiple variables at once with "let (x, y) = (1, 2)".
2013-06-04 21:45:42 -07:00
Patrick Walton
16086ecff7 libsyntax: Remove pub impl from the language 2013-06-04 21:45:42 -07:00
bors
9873f67e94 auto merge of #6942 : thestinger/rust/cleanup, r=catamorphism
borrowed pointers already implement Eq and Ord with deep comparisons
2013-06-04 17:55:34 -07:00
bors
cf2b00dc8b auto merge of #6941 : Thiez/rust/pub_atomics, r=thestinger
As the title suggests, this marks all the fns on the impls on the atomic types in std::unstable::atomics as pub, which makes them significantly more usable (they are rather unusable otherwise).
r?
2013-06-04 16:52:34 -07:00
Daniel Micay
5148e2f78b sys: get rid of shape functions
borrowed pointers already implement Eq and Ord with deep comparisons
2013-06-04 19:00:19 -04:00
bors
c75c11a061 auto merge of #6939 : thestinger/rust/clone, r=catamorphism
`@T` and `@mut T` for `T: Const` have `DeepClone`
2013-06-04 15:58:40 -07:00
Daniel Micay
61ac5fdab7 clone: fix docstring
@T and @mut T for T: Const have DeepClone
2013-06-04 18:40:50 -04:00
Matthijs Hofstra
979b037e5a Made fns in the impls for the Atomic structs pub 2013-06-05 00:37:52 +02:00
bors
69511c219c auto merge of #6928 : Blei/rust/fix-constructors, r=bstrie
As part of #3853
2013-06-04 09:37:41 -07:00
Philipp Brüschweiler
1eb3a35094 std::util: fix missed old constructor 2013-06-04 17:29:38 +02:00
Philipp Brüschweiler
3ce75e786d std::util: Modernize NonCopyable constructor
part of #3853
2013-06-04 14:08:25 +02:00
Philipp Brüschweiler
e1c1c059c6 std::io: Modernize some constructors
Part of #3853
2013-06-04 12:47:45 +02:00
Philipp Brüschweiler
34ee63e93b std::cell: Modernize constructors
Part of #3853
2013-06-04 12:03:58 +02:00
bors
b50030718c auto merge of #6927 : jld/rust/monomorphize-abi-alignment, r=sanxiyn 2013-06-04 02:10:33 -07:00
Jed Davis
0c9510ac38 Use ABI alignment, not "preferred" alignment, to unify monomorphizations.
See the comment in the added test case for details.
2013-06-04 00:18:48 -07:00
bors
133d451715 auto merge of #6886 : jld/rust/vec-each-ret-fix, r=sanxiyn 2013-06-03 18:55:29 -07:00
bors
af418f2fd5 auto merge of #6924 : msullivan/rust/incoming, r=pcwalton 2013-06-03 17:28:33 -07:00
Michael Sullivan
d85938f7c8 Make type_is_pod handle structs correctly. Closes #6868. 2013-06-03 17:16:12 -07:00
bors
13aa18891c auto merge of #6910 : Blei/rust/fix-6698, r=pcwalton
Fixes #6698
2013-06-03 15:40:29 -07:00
bors
846545a6e1 auto merge of #6907 : steveklabnik/rust/prelude_docs, r=graydon 2013-06-03 14:37:39 -07:00