Commit Graph

930 Commits

Author SHA1 Message Date
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
Lindsey Kuper
816cb8c535 Rename identifiers that still use 'alt' to use 'match'
This'll be less confusing for anyone who works on match in future.
2013-01-08 14:31:58 -05:00
Patrick Walton
fa96740923 librustc: Remove some string allocations. rs=perf 2013-01-05 19:33:37 -08:00
Tim Chevalier
89acd1f57f Rename option::get_default => get_or_default, get_zero => get_or_zero 2013-01-04 16:01:26 -08:00
Patrick Walton
e26ca35b08 librustc: Fix the test runner, the condition system, and core test. rs=bustage 2012-12-27 17:53:04 -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
Michael Neumann
2b6c456bf6 Enhance auto_encode to take number of struct fields
emit_struct and read_struct takes an additional len:uint parameter which tells
us how many fields the struct we are working on has.

This is required to implement an Encoder for the msgpack [1] serialization
format. To serialize a struct with msgpack you have to use arrays and the size
of the array has to be know before each of the elements are written out. JSON
as an example doesn't have this problem as it uses '[' and ']' delimiters for
arrays.

[1]: www.msgpack.org
2012-12-27 06:16:16 -06:00
Graydon Hoare
329316ce15 bump 0.5 => 0.6, redirect some URLs in docs. 2012-12-24 18:29:01 -08:00
Graydon Hoare
dbd36111fe bump 0.5 => 0.6, redirect some URLs in docs. 2012-12-21 15:35:49 -08:00
Erick Tryzelaar
c14105bb8a Remove serialize::traits submodule. 2012-12-19 18:16:20 -08:00
Erick Tryzelaar
9c673b246c Remove the old serialization code
Closes #3713.
2012-12-19 18:16:20 -08:00
Brian Anderson
dac88fa7e6 Remove transitional path2 attribute 2012-12-19 14:23:53 -08:00
Graydon Hoare
8e28f23c60 core: add macro_rules! for "condition! { c: in -> out; }". 2012-12-18 17:22:27 -08:00
Brian Anderson
9057e98a01 Make #[path] work with absolute paths again. Fix check-fast 2012-12-18 17:00:26 -08:00
Brian Anderson
a59747cd7f Another tweak to auto_encode to only use trait-qualified static methods 2012-12-18 15:38:34 -08:00
Brian Anderson
b46e25bdc8 Merge commit 'erickt/incoming^' into kind-names 2012-12-18 12:22:59 -08:00
Brian Anderson
c704d26c8c Change auto_encode to call 'std::serialize::traits::Decode::decode' 2012-12-18 12:04:26 -08:00
Erick Tryzelaar
85bb1fc2c4 Change iter::find's closure to take a ref 2012-12-17 22:01:38 -08:00
Erick Tryzelaar
8650c6f683 Switch from serialization to std::serialize. (snapshot) 2012-12-17 20:00:36 -08:00
Brian Anderson
33a8f855c2 Make the path and path2 attributes equivalent. Remove some uses 2012-12-17 18:06:52 -08:00
Jakub Wieczorek
1968cb315a Add support for destructuring vectors in match expressions 2012-12-17 16:50:40 -08:00
Erick Tryzelaar
786c143a70 Begin renaming serialization to std::serialize. (snapshot) 2012-12-13 18:16:31 -08:00
Patrick Walton
cd120736cb librustc: Allow moves out of self. r=nmatsakis 2012-12-13 15:49:07 -08:00
Patrick Walton
9d23029648 libsyntax: Implement deriving for struct-like enum variants. r=brson 2012-12-13 14:55:11 -08:00
Patrick Walton
4c2e4c37ce librustc: Make use statements crate-relative by default. r=brson 2012-12-13 13:05:22 -08:00
Graydon Hoare
3c8dca429a syntax: normalize paths when parsing, close #4173. 2012-12-13 12:04:27 -08:00
Graydon Hoare
9a4c669867 syntax: remove remaining #syntaxext machinery. Close #3516. 2012-12-12 17:08:09 -08:00
Graydon Hoare
e24ae85025 syntax: remove most code handling old-style syntax extensions. 2012-12-12 15:02:47 -08:00
Graydon Hoare
9cced55b93 syntax: remove all remaining uses of #ast, and #ast / qquote itself. 2012-12-12 15:02:47 -08:00
Tim Chevalier
b0a01f2563 re-fix typo 2012-12-11 19:22:45 -08:00
Graydon Hoare
35209cb9ec fix long line, r=tidypolice. 2012-12-11 16:04:58 -08:00
Brian Anderson
7d556e18b0 Fix deriving for single-variant enums 2012-12-11 15:41:16 -08:00
Brian Anderson
6e38e334de Relate the module hierarchy to directory paths in the parser
Introduces a temporary 'path2' attribute that will replace 'path' after
a snapshot
2012-12-11 15:00:23 -08:00
Tim Chevalier
94a76843f4 Revert "Merge pull request #4144 from luqmana/deprecated-attribute"
This reverts commit f675b97ddc, reversing
changes made to e7dd3af970.
2012-12-11 12:28:30 -08:00
Tim Chevalier
f675b97ddc Merge pull request #4144 from luqmana/deprecated-attribute
Add deprecated attribute.
2012-12-10 21:16:20 -08:00
Tim Chevalier
0046ed9462 Remove un-needed code for obsolete classes
and rename "class" to "struct" everywhere possible (except local
vars, I was too lazy for that) -- that is why this commit is so
big.

No review, just dead code removal and renaming.

Closes #3515
2012-12-10 18:45:01 -08:00
Brian Anderson
3fcdb7d6a7 Adjust the die macro to only accept ~str and to work in statement position 2012-12-10 18:16:22 -08:00
Graydon Hoare
12c32e944d Add license boilerplate to more files. 2012-12-10 17:32:58 -08:00
Brian Anderson
9723d3ac2f Remove transitional code 2012-12-09 17:59:21 -08:00
Luqman Aden
4b4c8331bb Add deprecated attribute. 2012-12-09 02:26:12 -05:00
Patrick Walton
98fdcb0b9d librustc: De-mode pattern bindings. r=nmatsakis 2012-12-07 19:34:57 -08:00
Patrick Walton
184f5102b3 libsyntax: Fix parsing of module-qualified structure patterns. rs=bugfix 2012-12-07 19:10:16 -08:00
Patrick Walton
ab3b752906 librustc: Implement "&mut [T]" as an expression. r=brson 2012-12-07 18:29:10 -08:00
Brian Anderson
87f3ea7705 Fix pretty-printing of trait constraints 2012-12-07 17:55:34 -08:00
Brian Anderson
10c9d7921d Trait constraints are separated by space, not comma 2012-12-07 15:54:17 -08:00
Brian Anderson
ecdc8aae41 Remove impl_id from trait_ref. Unused 2012-12-07 15:54:17 -08:00
Graydon Hoare
d78053ecb0 syntax: try to fix pattern printing yet again, r=burningtree. 2012-12-07 14:39:47 -08:00
Graydon Hoare
28cce241dc syntax: try to fix pattern printing harder, r=burningtree. 2012-12-07 12:52:01 -08:00
Graydon Hoare
5bdbfa41e6 syntax: pretty print bind_by_value patterns as "copy", r=burningtree. 2012-12-07 12:29:46 -08:00
Graydon Hoare
09573ea8cf syntax: stage0-guard uses of #ast, rewrite as quote_foo! in stage1,2. 2012-12-07 11:21:14 -08:00
Graydon Hoare
a6fcfd726b syntax: fix missing push in item macro expansion 2012-12-07 11:21:14 -08:00
Graydon Hoare
70e0c6e27d syntax: Permit splicing anything into a quote that implements ToTokens. 2012-12-07 11:21:14 -08:00
Graydon Hoare
7e9872058e syntax: fix quote_type! to quote_ty! 2012-12-07 11:21:14 -08:00
Graydon Hoare
d45cb27901 syntax: point quote tokens at the site of quote-using-extension invocation. 2012-12-07 11:21:14 -08:00
Graydon Hoare
9f27bf7deb syntax: fix the accidental binding of interner state between parse and quote. 2012-12-07 11:21:14 -08:00
Graydon Hoare
65db4315ab syntax: fix a pp bug on foreign mods. 2012-12-07 11:21:14 -08:00
Tim Chevalier
58a4a3700d Revert "Print copy patterns correctly"
This reverts commit ea6819637382e7f8979766b954dd2a1922d0dee0.
2012-12-06 22:36:32 -08:00
Tim Chevalier
f070e22360 Print copy patterns correctly 2012-12-06 21:53:25 -08:00
Brian Anderson
4ab1c8805a Convert Num to explicit self 2012-12-05 19:23:13 -08:00
Patrick Walton
1282fc8074 librustc: Hook borrow check loan checking up to the moves-based-on-type infrastructure. rs=helps-unbreak-the-build 2012-12-05 15:07:48 -08:00
Patrick Walton
b8cfd5c414 librustc: Long lines. rs=rustbot 2012-12-04 21:13:02 -08:00
Patrick Walton
33c1e47c1b librustc: Implement moves based on type. r=nmatsakis 2012-12-04 15:38:04 -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
94be145169 core: rename box to managed. Close #4079. 2012-12-03 17:45: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
Patrick Walton
f34833abfc librustc: Make a.b() always a method call. r=nmatsakis 2012-11-30 20:41:46 -08:00
Tim Chevalier
daf28a421a Disallow dereferencing enum types when the variant is private
If an enum type's only variant is private, disallow dereferencing
values of its type.

Due to #4082, this only applies to enums that are in the same crate.

r=pcwalton

Closes #818
2012-11-30 12:45:10 -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
3ed9fbd63c impls of traits cannot define methods on the anonymous trait 2012-11-29 22:07:49 -08:00
Patrick Walton
a0617eae68 librustc: Eliminate most expressions of the form a.b() that are not method calls. rs=refactoring 2012-11-29 17:51:56 -08:00
Graydon Hoare
ce24d37759 syntax: slight improvement in fidelity of printing tokens. Still not great. 2012-11-29 12:09:11 -08:00
Paul Stansifer
7051d622c0 Properly sync macro_parser.rs after it escapes out to the Rust parser. Closes #3201. 2012-11-29 12:09:11 -08:00
Paul Stansifer
9ff8d18766 Fix trace_macros so that it works. 2012-11-29 12:09:11 -08:00
Paul Stansifer
15e03e1e5e Forbid attrs on macros, since we don't handle them properly yet. 2012-11-29 12:09:11 -08:00
Paul Stansifer
6174a30d7c Respect semicolons always when expanding statments. 2012-11-29 12:09:11 -08:00
Paul Stansifer
45bcb10204 Forbid item macros from occuring where statement macros might occur, and allow item macros to look like statement/expr macros. 2012-11-29 12:09:10 -08:00
Paul Stansifer
0f707f42c8 Distinguish stmt_macs that are followed by semicolons and those that aren't. 2012-11-29 12:09:10 -08:00
Paul Stansifer
e77491bd87 Make the parser handle stmt macros that might be exprs at the end of blocks. 2012-11-29 12:09:10 -08:00
Paul Stansifer
bd92499c5e Allow parsing of macros in statement position. 2012-11-29 12:09:10 -08:00
Paul Stansifer
9814e58815 No longer parse the delimiters of the RHS of a macro as part of the expansion. 2012-11-29 12:09:10 -08:00
Paul Stansifer
ba354b1726 Allow the expansion of old-style expr macros in stmt position. 2012-11-29 12:09:10 -08:00
Paul Stansifer
b7fcc9b52e Use biased_match! to avoid over-deep indentation in expand.rs. 2012-11-29 12:09:10 -08:00
Paul Stansifer
cf26a7d7b9 Make it possible to expand stmt macros. 2012-11-29 12:09:10 -08:00
Paul Stansifer
ee076f63f9 Allow for macros to occur in statement position. 2012-11-29 12:09:10 -08:00
Paul Stansifer
fca52554e7 Make it possible to invoke item macros without passing identifier arguments. 2012-11-29 12:09:10 -08:00
Paul Stansifer
cafea5ecb6 Grammaticalinate an error message. 2012-11-29 12:09:10 -08:00
Paul Stansifer
9845a4be5a Allow macro_rules! macros to expand to expressions or items. 2012-11-29 12:09:10 -08:00
Patrick Walton
c946c87b6f libsyntax: Remove the "by-mutable-ref" obsolete syntax error; it blocks useful function argument patterns. Add a test for the latter. r=brson 2012-11-29 12:06:36 -08:00
Brian Anderson
5a282ec26f core: Convert some records to structs 2012-11-28 21:50:09 -08:00
Brian Anderson
65bd40e300 Remove uses of #[merge] 2012-11-28 17:09:26 -08:00
Brian Anderson
16f72df704 Merge remote-tracking branch 'erickt/time'
Conflicts:
	src/libstd/time.rs
2012-11-28 14:49:58 -08:00
Brian Anderson
42c2c2ab2f Remove parser hack 2012-11-28 14:39:48 -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
07f4031bb4 libsyntax: Implement a macro die! to replace the fail expression. r=brson 2012-11-28 11:28:56 -08:00
Patrick Walton
61cfec3c52 librustc: Parse extern "C" { ... }. r=brson 2012-11-28 11:28:16 -08:00
Patrick Walton
1c348e6e38 librustc: Implement @mut [T] as the new replacement for @[mut T] 2012-11-27 09:23:31 -08:00
Erick Tryzelaar
32763caa60 auto_serialize should use explicit refs (fixes #4044) 2012-11-26 22:31:48 -08:00
Brian Anderson
be6613e048 Remove the crate language 2012-11-26 18:13:54 -08:00
Brian Anderson
81a79603c0 Add a temporary hack to divert the parser to an alternate file 2012-11-26 18:13:54 -08:00
Brian Anderson
58e26243a7 syntax: Add a hack to support the int-template pattern 2012-11-26 18:13:54 -08:00
Patrick Walton
e6d87a3ef4 libsyntax: Implement deriving correctly for type-parameterized structs and enums. r=brson 2012-11-21 10:27:37 -08:00
Patrick Walton
57588edf3b libsyntax: Implement deriving via a syntax extension for the IterBytes trait. r=brson 2012-11-21 10:27:34 -08:00
Patrick Walton
b053f0b5e6 libsyntax: Fix duplication of items that occurs if #[deriving_eq] is applied to a non-enum/non-struct. r=brson 2012-11-21 10:27:30 -08:00
Patrick Walton
e0876fdfc1 libsyntax: Implement deriving for enums with N-ary variants. r=brson 2012-11-21 10:27:13 -08:00
Graydon Hoare
497a8b54b5 syntax: switch tt quoter to emit ~[tt], not tt. 2012-11-20 16:08:05 -08:00
Patrick Walton
ba01cd7fb0 libsyntax: Long line. rs=make-tidy 2012-11-20 11:59:20 -08:00
Patrick Walton
a7aecc46a5 rustc: Implement "deriving" for monomorphic structs via a syntax extension. r=brson 2012-11-20 11:58:19 -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
9bed0ddb0e Fix parsing of interpolated paths 2012-11-19 14:00:39 -08:00
Brian Anderson
371be3c6c4 Remove unused file_type enum from the parser 2012-11-18 18:09:41 -08:00
Brian Anderson
74b2e99797 Report errors better when failing to open files for sub-parsers 2012-11-18 18:09:41 -08:00
Brian Anderson
72cc1aca17 Parse file mods from .rs files 2012-11-18 18:09:41 -08:00
Brian Anderson
ddbff6fd2a syntax: Remove cdir_syntax. Unused 2012-11-18 18:09:41 -08:00
Brian Anderson
a41903d234 Remove some unused code from lexer 2012-11-18 15:00:21 -08:00
Brian Anderson
1a1e99c27d Merge remote-tracking branch 'brson/codemap'
Conflicts:
	src/libsyntax/ext/source_util.rs
2012-11-17 18:38:39 -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
Graydon Hoare
5005be67cc syntax: rename quote! to quote_tokens!, add quote_{expr,type,item,pat,stmt}!
r=brson, Close #3976.
2012-11-16 14:50:49 -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
Patrick Walton
32ad4ae4cd librustc: Require the #[derivable] attribute, remove the significance of "impl Foo : Bar;", and allow only a subset of methods in a trait to be derived. r=brson 2012-11-14 11:36:55 -08:00
Graydon Hoare
ac0fd0ddc9 rustc: fix pp build breakage. 2012-11-13 10:54:10 -08:00
Patrick Walton
db9f8db741 librustc: Implement deriving with a unit return type. r=tjc 2012-11-13 10:37:58 -08:00
Graydon Hoare
c6d0117bf6 rustc: add new token-tree based quasiquoter. 2012-11-13 08:57:31 -08:00
Graydon Hoare
12b212f38c rustc: Remove the case of foo![...] as invocation syntax. foo!(...) and foo!{...} only. 2012-11-13 08:57:31 -08:00
Graydon Hoare
f7960ac549 Revert "m1!{...} is now forbidden. Use m1!(...) instead."
This reverts commit 89bbaff84f.
2012-11-13 08:57:31 -08:00
Graydon Hoare
4e1ce014c8 cleanup: convert some remaining #foo invocations to foo! form. 2012-11-13 08:57:31 -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
Patrick Walton
fe02814a63 rustc: Implement floating point literal inference. r=nmatsakis 2012-11-12 10:39:08 -08:00
Patrick Walton
0fc952372a rustc: Support irrefutable patterns in function arguments. r=nmatsakis 2012-11-07 19:29:30 -08:00
Niko Matsakis
b0ed151539 Cleanup how we handle proto in types, remove unsound subtyping
Fixes #1896 which was never truly fixed, just masked.
The given tests would have failed had they used `~fn()` and
not `@fn()`.  They now result in compilation errors.

Fixes #2978.

Necessary first step for #2202, #2263.
2012-11-06 08:56:29 -08:00
Patrick Walton
be93b29d30 rustc: Implement parsing and typechecking for "once fn" 2012-11-05 13:17:02 -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
Brian Anderson
762101b72a syntax: Fold macros in default methods. Closes #3911 2012-11-02 23:11:36 -07:00
Tim Chevalier
4876eb708c Fix #1996 (pending snapshot)
Change int to uint in some extfmt code. Remove the #[cfg(stage0)] code
after a snapshot.
2012-11-02 12:01:38 -07:00
Brian Anderson
3edccc311e Support #[cfg] on methods 2012-11-01 15:48:50 -07:00
Tim Chevalier
4e5865f2ad Fix #1458 (allow paren'd exprs to be the operator in a do)
Closes #1458
2012-10-30 15:06:13 -07:00
Tim Chevalier
62f98c8ff8 Preserve parenthesization in the AST
Maintain explicit "paren" nodes in the AST so we can pretty-print
without having to guess where parens should go. We may revisit this
in the future.

r=graydon
2012-10-30 15:05:32 -07:00
Patrick Walton
d5a27a0e0c rustc: Translate monomorphic intra-crate automatically-derived methods that follow the "eq" format 2012-10-26 18:23:45 -07:00
Patrick Walton
c7ec183b34 libsyntax: Fix pretty printing of tuple structs. Attempt to put out fire. rs=rustbot 2012-10-26 12:11:40 -07:00
Patrick Walton
93a0763d53 libsyntax: Don't write a ctor ID for struct-like enum variants. rs=rustbot 2012-10-25 14:20:09 -07:00
Brian Anderson
a9d7642b5d Merge remote-tracking branch '14427/incoming'
Conflicts:
	src/libstd/sort.rs
2012-10-25 14:01:49 -07:00
Patrick Walton
599b4208fb rustc: Translate tuple struct constructors 2012-10-25 11:49:26 -07:00
Brian Anderson
3b6f5a18a2 Merge branch 'method-vis-parse'
Conflicts:
	src/libsyntax/parse/parser.rs
2012-10-24 12:15:21 -07:00
Patrick Walton
4da58a5bd6 rustc: Implement typechecking for tuple structs. r=nmatsakis 2012-10-24 10:54:09 -07:00
Mahmut Bulut
21cbc310c7 Make check & Tidy 2012-10-24 16:51:33 +03:00
Tim Chevalier
087cbb55d0 Remove <- operator from the compiler
Yield an obsolete syntax error on things like "let foo <- bar;"
and "foo <- bar;" r=brson

Progress on #3466
2012-10-23 12:10:19 -07:00
Tim Chevalier
48c8d1fecd Remove uses of binary move in the compiler 2012-10-23 12:10:04 -07:00
Tim Chevalier
46fef3d601 Don't generate move-by-init in AST builder 2012-10-23 12:10:04 -07:00
Patrick Walton
3bf0a9b094 rustc: Implement typechecking for simple monomorphic derivable traits on monomorphic types. r=brson 2012-10-23 10:45:23 -07:00
Mahmut Bulut
2985b8e552 * Parsing sequence changed
1- visibility parse
2- purity parse
2012-10-23 09:42:30 +03:00
Simon BD
cc0f2c6bb2 Merge remote-tracking branch 'original/incoming' into incoming 2012-10-22 18:33:41 -05:00
Tim Chevalier
dd66e7549b Preliminary support for labeled break/continue for loops
This patch adds preliminary middle-end support (liveness and trans)
for breaks and `loop`s to `loop` constructs that have labels.

while and for loops can't have labels yet.

Progress on #2216
2012-10-22 09:20:37 -07:00
Tim Chevalier
46d4bbbae4 Simplify the AST representation of ty param bounds
Change ast::ty_param_bound so that all ty param bounds are represented
as traits, with no special cases for Copy/Send/Owned/Const.
typeck::collect generates the special cases.

A consequence of this is that code using the #[no_core] attribute
can't use the Copy kind/trait. Probably not a big deal?

As a side effect, any user-defined traits that happen to be called
Copy, etc. in the same module override the built-in Copy trait.

r=nmatsakis

Closes #2284
2012-10-22 09:01:12 -07:00
Brian Anderson
f3df50f67f Parse and report obsolete fixed-length vector syntax 2012-10-20 17:50:46 -07:00
Ben Striegel
41c37d9d0f ...missed a merge marker on that last rebase 2012-10-20 17:50:46 -07:00
Ben Striegel
614624a34c No longer parse old fixed-length vec sytnax 2012-10-20 17:50:46 -07:00
Ben Striegel
ac81fff229 Remove old fixed-length vector syntax 2012-10-20 17:50:46 -07:00
Philipp Brüschweiler
4174688dd4 libsyntax: adapt the pretty printer for the new fixed size array syntax
`[int]/5` -> `[int * 5]`
2012-10-20 17:50:46 -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
Tim Chevalier
b03c71f629 Remove dead type definition 2012-10-18 12:19:43 -07:00
Erick Tryzelaar
a7ecde3323 libcore: minor code cleanup.
This is minor and probably completely inconsequential to performance,
but I find vec::map to be more clear than vec::each and a push.
2012-10-18 10:09:57 -07:00
Philipp Brüschweiler
e7e1bab27f libsyntax: refactor the parser to consider foreign items as items
parse_item_or_view_item() would drop visibility if none of the conditions
following it would hold. This was the case when parsing extern {} blocks,
where the function was only used to parse view items, but discarded the
visibility of the first not-view item.
2012-10-17 15:34:55 -07:00
Tim Chevalier
b532a8e585 Line length 2012-10-17 12:03:18 -07:00
Tim Chevalier
7236472e67 word => word_space 2012-10-17 12:03:18 -07:00
Jyun-Yan You
66151d02f5 remove duplicate visibility and fix indentation 2012-10-17 12:03:18 -07:00
Jyun-Yan You
ca5506a5de fix the indentation of foreign constant 2012-10-17 12:03:18 -07:00
Patrick Walton
91ae5412d8 rustc: Merge module and type namespaces. r=brson 2012-10-15 15:35:36 -07:00
Tim Chevalier
7237268b70 Allow enum discriminator exprs to refer to declared consts
Also some work towards #3521

Closes #2428
2012-10-15 12:28:29 -07:00
Erick Tryzelaar
ab89b5c294 libstd: make Serializer a trait-level typaram 2012-10-15 08:25:23 -07:00
Tim Chevalier
c5fa613498 Make moves explicit in libsyntax 2012-10-12 20:43:37 -07:00
Tim Chevalier
335e5ca33b Add a colon, make an error message clearer 2012-10-12 20:43:37 -07:00
Niko Matsakis
98887cc7ee remove ctor from ast (take 2) (no review: just dead code removal) 2012-10-12 19:46:37 -07:00
Niko Matsakis
cb55e246ba Use the Nth impl when translating a static method call, instead
of the 0th.  0th is only correct when there are no bound tps
on the trait.

Fixes #3741.
2012-10-12 17:46:43 -07:00
Graydon Hoare
57b4d10ff6 bump version to 0.5. 2012-10-12 16:41:32 -07:00
Kevin Cantu
1bede1f5e0 Replace several common macros of the form #m[...] with m!(...)
This commit replaces nearly all remaining uses of #fmt, #debug, #error,
and #info, and fixes some error messages...
2012-10-12 14:14:48 -07:00
Tim Chevalier
ec6311211f Update FIXME number 2012-10-11 16:00:30 -07:00
Tim Chevalier
6854265161 Remove comment that is now false 2012-10-11 16:00:30 -07:00
Tim Chevalier
bfbb7197d7 Update FIXME numbers 2012-10-11 16:00:30 -07:00
Tim Chevalier
5a8ba073bc Make to_str pure and fix const parameters for str-mutating functions
Two separate changes that got intertwined (sorry):

Make to_str pure. Closes #3691

In str, change functions like push_char to take an &mut str instead of
an &str. Closes #3710
2012-10-11 14:17:59 -07:00
Tim Chevalier
15d8457104 Merge pull request #3700 from erickt/cargo-interner
allow interner cache to be shared across parsers (#3699)
2012-10-09 14:50:01 -07:00
Tim Chevalier
22efa39382 Revert "Revert "Remove old auto_serialize2 code (needs snapshot)""
This reverts commit a33535e441.
2012-10-08 17:43:45 -07:00
Tim Chevalier
a33535e441 Revert "Remove old auto_serialize2 code (needs snapshot)"
This reverts commit 0bd6da8a8c.
2012-10-08 11:58:54 -07:00
Erick Tryzelaar
1ac75d2269 allow interner cache to be shared across parsers (#3699) 2012-10-08 10:42:13 -07:00
Niko Matsakis
ed3689d57c remove ctor from ast 2012-10-08 06:36:42 -07:00
Erick Tryzelaar
0bd6da8a8c Remove old auto_serialize2 code (needs snapshot) 2012-10-07 17:20:19 -07:00
Erick Tryzelaar
eb626e7119 Remove the old serializers (needs snapshot) 2012-10-07 17:20:19 -07:00
Erick Tryzelaar
d301dd3686 remove the old auto_serialize syntax extension 2012-10-07 14:56:18 -07:00
Erick Tryzelaar
e1c517ca48 migrate libsyntax/rustc to auto_serialize2 2012-10-07 10:32:25 -07:00
Simon BD
0e3bec0ced Merge remote-tracking branch 'original/incoming' into incoming 2012-10-06 13:15:18 -05:00
Tim Chevalier
f96a2a2ca1 Remove by-mutable-ref mode from the compiler
and test cases. Closes #3513
2012-10-05 22:45:50 -07:00
Tim Chevalier
05999290e2 Finally removing all uses of by-mut-ref
The code for the mode itself is still there.
2012-10-05 21:03:40 -07:00
Tim Chevalier
45345bda6a Remove uses of mutable ref mode.
It's still in the compiler right now, but warned about
2012-10-05 16:57:37 -07:00
Tim Chevalier
f8bc0d2545 Revert "wip"
This reverts commit ca49fd402a.
2012-10-05 16:10:08 -07:00
Tim Chevalier
ca49fd402a wip 2012-10-05 15:39:12 -07:00
Tim Chevalier
e16dbb7888 Demode some code using by-mutbl-ref; warn about by-mutbl-ref
The parser now warns about use of mutbl-ref mode, though it's kind
of a lie since this commit doesn't remove support for the mode.

Changed move_val_init to have stage0 and stage1/2 versions, the latter of
which is demoded.

Changed the type that the typechecker expects the move_val_init
intrinsic to have. After this is pushed, I can make a new snapshot,
which will remove the need for the stage0 versions.
2012-10-05 15:37:01 -07:00
Tim Chevalier
8fc60af441 Remove by-copy mode from std, mostly
One instance remains in net_tcp due to a foreign fn. Lots of
instances remain in serialization.rs, but IIRC that is being removed.

I had to do unholy things to task-perf-word-count-generic to get it
to compile after demoding pipes. I may well have messed up its
performance, but it passes.
2012-10-04 19:59:47 -07:00
Simon BD
efcd2385ea Merge remote-tracking branch 'original/incoming' into incoming
Conflicts:
	src/libstd/json.rs
	src/libstd/sort.rs
2012-10-03 21:47:09 -05:00
Patrick Walton
2f451a7bd7 rustc: Only allow imports marked with "pub" to be imported from other modules 2012-10-02 18:15:19 -07:00
Patrick Walton
9284179311 libstd: Switch off legacy modes in both core and std. 2012-10-02 12:20:06 -07:00
Erick Tryzelaar
2569adc5ea Split auto_serialize2 into two macros 2012-10-01 20:44:30 -07:00
Erick Tryzelaar
4f4160ee3b Factor out auto_serialize2's impls from each other. 2012-10-01 20:44:30 -07:00
Erick Tryzelaar
c46b6f9efb auto_serialize2 should deserialize structs using read_struct 2012-10-01 20:44:30 -07:00
Erick Tryzelaar
81423a3866 Add deserializable and more types to serialization2 2012-10-01 20:43:59 -07:00
Tim Chevalier
b18320446e Move over to calling ptr::addr_of
Everything should now call ptr::addr_of instead of
ptr::p2::addr_of. Only the pipes macro code when compiled
by stage0 will call ptr::p2::addr_of. Needs a snapshot to get
rid of that.
2012-10-01 15:12:09 -07:00
Tim Chevalier
72ae42627b Call 'new' instead of 'old' extfmt code, preparing for snapshot 2012-10-01 15:12:09 -07:00
Tim Chevalier
3639d38d5c Add a demoded version of ptr::addr_of
Currently, the new version is ptr::p2::addr_of and the old one is
ptr::addr_of. This is kind of cheesy, but I need a snapshot before I
can ditch the old version, since the pipe compiler generates calls to
addr_of.

core is converted over to use the new version, std is not.
2012-09-28 22:19:01 -07:00
Brian Anderson
c9fb1b19aa Add allow(deprecated_\*) to syntax, rustc, rustdoc, et al 2012-09-28 18:38:59 -07:00
Tim Chevalier
fec96b2ae0 Demoding in iter: any, all, map_to_vec, flat_map_to_vec, filter_to_vec 2012-09-28 17:44:15 -07:00
Niko Matsakis
565b39b302 rename iter2 to each2, make it follow iterator protocol 2012-09-28 16:13:03 -07:00
Brian Anderson
9e0a43c932 Pretty-print item visibility modifiers 2012-09-28 15:04:23 -07:00
Tim Chevalier
2f4ee89119 Demode extfmt
Needs a snapshot before this can be completed, because I changed
the mode for conv_poly.
2012-09-28 13:47:45 -07:00
Niko Matsakis
21519bc7e0 demode vec 2012-09-28 13:27:45 -07:00
Erick Tryzelaar
b68d287780 libsyntax: Fix long line 2012-09-27 19:24:11 -07:00
Brian Anderson
463d5d5f0b Merge pull request #3607 from gutworth/incoming
utterly trivial refactoring
2012-09-27 18:35:43 -07:00
Brian Anderson
438bdd687b core: More option demoding 2012-09-27 17:49:10 -07:00
Simon BD
868d10160f Put function argument last in sort function. Fixes #3265. 2012-09-27 19:05:13 -05:00
Patrick Walton
0bcb3bc536 libsyntax: Parse visibility modifiers before foreign items 2012-09-27 12:48:09 -07:00
Benjamin Peterson
459fe6ad55 factor out common lines 2012-09-27 15:05:06 -04:00
Brian Anderson
e8fe718bfd core: Replace map/map_default with map_ref/map_default_ref 2012-09-26 20:15:23 -07:00
Tim Chevalier
996ec62cbf Remove spurious by-ref argument to destructors
Destructors were internally declared with an extra (hidden) nil-typed
argument that was passed in by-ref mode. This was causing spurious
mode warnings. Deleted it. Also some misc. cleanup because I
couldn't help myself.
2012-09-26 19:42:02 -07:00
Brian Anderson
8f0e9ff029 Long lines 2012-09-26 18:23:05 -07:00
Niko Matsakis
67a8e7128a Demode vec::push (and convert to method) 2012-09-26 18:02:07 -07:00
Erick Tryzelaar
b96af73159 turn ast::ident into a struct
This will help with the auto_serialize2 migration. We have to change
ident from a type alias to uint into a unique type. We need to use
a struct instead of a "enum ident = token::str_num" because structs
support constants, but newtypes do not.
2012-09-26 16:20:24 -07:00