Patrick Walton
8aee0a6a29
libsyntax: Fix static
in pretty printer. rs=burningtree
2013-03-23 10:28:24 -07:00
Patrick Walton
e2fde83ce4
libsyntax: Stop parsing old lifetime syntax
2013-03-22 22:24:36 -07:00
Patrick Walton
6d81307a9b
librustc: Add explicit lifetime binders and new lifetime notation in core/std/syntax/rustc
2013-03-22 22:24:35 -07:00
Patrick Walton
68cb53672b
libsyntax: Stop parsing const
.
2013-03-22 22:24:35 -07:00
Patrick Walton
85c9fc6f8f
librustc: Remove the const
declaration form everywhere
2013-03-22 22:24:35 -07:00
Patrick Walton
eba3367404
libsyntax: Introduce the new assert!
macro; make assert
no longer a keyword
2013-03-22 22:24:34 -07:00
Patrick Walton
fa70709e07
libsyntax: Stop parsing pure
and static
2013-03-22 22:24:33 -07:00
bors
e9b077c0e9
auto merge of #5488 : pcwalton/rust/depure, r=pcwalton
2013-03-22 13:00:56 -07:00
Patrick Walton
e7c60c141b
librustc: Remove pure
from libsyntax and librustc.
2013-03-22 12:57:27 -07:00
bors
b6f9aa1fd7
auto merge of #5483 : pcwalton/rust/static-syntax, r=graydon
...
r? @nikomatsakis
2013-03-22 11:21:48 -07:00
Patrick Walton
4634f7edae
librustc: Remove all uses of static
from functions. rs=destatic
2013-03-22 10:27:39 -07:00
Alex Crichton
e93654c96d
Pass the fmt! buffer to each conversion method
...
Achieves a little more speedup and avoids allocations around some strings in
conv_str
2013-03-22 11:49:45 -04:00
Alex Crichton
1a0d212dd9
Build up the result of fmt! in a buffer instead of a vector
2013-03-22 11:49:45 -04:00
Andrew Paseltiner
999e7ef9a9
syntax: make old #[deriving_foo]
attribute obsolete
2013-03-22 07:15:13 -04:00
Andrew Paseltiner
e2abecd3ab
syntax: replace uses of old deriving attribute with new one
2013-03-22 06:30:59 -04:00
bors
d52408d46a
auto merge of #5480 : pcwalton/rust/at-const, r=pcwalton
...
r? @catamorphism
2013-03-21 20:39:51 -07:00
bors
5f2d4102c5
auto merge of #5479 : Kimundi/rust/str-dealloc, r=z0w0
...
This makes the `trim` and `substr` functions return a slice instead of an `~str`, and removes the unnecessary `Trimmable` trait (`StrSlice` already contains the same functionality).
Also moves the `ToStr` implementations for the three str types into the str module in anticipation of further untangling.
2013-03-21 19:39:53 -07:00
Patrick Walton
94327d00c6
librustc: Replace the &static
bound with 'static
2013-03-21 17:31:35 -07:00
Patrick Walton
02c49b32ca
libsyntax: Remove @const
from the language
2013-03-21 17:31:35 -07:00
Patrick Walton
d4fee24c7c
librustc: Forbid destructors from being attached to any structs that might contain non-Owned fields. r=nmatsakis
2013-03-21 17:31:34 -07:00
bors
ec8345b18a
auto merge of #5407 : jbclements/rust/add-assert-eq-macro, r=jbclements
...
Adds an assert_eq! macro that asserts that its two arguments are equal. Error messages can therefore be somewhat more informative than a simple assert, because the error message includes "expected" and "given" values.
2013-03-21 15:24:54 -07:00
Marvin Löbel
0a47cd5ef1
Un-renamed trim and substr functions.
2013-03-21 23:06:05 +01:00
Marvin Löbel
ee2f3d9673
Switched over substr and trim functions in str to be non-allocating, temporary renamed them to better track use-sites
2013-03-21 23:06:04 +01:00
Marvin Löbel
9d9a209e9a
back-renamed slice_DBG_BRWD, slice_V_DBG_BRWD -> slice, slice_DBG_UNIQ -> slice_unique
2013-03-21 14:05:57 +01:00
Marvin Löbel
a7d296f24c
renamed str::view -> slice_DBG_BRWD
...
renamed str::slice -> slice_DBG_UNIQ
changed vec slice method -> to_owned()
renamed vec view method -> slice_V_DBG_BRWD
2013-03-21 01:50:32 +01:00
John Clements
3cd65c233d
change some uses of fail_unless to assert_eq
2013-03-20 16:05:59 -07:00
Patrick Walton
9c4d804cfe
libsyntax: Never use ::<>
in the type grammar
2013-03-20 13:54:25 -07:00
John Clements
ab8e46b066
add assert_eq! macro
...
the assert_eq! macro compares its arguments and fails if they're not
equal. It's more informative than fail_unless!, because it explicitly
writes the given and expected arguments on failure.
2013-03-20 13:27:45 -07:00
bors
63a292fd86
auto merge of #5434 : apasel422/rust/deriving, r=nikomatsakis
...
This is the first step in refactoring the deriving code in libsyntax. No code is changed, just rearranged.
2013-03-20 06:45:51 -07:00
Niko Matsakis
00f97b9fb0
Refactor the self-info so that the def-id is carried in ty_self()
...
and the fn_ctxt doesn't need any self_info field at all.
Step towards fixing `fn(&self)` (cc #4846 ) to have a distinct
lifetime.
2013-03-20 06:14:53 -04:00
bors
db4dc1ffe2
auto merge of #5443 : alexcrichton/rust/less-bad-copy, r=catamorphism
...
Removes a lot of instances of `/*bad*/ copy` throughout libsyntax/librustc. On the plus side, this shaves about 2s off of the runtime when compiling `librustc` with optimizations.
Ideally I would have run a profiler to figure out which copies are the most critical to remove, but in reality there was a liberal amount of `git grep`s along with some spot checking and removing the easy ones.
2013-03-20 00:09:47 -07:00
bors
f3c879fdd8
auto merge of #5442 : pcwalton/rust/extern-block-restriction, r=pcwalton
...
r? @graydon
2013-03-19 21:57:49 -07:00
Alex Crichton
cd7f3ad22e
syntax: Removing some bad copies
2013-03-20 00:33:15 -04:00
Patrick Walton
e6f53c091e
libsyntax: Forbid use
(and most other things) within extern { ... }
blocks
2013-03-19 18:00:18 -07:00
Andrew Paseltiner
3042321b3b
syntax: split deriving module into submodules for each trait
2013-03-19 18:44:41 -04:00
bors
bc211f5032
auto merge of #5436 : alexcrichton/rust/assert-message, r=pcwalton
...
This would close #2761 . I figured that if you're supplying your own custom message, you probably don't mind the stringification of the condition to not be in the message.
2013-03-19 15:43:02 -07:00
Andrew Paseltiner
18a594f49a
syntax: move ext/deriving.rs to ext/deriving/mod.rs
2013-03-19 18:41:19 -04:00
Patrick Walton
b0bea10898
libsyntax: Accept the new [T, ..N]
style for vec.
2013-03-19 15:40:04 -07:00
Patrick Walton
049e1f9a1f
libsyntax: Accept static
instead of const
for globals
2013-03-19 14:46:27 -07:00
Patrick Walton
2e7ec80bcc
librustc: Enforce privacy for static methods.
...
This starts moving a bunch of privacy checks into the privacy
checking phase and out of resolve.
2013-03-19 13:40:48 -07:00
bors
e1888948c6
auto merge of #5426 : nikomatsakis/rust/issue-4846-lifetimes-in-expl-self, r=pcwalton
...
(this will be needed for snapshotting at some point)
r? @pcwalton
2013-03-19 12:43:14 -07:00
Alex Crichton
14df844744
Allow custom messages on assert statements
2013-03-19 14:07:00 -04:00
bors
58209910bd
auto merge of #5433 : lucab/rust/lucab/cfgspec, r=graydon
...
All current meta items types (word, name-value, list) are now
properly parsed by rustc --cfg command line. Fixes #2399
2013-03-19 10:43:24 -07:00
Luca Bruno
0a34a3f0f5
Make driver::driver::parse_cfgspecs parse any variety of meta_item
...
All current meta items types (word, name-value, list) are now
properly parsed by rustc --cfg command line. Fixes #2399
Signed-off-by: Luca Bruno <lucab@debian.org>
2013-03-19 14:02:59 +01:00
Luqman Aden
da64994f18
Fix pretty printer for fixed length vectors.
2013-03-18 17:31:42 -07:00
Luqman Aden
787f5bb0db
Now actually allow using constants in those constant expressions for [T * n].
2013-03-18 17:31:41 -07:00
Luqman Aden
42f95d055c
Allow constant expressions in [Type * n].
2013-03-18 17:31:41 -07:00
Patrick Walton
e78f2e2ac5
librustc: Make the compiler ignore purity.
...
For bootstrapping purposes, this commit does not remove all uses of
the keyword "pure" -- doing so would cause the compiler to no longer
bootstrap due to some syntax extensions ("deriving" in particular).
Instead, it makes the compiler ignore "pure". Post-snapshot, we can
remove "pure" from the language.
There are quite a few (~100) borrow check errors that were essentially
all the result of mutable fields or partial borrows of `@mut`. Per
discussions with Niko I think we want to allow partial borrows of
`@mut` but detect obvious footguns. We should also improve the error
message when `@mut` is erroneously reborrowed.
2013-03-18 17:21:16 -07:00
Patrick Walton
c4db4faefa
libsyntax: Stop parsing old lifetimes, except for the ones on data type declarations.
2013-03-18 17:21:15 -07:00
Patrick Walton
352c070365
librustc: Convert all uses of old lifetime notation to new lifetime notation. rs=delifetiming
2013-03-18 17:21:14 -07:00