Commit Graph

8851 Commits

Author SHA1 Message Date
Brian Anderson
345a21916c syntax: Refactor ident parsing 2012-04-27 16:45:54 -07:00
Brian Anderson
0be41ce02b rustc: Remove old align_of intrinsic 2012-04-27 15:40:43 -07:00
Brian Anderson
e85fc9bf00 Register snapshots 2012-04-27 14:37:09 -07:00
Brian Anderson
0d5d1175d7 compiletest: Unbreak on Win32 2012-04-27 11:55:13 -07:00
Brian Anderson
582c71731d rustc: Clean up some enum code 2012-04-27 11:24:43 -07:00
Brian Anderson
dfc81dfa90 core: Add os::arch. Exposes target_arch string at runtime 2012-04-27 01:36:30 -07:00
Brian Anderson
09624a676a test: Enable an assert in run-pass/rec-align-32-bit.rs 2012-04-27 00:12:42 -07:00
Brian Anderson
e4277472d2 core: Split sys::align_of into min_align_of, pref_align_of 2012-04-27 00:12:42 -07:00
Brian Anderson
f4f909b8b5 rustc: Add min_align_of, pref_align_of intrinsic, deprecate align_of 2012-04-27 00:12:39 -07:00
Brian Anderson
1c46ee34be rustc: Add llalign_of_min 2012-04-26 21:59:59 -07:00
Brian Anderson
43751e45d9 rustc: Rename llalign_of_real to llalign_of_pref
This alignment is the "preferred" alignment of a type, which is not
necessarily the alignment the compiler will use when packing the
type into structures - that is the "ABI" alignment (in LLVM terms).

On x86, 64-bit ints have 8-byte preferred alignment, but 4-byte
ABI alignment.
2012-04-26 21:44:29 -07:00
Brian Anderson
3c16693760 rustc: Add LLVM bindings for more alignment-related functions 2012-04-26 21:33:38 -07:00
Brian Anderson
597d9b4dd0 test: xfail-win32 run-pass/rec-align-32-bit.rs 2012-04-26 19:55:57 -07:00
Brian Anderson
bbc4a74dc6 rt: Fix shape alignment of 64-bit ints on x86. Issue #2303 2012-04-26 18:30:58 -07:00
Tim Chevalier
8e15640ada Refactor operator precedence code
Use functions instead of a dynamically created table to determine
operator precedence. Gets rid of a FIXME in syntax::parse::prec.
Change precedences from int to uint while we're at it, since
don't use negative precedences.
2012-04-26 16:16:18 -07:00
Graydon Hoare
1f92538e38 Add check for path-statements, close #400. 2012-04-26 14:43:43 -07:00
Graydon Hoare
33a296f2fc Lowercase warning message. 2012-04-26 14:43:43 -07:00
Graydon Hoare
61575582ba Describe warnings on command line if user says -W help. 2012-04-26 14:43:43 -07:00
Brian Anderson
7eec6eb2bb std: Add FIXME about time tests 2012-04-26 13:54:01 -07:00
Ted Horst
340dbcfdc8 temporary hack to make testing std::time reliable 2012-04-26 13:52:29 -07:00
Niko Matsakis
825fd1808e lots of work to make iface/impls parameterized by regions
- paths can now take region parameters, replacing the dirty hack
  I was doing before of abusing vstores.  vstores are now a bit
  of a hack though.

- fix various small bugs:
  - we never checked that iface types were compatible when casting
    to an iface with `as`
  - we allowed nonsense like int<int>
  - and more! (actually that may be it)
2012-04-25 19:26:56 -07:00
Graydon Hoare
458d2ff067 Be a bit more cautious about marking things no-throw. 2012-04-25 18:53:54 -07:00
Graydon Hoare
753b683939 More slice use in vec, io, str, ebml, metadata encoder and decoder. 2012-04-25 17:19:36 -07:00
Graydon Hoare
90c1b4645f Set no-unwind on glue functions that don't drop resources. 2012-04-25 17:19:36 -07:00
Graydon Hoare
fa6c68a025 Set no-unwind attribute on all upcalls other than fail. 2012-04-25 17:19:36 -07:00
Graydon Hoare
a2f04efd59 Register snapshots. 2012-04-25 17:19:36 -07:00
Brian Anderson
e21161b336 test: Fix run-pass/enum-mach-type-compat on x86 2012-04-25 16:06:57 -07:00
Brian Anderson
60ec812b3a test: Fix and un-xfail run-pass/use 2012-04-25 15:58:33 -07:00
Brian Anderson
c9439ad755 test: Remove run-pass/user.rs. Old test for unimplemented feature 2012-04-25 15:56:21 -07:00
Brian Anderson
3a3a7fc426 rustc: Cache normalized types 2012-04-25 15:49:27 -07:00
Brian Anderson
df0ef528b9 rustc: Use LLVM named structs for enum types 2012-04-25 15:49:25 -07:00
Marijn Haverbeke
10120cce0f typeck: Take more care to pass down expected types
This helps with prototype inference and avoids some 'must be known
in this context' errors.
2012-04-25 17:45:29 +02:00
Marijn Haverbeke
2b71535cf9 Register new snapshot
(With the fix for #2185 included.)
2012-04-25 12:57:08 +02:00
Marijn Haverbeke
9f99c3263b Rewrite exhaustiveness checker
Issue #2111
2012-04-25 09:15:17 +02:00
Brian Anderson
c9e3f387f4 syntax: Divide keywords into contextual/restricted. No bad words 2012-04-24 22:58:00 -07:00
Brian Anderson
08d0707556 syntax: Make 'true' and 'false' bad words
When these are idents they are always shadowed by the boolean
constants.
2012-04-24 22:00:32 -07:00
Brian Anderson
98ac8d4625 syntax: Clean up the bad_expr_word functions 2012-04-24 21:12:16 -07:00
Brian Anderson
7ee90cc7be syntax: Rename is_word to is_keyword, etc. 2012-04-24 21:08:49 -07:00
Brian Anderson
5a0c564817 Revert "rustc: Use LLVM named structs for enum types"
This reverts commit 6e909e387d.
2012-04-24 20:47:06 -07:00
Brian Anderson
b88ecec08c Revert "rustc: Cache normalized types"
This reverts commit 06afe21c03.
2012-04-24 20:47:00 -07:00
Brian Anderson
06afe21c03 rustc: Cache normalized types 2012-04-24 18:24:35 -07:00
Brian Anderson
6e909e387d rustc: Use LLVM named structs for enum types 2012-04-24 18:24:35 -07:00
Graydon Hoare
929c3dd710 Workarounds for bug #2280: add some temporaries for borrowing. 2012-04-24 15:19:01 -07:00
Brian Anderson
e7dbf42214 rustc: Fix type_need_unwind_cleanup. Closes #2272 2012-04-24 14:55:16 -07:00
Brian Anderson
5437a045fc rustc: Remove a bitcast. Issue #2276 2012-04-24 14:00:50 -07:00
Brian Anderson
31853f31bf build: Don't require full target libs to run compiletest tests
Only build through librustsyntax, which some tests do rely on.
2012-04-24 13:30:03 -07:00
Tim Chevalier
2d793ef498 Add a cross-crate test for casting classes to ifaces 2012-04-24 10:47:53 -07:00
Brian Anderson
b4a3d525d8 rustc: Eliminate trans dependency from metadata::tyencode 2012-04-23 23:41:18 -07:00
Tim Chevalier
f7641286b2 Allow classes to be cast to ifaces that are in the same crate
I had to xfail one existing test case (class-implements-int) because,
I think, of the same bug described in #2272.
2012-04-23 21:15:03 -07:00
Tim Chevalier
1c39fda0ea Rename option::get_or_default to get_default, for consistency 2012-04-23 20:52:50 -07:00
Niko Matsakis
b04b415e0d encode the borrowing table, add a simple cross-crate borrowing test 2012-04-23 16:41:11 -07:00
Tim Chevalier
7d05bea7b9 Fix bug with * patterns in trans_alt
enter_opt was handling the (*) case wrong and causing a bounds check
    failure. Fixed it (the test case is one of the extracted ones from
    the reference manual)
2012-04-23 15:50:51 -07:00
Graydon Hoare
ea3362d12d Register snapshots. 2012-04-23 12:13:56 -07:00
Niko Matsakis
71128e75b0 moderate comment, remove some dead regions code 2012-04-23 08:02:59 -07:00
Niko Matsakis
7113a2c30b remove dead code 2012-04-23 08:02:59 -07:00
Niko Matsakis
4eb71c07c6 remove outdated comment 2012-04-23 08:02:59 -07:00
Niko Matsakis
30d563839e Various regions fixes. 2012-04-23 08:02:59 -07:00
Niko Matsakis
0d3658bb43 rewrite the resolution infrastructure; but it's still grody 2012-04-23 08:02:58 -07:00
Marijn Haverbeke
68f8812511 Guard against infinitely expanding generic/inline functions
Closes #2220

Test case disabled until a memory-leak issue is resolved.
2012-04-23 16:44:52 +02:00
Marijn Haverbeke
2782cfb783 Emit a more useful error when using an unsuitable function for a loop
Closes #2255
2012-04-23 15:43:29 +02:00
Marijn Haverbeke
9053f54498 Move map iface over to more for-friendly iteration methods 2012-04-23 15:18:19 +02:00
Marijn Haverbeke
a872a99bfe Simplify representation of ast::path 2012-04-23 13:04:46 +02:00
Marijn Haverbeke
587d8a5d4f Misc code cleanups using list::each for list iteration 2012-04-23 12:13:59 +02:00
Marijn Haverbeke
a61f107684 pretty printer: Properly print explicity types for block params 2012-04-23 10:27:09 +02:00
Marijn Haverbeke
f2a60a6b02 Fix long line in test 2012-04-23 09:54:27 +02:00
Marijn Haverbeke
dfdca5d538 Fix broken determination of external method type param count
Closes #2185
2012-04-23 09:25:14 +02:00
Brian Anderson
512927573e syntax: Replace token::DOLLAR_PAREN, DOLLAR_NUM with just DOLLAR
Figure the rest out in the parser
2012-04-22 17:24:49 -07:00
Brian Anderson
7321c17171 syntax: Eliminate token::POUND_LT, POUND_LBRACE
Use lookahead in the parser
2012-04-22 15:19:14 -07:00
Brian Anderson
92b2113583 syntax: Move is_lit to mod token 2012-04-22 14:59:04 -07:00
Brian Anderson
fa86b5d67f syntax: Remove unused BRACEQUOTE, IDX, LIT_BOOL tokens 2012-04-22 14:58:10 -07:00
Brian Anderson
e3961df78d cargo: Discover crates in subdirectories 2012-04-21 15:46:05 -07:00
Brian Anderson
8688b1b845 core: Add os::walk_dir 2012-04-21 15:45:51 -07:00
Brian Anderson
7235f3cee2 syntax: Eliminate 'mutable' keyword. Closes #2254 2012-04-21 14:27:20 -07:00
Brian Anderson
734494a04d rustc: Cache constant C strings. Closes #2264 2012-04-21 14:26:13 -07:00
Brian Anderson
bef5cd8e45 std: Export sort::le 2012-04-21 13:45:20 -07:00
Tim Chevalier
734166f41c Print out return type correctly in typestate error message
In the "not all paths return" error message, typestate was printing
the AST type from the fn decl, not the ty::t type. This ended in tears
when the AST return type was "ty_infer". Now it looks up the function node
ID's type and uses util::ppaux::ty_to_str instead.

Closes #2163.
2012-04-20 18:48:08 -07:00
Graydon Hoare
43061f3969 Add vec::unpack_slice, expose str::unpack_slice. 2012-04-20 17:37:17 -07:00
Graydon Hoare
14d0509691 Log decoded inline_items when debug is active. 2012-04-20 17:18:42 -07:00
Graydon Hoare
355422ddbd Implement tydecode::parse_vstore. 2012-04-20 17:18:42 -07:00
Jeff Olson
f855682bed std: ignore tests that use high_level_loop
until race issue with (most likely) refcount scheme is sorted out
2012-04-20 16:46:50 -07:00
Jeff Olson
707391edbc std: add timer::recv_timeout() and whitespace cleanup 2012-04-20 15:23:23 -07:00
Jeff Olson
7ac8c3081c std: add std::timer and timer::delayed_send and timer::sleep
.. leveraging std::uv, we have:
timer::delayed_send - send a value over a provided channel after the
timeout has passed
timer::sleep - block the current task for the specified period

both of these fns (and everything that goes in timer.rs) leverage the
uv_timer_* API
2012-04-20 15:23:23 -07:00
Jeff Olson
a1c43cc7c9 std: dump old std::uv API.. move remaining tests into uv::ll 2012-04-20 15:23:23 -07:00
Jeff Olson
791ea3466d std::uv : cleanup and an isolated test for hand-rolled high_level_loops 2012-04-20 15:23:23 -07:00
Jeff Olson
e02057c5a5 std: fail if exiting hl_loop has unref_handles at weaken_task exit 2012-04-20 15:23:23 -07:00
Jeff Olson
a9db0c9efe whitespace cleanup 2012-04-20 15:23:23 -07:00
Jeff Olson
a045e63639 std: get_monitor_task_gl() is global_loop::get() default 2012-04-20 15:23:23 -07:00
Jeff Olson
e15f1d5cad std: refactor global_loop::get.. make it reusable 2012-04-20 15:23:23 -07:00
Jeff Olson
afb35f752f fix uv_timer_t size in 32bit linux and windows
.. fixes issue, in previous commit, with global loop test hanging on
32bit linux (this was because the struct was too small, so (presumably),
the data member was garbled.. yippy)
2012-04-20 15:23:23 -07:00
Jeff Olson
bea02ee351 adding missing binding to rustrt.def.in 2012-04-20 15:23:22 -07:00
Jeff Olson
83ae83c3b3 uv::hl::get_global_loop() -> uv::global_loop::get()
- moved global loop tests, as well.. will add tests in uv_hl that encompass
rolling your own high_level_loop via uv::hl::run_high_level_loop()
- also whitespace cleanups and misc warning cleanup..
- doesn't work on 32bit linux
2012-04-20 15:23:22 -07:00
Jeff Olson
253fad7788 replace impl of globa_async_handle with one using atomic compare-and-swap 2012-04-20 15:23:22 -07:00
Jeff Olson
d7a87aa0a1 remove rustrt.def.in entry for no-longer-existent c++ function 2012-04-20 15:23:22 -07:00
Jeff Olson
728f92604a fix a race in global loop test; unref_handle now takes a close_cb 2012-04-20 15:23:22 -07:00
Jeff Olson
9a5d1974dc don't use ::malloc for initializing the global_async_handle in rust_kernel 2012-04-20 15:23:22 -07:00
Jeff Olson
f21d25b54c make weak task that runs libuv loop unsupervised 2012-04-20 15:23:22 -07:00
Jeff Olson
e0f110aa12 clean and trying the global loop test as two separate loop lifetimes..
.. seeing an occasional valgrind/barf spew on some invalid read/writes..
need to investigate further.. i think its related to my poor citizen
conduct, re: pointers stashed in rust_kernel..
2012-04-20 15:23:22 -07:00
Jeff Olson
31ba223c26 end-to-end impl of global loop w/ high-level ref counting.. needs work
- starting/stoping the loop based on client work is functioning, correctly
- the issue appears to be that, when the process is about to exit, the
signal to let weak tasks know that they need to exit isn't getting fired.
2012-04-20 15:23:22 -07:00
Jeff Olson
e6f6a8ced4 tweaking rust getter/setters for libuv data to use generics 2012-04-20 15:23:22 -07:00
Jeff Olson
12f2f4c15c rt: whitespace cleanup for existing libuv integration 2012-04-20 15:23:22 -07:00
Jeff Olson
e604c15df1 bindings to get/set data field on uv_loop_t* and debug log cleanup 2012-04-20 15:23:21 -07:00
Jeff Olson
f06362d5bb exporting priv::weaken_task and adding some debug logging 2012-04-20 15:23:21 -07:00
Jeff Olson
c6667c06c3 add needed fields for global libuv loop + bindings to manage from rust
adding two pointers fields to rust_kernel :(
.. have to do manual malloc/free for one of the fields, which feels wrong
2012-04-20 15:23:21 -07:00
Jeff Olson
bf99a3aa93 adding low-level uv_timer_* stuff to libuv bindings 2012-04-20 15:23:21 -07:00
Jeff Olson
3d004c6df8 making brson's req. cleanups in #2134 plus change printf to LOG in c++ 2012-04-20 15:23:21 -07:00
Brian Anderson
53f5c0c623 rt: Delete some incorrect comments 2012-04-20 14:00:13 -07:00
Brian Anderson
4357e1fd60 rt: Take the weak_task_lock in end_weak_tasks
Don't remember why it's commented out. Probably an oversight.
2012-04-20 13:59:31 -07:00
Graydon Hoare
90f82e171d Get borrowing working on fixed evecs. 2012-04-20 12:11:55 -07:00
Tim Chevalier
37b0549730 Add new syntax for patterns that match the head constructor only
Adds a new kind of pattern C(*) where C is a constructor that may
have any number of fields. This pattern matches any value
constructed with C, without binding names for any of the fields.

Closes #1701.
2012-04-20 00:56:46 -07:00
Brian Anderson
087b12ac29 syntax: Reorganize mod parse 2012-04-19 21:58:45 -07:00
Brian Anderson
7fa7e56341 syntax: Move fn spanned into ast_util 2012-04-19 21:58:45 -07:00
Brian Anderson
bcbcbad774 syntax: Extract some functions into mod common 2012-04-19 21:58:45 -07:00
Brian Anderson
628e80d525 syntax: Extract attribute parsing to its own mod 2012-04-19 21:58:45 -07:00
Niko Matsakis
3d6c79109e update syntax to include a slash 2012-04-19 21:01:11 -07:00
Niko Matsakis
3c995fb8f3 make nominal types optionally parameterized by a self region.
Issue #2201.
2012-04-19 21:01:11 -07:00
Niko Matsakis
f3f34bf09b correct universally_quantify to use structure_of, and introduce a test for this 2012-04-19 21:01:11 -07:00
Niko Matsakis
bbfb83c2c5 Test for issue #1899. It works now. 2012-04-19 20:54:23 -07:00
Niko Matsakis
171c89f4c5 Fix for #1989, #1469: when marking in CC, walk fn@ box like other boxes 2012-04-19 20:34:26 -07:00
Niko Matsakis
21f74be2c1 add a new runtime log (::rt::box) and make boxed_region use it 2012-04-19 20:34:26 -07:00
Tim Chevalier
31ff64c62d Annotate FIXMEs in parser
Also, get rid of two FIXMEs by refactoring some code, and moving the
call_expr check for be expressions into typeck, where it seems to
make more sense.
2012-04-19 19:17:59 -07:00
Tim Chevalier
cdc8722f95 Add a lint pass to check for while true { ... } loops
And suggest changing them to loop { ... }. Had to fix the few
remaining while true loops (in core::io). Closes #1962.
2012-04-19 18:14:38 -07:00
Brian Anderson
b9ae0c555b syntax: Funnel all words through a single keyword table 2012-04-19 16:59:28 -07:00
Graydon Hoare
f641dce852 Get evec slices and unique-evec slice-borrowing working. 2012-04-19 16:51:37 -07:00
Tim Chevalier
b0074c5a92 Disallow rebinding / matching against consts in alts
As per Issue #1193. Closes #1193.

I had to rename a few variables ("info" and "epsilon") to avoid
clashing with in-scope constants, which is responsible for all the
changes other than resolve and issue-1193.rs.
2012-04-19 16:21:15 -07:00
Graydon Hoare
1e51196f33 Get fixed-size evecs working. 2012-04-19 15:52:50 -07:00
Tim Chevalier
cd2effe022 Annotate FIXMEs (comments only) 2012-04-19 15:30:59 -07:00
Tim Chevalier
37ea010b0d Move some functions from pprust to classify
As per a FIXME in syntax::parse::classify, move predicates on exprs
and stmts into classify, out of pprust
2012-04-19 15:30:58 -07:00
Tim Chevalier
1da18c70ac Clean up FIXMEs in syntax::fold
Eta-reduce a function, fold over ty constrs, and annotate a FIXME.
2012-04-19 15:30:58 -07:00
Tim Chevalier
030404c793 Cleanup FIXMEs in syntax::ext::qquote
Inline some one-off functions, add an error message, annotate a FIXME
2012-04-19 15:30:58 -07:00
Tim Chevalier
e6b5b4827b Removed a FIXME from librustcsyntax/ext/build.rs
I removed a FIXME about cleaning up function names because I
couldn't tell what needed cleaning up. If you know, please add a
FIXME and a corresponding issue tracker issue that explains the
problem!
2012-04-19 15:30:58 -07:00
Tim Chevalier
df28ab1bd1 Comments only: annotate FIXMEs in lexer 2012-04-19 15:24:49 -07:00
Brian Anderson
7a1dc76b0f core: Move set_exit_status from sys to os 2012-04-19 01:26:17 -07:00
Brian Anderson
1cad6322c3 core: Move last_os_error from sys to os 2012-04-19 01:23:00 -07:00
Brian Anderson
01e20dd0b3 core: Improve docs 2012-04-19 01:18:37 -07:00
Brian Anderson
9604544e23 rt: Don't log in the stack switching failure path
The runtime is in an uncertain state here and, instead of thinking
about how to make the logger work correctly, let's just avoid it.

Currently, it ends up hitting an assert saying that we can't log on
the rust stack.
2012-04-18 18:45:24 -07:00
Graydon Hoare
75cf13ec72 Add str/& component accessor and test. 2012-04-18 17:50:58 -07:00
Graydon Hoare
956bc773c6 Fix [] on str to exclude the trailing null. 2012-04-18 17:50:58 -07:00
Brian Anderson
9a8a04629e syntax: Put the main parser interface in mod parse 2012-04-18 10:50:50 -07:00
Brian Anderson
2c0cb901c8 syntax: Begin moving functions from mod parser to mod classify 2012-04-18 10:50:50 -07:00
Brian Anderson
d51973a6a6 syntax: Move some functions from parser to token 2012-04-18 10:50:50 -07:00
Brian Anderson
476d5a099d syntax: Extract prec mod from parser mod 2012-04-18 10:50:50 -07:00
Marijn Haverbeke
aa4278a3f5 Require values to be copyable when cast
Closes #2222
2012-04-18 17:21:39 +02:00
Marijn Haverbeke
a65af017ca Remove tri.rs and four.rs
Closes #1892
2012-04-18 17:21:39 +02:00
Marijn Haverbeke
fda7bb6721 Fix oversight in type_use.rs
Closes #2053
2012-04-18 17:21:39 +02:00
Marijn Haverbeke
054a312a33 Stop duplicating non-generic resource destructors
Closes #2177
2012-04-18 17:21:39 +02:00
Marijn Haverbeke
a0fa099469 Add a needs_drop intrinsic
Closes #2055
2012-04-18 13:15:02 +02:00
Marijn Haverbeke
35b8f87b89 Fix use of wrong block context in return-from-loop code
Closes #2142
2012-04-18 13:00:18 +02:00
Brian Anderson
321ccc123d syntax: Add explicit exports in parser mods 2012-04-17 20:10:58 -07:00
Graydon Hoare
70a9ce626d Implement slice-borrowing on estr-uniq and str values. 2012-04-17 15:15:20 -07:00
Brian Anderson
fac7fcc123 syntax: Remove extra 'mut' from bad word table 2012-04-17 14:22:47 -07:00