Commit Graph

159 Commits

Author SHA1 Message Date
John Clements
9deb2f2dfa libsyntax comments only 2013-04-10 09:15:08 -07:00
Alex Crichton
255193cc1a Removing no longer needed unsafe blocks 2013-04-08 17:50:25 -04:00
Patrick Walton
1e91595520 librustc: Remove fail_unless! 2013-03-29 16:39:08 -07:00
Andrew Paseltiner
f02ee42a86 derive Eq and Clone impls where applicable 2013-03-27 22:04:23 -04:00
Patrick Walton
e7c60c141b librustc: Remove pure from libsyntax and librustc. 2013-03-22 12:57:27 -07:00
Patrick Walton
4634f7edae librustc: Remove all uses of static from functions. rs=destatic 2013-03-22 10:27:39 -07:00
Andrew Paseltiner
e2abecd3ab syntax: replace uses of old deriving attribute with new one 2013-03-22 06:30:59 -04: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
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
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
John Clements
fdf8543cf6 add nonempty encoding for spans
Before this change, encoding an object containing a codemap::span
using the JSON encodeng produced invalid JSON, for instance:
[{"span":,"global":false,"idents":["abc"]}]
Since the decoder for codemap::span's ignores its argument, I
conjecture that this will not damage decoding, and should improve
it for many decoders.
2013-03-15 08:44:21 -07:00
Patrick Walton
7538450b8d libsyntax: Remove newtype enums from libsyntax. rs=deenum 2013-03-11 09:35:59 -07:00
Alex Crichton
7f99a02ddb syntax: Remove uses of DVec 2013-03-08 09:54:20 -05:00
Patrick Walton
d7e74b5e91 librustc: Convert all uses of assert over to fail_unless! 2013-03-07 22:37:57 -08:00
Patrick Walton
239e64242c libsyntax: Stop parsing structural record types 2013-03-07 22:32:52 -08:00
Alex Crichton
dfb5c10dea Remove unused imports throughout src/ 2013-03-04 12:27:01 -05:00
Erick Tryzelaar
690caf8ab8 libsyntax: deny deprecated_self in libsyntax 2013-03-03 15:25:08 -08:00
Patrick Walton
07c3f5c0de librustc: Forbid pub or priv before trait implementations 2013-02-27 09:40:16 -08:00
Patrick Walton
a07192fadd libsyntax: Remove all mutable fields from libsyntax. rs=demuting 2013-02-22 16:09:16 -08:00
Luqman Aden
b02f5c2090 Get rid of structural records in libsyntax and the last bit in librustc. 2013-02-21 00:19:15 -08:00
Patrick Walton
bf2a225c0b librustc: Separate most trait bounds with '+'. rs=plussing 2013-02-20 21:14:20 -08:00
Patrick Walton
bb833ca0f0 librustc: Stop parsing impl Type : Trait and fix several declarations that slipped through. r=tjc 2013-02-15 16:59:56 -08:00
Luqman Aden
e244f103c9 libsyntax: Get rid of uses of move and don't parse it. 2013-02-15 02:49:55 -08:00
bors
6efa3543a8 auto merge of #4922 : jbclements/rust/add-deriving-eq-to-asts, r=catamorphism
r?

Apply deriving_eq to the data structures in ast.rs, and get rid of the custom definitions of eq that were everywhere. resulting ast.rs is about 400 lines shorter.

Also: add a few test cases and a bunch of comments.

Also: change ast_ty_to_ty_cache to use node ids rather than ast::ty's. I believe this was a suggestion related to my changes, and it appears to pass all tests.

Also: tiny doc fix, remove references to crate keywords.
2013-02-13 18:49:29 -08:00
Nick Desaulniers
4445b38df2 Remove die!, raplace invocations with fail! Issue #4524 pt 3 2013-02-13 17:01:32 -08:00
John Clements
819c6d1c04 deriving-eq all over ast 2013-02-13 15:08:27 -08:00
Niko Matsakis
a32498d846 Make ~fn non-copyable, make &fn copyable, split barefn/closure types,
correct handling of moves for struct-record update.

Part of #3678.  Fixes #2828, #3904, #4719.
2013-02-07 05:53:30 -08:00
John Clements
53688addaa test cases, cleanup 2013-01-31 23:05:12 -08:00
Nick Desaulniers
aee7929469 Replace most invocations of fail keyword with die! macro 2013-01-31 20:12:49 -08:00
Patrick Walton
366812a5c3 librustc: Change self as a type to Self everywhere. r=brson 2013-01-30 19:52:45 -08:00
Patrick Walton
95b892c8a7 libsyntax: De-export a lot of libsyntax. rs=deëxporting 2013-01-29 13:55:30 -08:00
Patrick Walton
eb4d39e1fe libstd: Remove "dual impls" from the language and enforce coherence rules. r=brson
"Dual impls" are impls that are both type implementations and trait
implementations. They can lead to ambiguity and so this patch removes them
from the language.

This also enforces coherence rules. Without this patch, records can implement
traits not defined in the current crate. This patch fixes this, and updates
all of rustc to adhere to the new enforcement. Most of this patch is fixing
rustc to obey the coherence rules, which involves converting a bunch of records
to structs.
2013-01-29 10:42:45 -08:00
Patrick Walton
54b2cad8b3 libsyntax: Remove fn() unsafe { ... }. r=graydon 2013-01-23 14:41:08 -08:00
Patrick Walton
2db3abddcd librustc: Make unqualified identifier searches terminate at the nearest module scope. r=tjc 2013-01-08 22:02:35 -08:00
Patrick Walton
44ab00ee37 Revert "librustc: Make unqualified identifier searches terminate at the nearest module scope. r=tjc"
This reverts commit a8d37af247.
2013-01-08 19:29:16 -08:00
Patrick Walton
a8d37af247 librustc: Make unqualified identifier searches terminate at the nearest module scope. r=tjc 2013-01-08 19:27:57 -08:00
Niko Matsakis
c3a74d87bd Implement GLB algorithm. (Issue #2263)
r=brson
2013-01-08 15:41:53 -08:00
Patrick Walton
57c599914a librustc: Terminate name searches at the nearest module scope for paths that contain at least two components. r=graydon 2012-12-27 10:02:54 -08:00
Erick Tryzelaar
8650c6f683 Switch from serialization to std::serialize. (snapshot) 2012-12-17 20:00:36 -08:00
Brian Anderson
9723d3ac2f Remove transitional code 2012-12-09 17:59:21 -08:00
Brian Anderson
4ab1c8805a Convert Num to explicit self 2012-12-05 19:23:13 -08:00
Patrick Walton
b8cfd5c414 librustc: Long lines. rs=rustbot 2012-12-04 21:13:02 -08:00
Patrick Walton
56ece46f7d librustc: Remove all legacy pattern bindings from libsyntax and librustc. rs=refactoring 2012-12-04 14:19:19 -08:00
Graydon Hoare
00c856c0b1 Update license, add license boilerplate to most files. Remainder will follow. 2012-12-03 17:12:14 -08:00
Graydon Hoare
d783f4d7bb libs: Remove transitionary material on iter_bytes, add workcache to build. 2012-11-30 10:33:16 -08:00
Brian Anderson
fc06114ddf Merge remote-tracking branch 'brson/companion' into incoming
Conflicts:
	src/compiletest/compiletest.rs
	src/libcargo/cargo.rs
	src/libcore/core.rs
	src/librustc/rustc.rs
	src/librustdoc/rustdoc.rc
2012-11-28 13:17:33 -08:00
Brian Anderson
8179e268ef Register snapshots 2012-11-28 12:33:00 -08:00
Patrick Walton
669fbddc44 librustc: Add explicit self to IterBytes. r=nmatsakis 2012-11-28 11:36:04 -08:00
Patrick Walton
318e534895 rustc: Implement explicit self for Eq and Ord. r=graydon 2012-11-19 15:33:11 -08:00
Brian Anderson
e621e68c60 Remove unused MultiByteChar.sum field from codemap 2012-11-16 15:52:33 -08:00
Brian Anderson
7c72fd89f1 Add some docs to codemap 2012-11-16 15:15:17 -08:00
Brian Anderson
2af088529f Remove incorrect comment from codemap 2012-11-16 14:55:52 -08:00
Brian Anderson
1ac28c36ac Remove unused types from codemap 2012-11-16 14:35:43 -08:00
Brian Anderson
4a5b28ff0c Stop tracking CodeMap offsets in the parse session. Big simplification 2012-11-16 14:22:09 -08:00
Brian Anderson
2374154ded Stop storing char positions in CodeMap 2012-11-16 14:10:17 -08:00
Brian Anderson
81d20156cd Change spans to use byte offsets instead of char offsets 2012-11-16 12:06:44 -08:00
Brian Anderson
8cba337cce Remove CodeMap.lookup_byte_pos 2012-11-15 17:32:14 -08:00
Brian Anderson
d5e35e3e87 Convert CodeMap and FileMap to use &self instead of @self 2012-11-15 15:00:49 -08:00
Brian Anderson
bcccf333ab Add some comments to codemap and lexer 2012-11-15 14:43:31 -08:00
Brian Anderson
4a0f4f5e31 Refactor the lexer to use FilePos types 2012-11-15 14:24:53 -08:00
Brian Anderson
b1dff40bae Create CodeMap.add_filemap 2012-11-14 21:56:58 -08:00
Brian Anderson
3a9ccd53e5 Factor out some position management code in the lexer 2012-11-14 21:56:55 -08:00
Brian Anderson
8069d2f266 Track character and byte positions together in the parser 2012-11-14 16:34:50 -08:00
Brian Anderson
f67bfe9738 Add types for character position and byte position in the codemap 2012-11-14 15:18:29 -08:00
Brian Anderson
9ecf86343a Camel case all the codemap types except span 2012-11-14 15:18:26 -08:00
Brian Anderson
38b9740668 Remove unused get_snippet function from codemap 2012-11-12 18:36:03 -08:00
Brian Anderson
b22f941487 Make it clearer which codemap functions use chars vs. bytes 2012-11-12 18:35:17 -08:00
Brian Anderson
2ec09c4eb9 Objectify the codemap 2012-11-12 18:24:56 -08:00
Brian Anderson
15a5d2ccbf Convert codemap from legacy_exports 2012-11-12 17:26:02 -08:00
Brian Anderson
d115944809 Remove expn_info box typedef from codemap 2012-11-12 17:19:56 -08:00
Brian Anderson
18a825bda0 Reorder codemap decls 2012-11-12 17:14:15 -08:00
Brian Anderson
5b248a6ca8 Remove CodeMap box typedef from codemap 2012-11-12 17:09:52 -08:00
Brian Anderson
385a4668e5 Reformatting in codemap 2012-11-12 16:47:17 -08:00
Brian Anderson
9fc75e8d66 Move codemap doc comments to the proper place 2012-11-12 16:45:24 -08:00
Brian Anderson
1f3303163c Move filemap ctors to static methods 2012-11-12 16:44:53 -08:00
Brian Anderson
5f881b48cb Remove filemap box typedef from codemap 2012-11-12 16:41:20 -08:00
Brian Anderson
4c68084963 Convert most codemap types from records to structs 2012-11-12 16:21:39 -08:00
Tim Chevalier
a006608276 Remove stage0 stuff that was awaiting snapshot
and re-register snapshots

Just removing unneeded code, no review
2012-11-03 14:04:32 -07:00
Patrick Walton
754704ea94 rustc: Implement intra-crate static methods on anonymous trait implementations. r=nmatsakis 2012-10-18 14:29:18 -07:00
Patrick Walton
91ae5412d8 rustc: Merge module and type namespaces. r=brson 2012-10-15 15:35:36 -07:00
Niko Matsakis
67a8e7128a Demode vec::push (and convert to method) 2012-09-26 18:02:07 -07:00
Brian Anderson
afd91f8a56 Register snapshots. Remove redundant Eq impls, Makefile hacks 2012-09-23 23:01:49 -07:00
Patrick Walton
9117dcb968 rustc: De-mode all overloaded operators 2012-09-20 09:48:05 -07:00
Niko Matsakis
cfed923600 demode the each() method on vec and other iterables. 2012-09-19 17:03:01 -07:00
Patrick Walton
feb014eb3c rustc: Add an "ne" method to the Eq trait, and implement it everywhere 2012-09-07 12:24:48 -07:00
Patrick Walton
8ff18acc82 libsyntax: "import" -> "use" 2012-09-04 11:43:23 -07:00
Patrick Walton
96534365c2 rustc: Make < and = into traits 2012-08-29 18:25:22 -07:00
Brian Anderson
161a82e433 Camel case various core constructors 2012-08-27 17:22:18 -07:00
Brian Anderson
8337fa1a54 Camel case the option type 2012-08-26 15:56:16 -07:00
Paul Stansifer
29f32b4a72 m1!{...} -> m1!(...) 2012-08-23 11:14:14 -07:00
Brian Anderson
74c69e1053 Convert more core types to camel case 2012-08-15 14:14:20 -07:00
Brian Anderson
6a0720b439 Convert impls to new syntax 2012-08-08 18:19:24 -07:00
Brian Anderson
ecaf9e39c9 Convert alt to match. Stop parsing alt 2012-08-06 15:36:30 -07:00
Brian Anderson
025d86624d Switch alts to use arrows 2012-08-05 22:08:09 -07:00
Brian Anderson
b355936b4d Convert ret to return 2012-08-01 19:16:06 -07:00
Paul Stansifer
a9cc5066ee Change syntax extension syntax: #m[...] -> m!{...}. 2012-07-30 18:38:15 -07:00
Michael Sullivan
92743dc2a6 Move the world over to using the new style string literals and types. Closes #2907. 2012-07-14 01:03:43 -07:00
Michael Sullivan
2ea9c8df0f Accept prefix notation for writing the types of str/~ and friends. 2012-07-12 16:52:26 -07:00