Commit graph

1820 commits

Author SHA1 Message Date
Kevin Atkinson
5ef53382ae Add support for parsing quasi-quotes, doesn't do anything useful yet. 2012-02-03 20:23:49 -07:00
Marijn Haverbeke
c976b7c623 Fix tests for str::le patch 2012-02-03 14:32:23 +01:00
Marijn Haverbeke
c1b075d042 Remove experimental GC code
It's been sitting unused long enough to have bitrotted completely.
2012-02-03 11:34:12 +01:00
Brian Anderson
57cad61353 rt: Remove task pinning. Does nothing 2012-02-02 18:10:24 -08:00
Brian Anderson
18de0f2aeb rt: Rename task_sleep intrinsic to task_yield. Remove usec param 2012-02-02 18:10:24 -08:00
Marijn Haverbeke
6a7de641da Add test case for issue #1733 2012-02-02 10:30:07 +01:00
Kevin Cantu
8f367ebfeb Rename (again) str::unsafe::slice -> str::unsafe::slice_bytes and
str::unsafe::safe_slice -> str::unsafe::slice_bytes_safe_range
2012-02-01 21:56:53 -08:00
Kevin Cantu
c71667d9d2 Propagating unsafe::slice 4 2012-02-01 21:56:53 -08:00
Marijn Haverbeke
856a544d0c Remove native types from stdlib 2012-02-01 12:23:13 +01:00
Tim Chevalier
e5d095d67e Change option::t to option
Now that core exports "option" as a synonym for option::t, search-and-
replace option::t with option.

The only place that still refers to option::t are the modules in libcore
that use option, because fixing this requires a new snapshot
(forthcoming).
2012-01-31 17:05:20 -08:00
Kevin Cantu
c7454f5595 Rename str::to_chars -> str::chars 2012-01-31 14:29:11 -08:00
Tim Chevalier
45c1dfe5b3 Don't compute pre- and postconditions for item_consts
Since item_consts can't refer to or modify local variables, they
don't participate in typestate and thus get empty pre and
postconditions by default.

Closes #1660
2012-01-31 11:52:46 -08:00
Tim Chevalier
fba35e1a3c Require alts to be exhaustive
middle::check_alt does the work. Lots of changes to add default cases
into alts that were previously inexhaustive.
2012-01-31 10:08:24 -08:00
Brian Anderson
0e498da47e rustc: Allow attributes on methods. Closes #1709 2012-01-30 11:43:45 -08:00
Paul Woolcock
a02493b969 Fix last failing test
All tests now pass, without the ternary operator.
2012-01-30 18:21:12 +01:00
Paul Woolcock
e1251f7b00 Change all ternary ops to if/then/else
All the files below had at least one instance of the ternary operator
present in the source.  All have been changed to the equivalent
if/then/else expression.
2012-01-30 18:21:01 +01:00
Paul Woolcock
e1f15a71e3 Alter/remove tests that include/concern ternary
3 tests, pretty/block-disambig.rs, run-pass/operator-overloading.rs,
and run-pass/weird-exprs.rs, all included the ternary operator.  These
were changed to use the if-then-else construct instead.

2 tests, run-pass/block-arg-in-ternary.rs and run-pass/ternary.rs, were
only there because of the ternary operator, and were removed.
2012-01-30 18:20:05 +01:00
Marijn Haverbeke
964bd485c6 Revert self types 2012-01-30 11:37:52 +01:00
Brian Anderson
fa13fd9d64 rt: Remove set_min_stack 2012-01-29 21:27:37 -08:00
Brian Anderson
cad4918b2a core: Remove sys::set_min_stack
This was a temporary hack with global effect. Eventually there will
be a real solution for controlling stack sizes.
2012-01-29 21:27:09 -08:00
Brian Anderson
53dbde6cc2 rustc: Make 'attempted access of field' error non-fatal 2012-01-27 16:58:27 -08:00
Brian Anderson
3321880f13 Merge remote-tracking branch 'killerswan/fixing_strings_2'
Conflicts:
	src/comp/driver/driver.rs
	src/comp/middle/trans/base.rs
	src/comp/syntax/parse/lexer.rs
2012-01-27 16:44:40 -08:00
Marijn Haverbeke
e48bf6f3f4 Make occurs check in ty::fixup_vars more reliable
It wouldn't detect cycles that went through several type vars before.

Closes #1464
2012-01-27 18:58:52 +01:00
Marijn Haverbeke
dc55c06aa3 Properly check enum types for recursion
Closes #742
2012-01-27 16:03:43 +01:00
Marijn Haverbeke
b80f0a3c9f Use the method name 'unary-' for overloading negation
It's less likely to clash with something than 'neg'.

Issue #1520
2012-01-27 10:06:53 +01:00
Brian Anderson
28fbb19664 rustc: Switch the --no-core switch to a #[no_core] attribute 2012-01-26 16:43:33 -08:00
Brian Anderson
5610205363 rustc: Move core injection to its own module 2012-01-26 16:23:48 -08:00
Marijn Haverbeke
6bead0e4cc Use operator names for operator methods
The methods used to implement operators now simply use
the name of the operator itself, except for unary -, which is called
min to not clash with binary -. Index is called [].

Closes #1520
2012-01-26 15:52:28 +01:00
Marijn Haverbeke
888262b337 Allow operator overloading of the indexing operator
The method `op_index` (which takes a single argument) is used for
this.

Issue #1520
2012-01-26 15:23:11 +01:00
Marijn Haverbeke
87b064b249 First stab at operator overloading
When no built-in interpretation is found for one of the operators
mentioned below, the typechecker will try to turn it into a method
call with the name written next to it. For binary operators, the
method will be called on the LHS with the RHS as only parameter.

Binary:

    +   op_add
    -   op_sub
    *   op_mul
    /   op_div
    %   op_rem
    &   op_and
    |   op_or
    ^   op_xor
    <<  op_shift_left
    >>  op_shift_right
    >>> op_ashift_right

Unary:

    -   op_neg
    !   op_not

Overloading of the indexing ([]) operator isn't finished yet.

Issue #1520
2012-01-26 14:25:06 +01:00
Brian Anderson
2999479a2d rustc: Allow attributes on enum variants. Closes #1663 2012-01-25 16:24:06 -08:00
Brian Anderson
4168101b03 test: Un-xfail run-pass/tag-auto-disr-val-shape 2012-01-25 12:44:13 -08:00
Brian Anderson
19a9a475a6 test: Add regression test for #1659 2012-01-25 12:40:08 -08:00
Brian Anderson
ba7299ba65 test: Un-xfail run-pass/tag-disr-val-shape
Fixed by 96f1eda6d0
2012-01-25 12:34:37 -08:00
Marijn Haverbeke
2d4d8e8bdb Implement implicit self type parameters for ifaces
Closes #1661
2012-01-25 20:47:11 +01:00
Kevin Cantu
c7b23f9a86 Replacing str::unsafe_from_bytes with str::from_bytes (part 1) 2012-01-25 00:53:17 -08:00
Niko Matsakis
5e13d19cc0 s/block()/fn()/g 2012-01-23 19:06:33 -08:00
Brian Anderson
7d5d1a311e test: Add no-reformat directive to compile-fail/issue-1362 2012-01-23 17:37:15 -08:00
Kevin Atkinson
664d9cc86f Add regression test for issue #1362.
Although its not really needed.  Without that fix, reported spans will
likely be bogus if the error is within the first couple of lines
(probable around 5) of that file.  Thus, many of the compile-fail
tests will fail due to incorrect location.
2012-01-23 17:37:15 -08:00
Kevin Atkinson
5e60facf78 Add regresion tests for issue #1448 and #1387. 2012-01-23 17:37:15 -08:00
Niko Matsakis
5660b8bfb5 add msgsend.rs to benchmarks 2012-01-23 16:04:14 -08:00
Tim Chevalier
6db688e893 Check that the names mentioned in tag exports are actually types (or variants)
Check that in export foo{}, foo is an enum type, and that in export
foo{bar, quux}, foo is an enum type and bar and quux are variants belonging
to foo.
2012-01-23 15:48:08 -08:00
Tim Chevalier
9dc59e1506 Export all enum variants by default; new syntax for selectively exporting variants
See issue 1426 for details. Now, the semantics of "export t;" where t is a tag are
to export all of t's variants as well. "export t{};" exports t but not its
variants, while "export t{a, b, c};" exports only variants a, b, c of t.

To do:
- documentation
- there's currently no checking that a, b, c are actually variants of t in the
 above example
- there's also no checking that t is an enum type, in the second two examples above
- change the modules listed in issue 1426 that should have the old export
semantics to use the t{} syntax

I deleted the test export-no-tag-variants since we're doing the opposite now,
and other tests cover the same behavior.
2012-01-23 15:48:08 -08:00
Brian Anderson
a88c0847c2 core: Reexport all the imports in f32/64 2012-01-22 16:42:00 -08:00
Niko Matsakis
ec8273587c update to new tag syntax 2012-01-21 19:31:52 -08:00
Niko Matsakis
85a3298229 unify size_of, align_of into one call (metrics)
create some new (xfail'd) tests looking at tag variant alignment
2012-01-21 19:31:52 -08:00
Niko Matsakis
cd1056df78 migrate size_of() and related funcs from trans into shape 2012-01-21 19:31:51 -08:00
Graham Fawcett
7763b40c71 issue #1352: change param order on vec::init_elt, putting block in final position.
To match the init_fn() and init_fn_mut() changes.
2012-01-21 13:33:16 -08:00
Graham Fawcett
35d12be2ce fix #1352: change param order on vec::init_fn (and vec::init_fn_mut), putting block in final position. 2012-01-21 13:31:12 -08:00
Brian Anderson
8c92ea49d3 core: Shuffle around a #fmt test 2012-01-21 13:20:14 -08:00