Commit Graph

1360 Commits

Author SHA1 Message Date
Brian Anderson
93d3b8aa6b Convert class methods to impl methods. Stop parsing class methods 2012-09-10 16:13:08 -07:00
Patrick Walton
bea6fe0ec1 rustc: Trim down and rename trans_compare. Now only eq shape glue remains. 2012-09-10 15:48:05 -07:00
Patrick Walton
7e9f98a8c9 rustc: Make range literals use compare_scalar_types instead of trans_compare 2012-09-10 15:27:12 -07:00
Patrick Walton
3c7cc9a1b8 rustc: Long lines 2012-09-10 15:12:37 -07:00
Patrick Walton
d6ceef95ba rustc: Move trans_compare into alt.rs 2012-09-10 15:10:28 -07:00
Niko Matsakis
04f1763409 Combine the vtable_origins from impl + method.
Not as clean as it could be, but fixes #3314.
2012-09-10 12:59:17 -07:00
Patrick Walton
22b8757705 rustc: Make shape-based compare glue never called for comparison operators.
Only called for string patterns.
2012-09-10 12:48:42 -07:00
Brian Anderson
e0c232025c Long lines 2012-09-09 17:23:29 -07:00
Brian Anderson
f53c2948aa Rename variables that clash with keywords 2012-09-09 16:53:19 -07:00
Brian Anderson
9c98d0f99b Fix some old syntax 2012-09-08 20:04:21 -07:00
Brian Anderson
3bd1f32cd9 Convert all kind bounds to camel case. Remove send, owned keywords. 2012-09-07 18:10:11 -07:00
Brian Anderson
07fe5611ad Remove import and export from intrinsic.rs 2012-09-07 18:08:03 -07:00
Brian Anderson
2810ea9a68 Convert 'again' to 'loop'. Remove 'again' keyword 2012-09-07 17:39:03 -07:00
Graydon Hoare
5d823d46ad Migrate std::map to use core:#️⃣:Hash trait. Disable many hokey hashes. 2012-09-07 17:24:16 -07:00
Tim Chevalier
f5093dff7b Remove support for multiple traits in a single impl
There was half-working support for them, but they were never fully
implemented or even approved. Remove them altogether.

Closes #3410
2012-09-07 17:22:04 -07:00
Tim Chevalier
53ce42dc4f Implement &-patterns
Closes #2855
2012-09-07 17:09:07 -07:00
Brian Anderson
f0eae8f1c1 Convert field terminators to commas. Stop parsing semis. 2012-09-07 16:12:15 -07:00
Patrick Walton
1fcfee674a rustc: Add a str_eq lang item for pattern matching 2012-09-07 15:46:08 -07:00
Brian Anderson
2572e80355 Remove 'let' syntax for struct fields 2012-09-07 14:02:33 -07:00
Niko Matsakis
14303bad89 Do not copy values of type () or _|_
This can trigger a crash because we assume we
can supply null ptrs and undefined values for
values of those types, as we should be treated
them as zero-size.

Interestingly, this crash only shows up (atm)
in non-optimized builds.  Therefore, I added
a -Z no-opt flag so that the new test
(capture_nil) can specify that it should not
run with optimizations enabled.
2012-09-07 13:00:03 -07:00
Patrick Walton
c21b3ff818 rustc: Make "ne" use traits 2012-09-07 12:44:53 -07:00
Patrick Walton
b4d879a2ef rustc: Trailing whitespace 2012-09-07 12:27:44 -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
Tim Chevalier
ac1f84c153 Don't check impl ty params for equality with trait ty params
This was too restrictive. We need to check the number of ty params,
and that the bounds are equal, but otherwise require_same_types does the job.

Closes #2611
2012-09-07 12:11:17 -07:00
Tim Chevalier
c6b51547c1 In typeck, don't assume traits with default methods are in the same crate
But note that default methods still don't work cross-crate (see #2794) --
this just makes it so that when a method is missing in a cross-crate impl,
the right error message gets printed.

Closes #3344
2012-09-07 10:27:29 -07:00
Niko Matsakis
cd3cc6d17b Ensure that scratch datum's are zeroed out in the alloca phase.
This should address the valgrind failure that @elliotslaughter
was seeing, though I am not sure why the bots / test continued
to pass, since this is precisely the condition this test was looking
for!
2012-09-07 09:32:56 -07:00
Elliott Slaughter
3f0d207b32 gc: Add stack walker for new garbage collector.
Safe points are exported in a per-module list via the crate map. A C
runtime call walks the crate map at startup and aggregates the list of
safe points for the program.

Currently the GC doesn't actually deallocate memory on malloc and
free. Adding the GC at this stage is primarily of testing value.

The GC does attempt to clean up exchange heap and stack-allocated
resource on failure.

A result of this patch is that the user now needs to be careful about
what code they write in destructors, because the GC and/or failure
cleanup may need to call destructors. Specifically, calls to malloc
are considered unsafe and may result in infinite loops or segfaults.
2012-09-07 09:21:21 -07:00
Niko Matsakis
fb8786fe52 Refactor fn_ty, working towards #3320 2012-09-07 07:54:11 -07:00
Tim Chevalier
46990ad111 Use callee ID when kind-checking expressions that may be overloaded
And fix up test cases that should have failed if not for this bug.

Closes #2587
2012-09-06 15:44:10 -07:00
Niko Matsakis
c5e2cf2ee5 Repair long lines 2012-09-06 15:40:11 -07:00
Niko Matsakis
ee4ba4490d Issue #3402: Load immediate rvalues right away
Should lead to smaller stack frames, hopefully reducing
the perf hits we saw
2012-09-06 15:23:03 -07:00
Niko Matsakis
fe9f0556d2 Refactor ty_var and ty_var_integral into one ty_infer variant 2012-09-06 12:31:33 -07:00
Brian Anderson
b4e547d71a Remove struct ctors 2012-09-06 10:52:26 -07:00
Niko Matsakis
5e36a99794 Refactor trans to replace lvalue and friends with Datum.
Also:
- report illegal move/ref combos whether or not ref comes first
- commented out fix for #3387, too restrictive and causes an ICE
2012-09-06 06:11:12 -07:00
Tim Chevalier
3a34c96086 Add a lint pass for structural records
Closes #3322
2012-09-05 18:35:30 -07:00
Patrick Walton
0a852e0da0 rustc: Make "priv" work on enum variants 2012-09-05 17:24:28 -07:00
Graydon Hoare
81695d85dc Mark crate metadata with a version tag. Close #3390. 2012-09-05 16:53:55 -07:00
Patrick Walton
31af60b257 rustc: Fix double-reporting of private item errors. Un-XFAIL private-item-simple.rs. 2012-09-05 16:21:53 -07:00
Patrick Walton
47dac47e96 rustc: "import" -> "use" in .rc files 2012-09-05 11:46:25 -07:00
Vincent Belliard
d12128f56f fix issue #3222 2012-09-05 16:38:00 +02:00
Patrick Walton
9b88b5fe38 rustc: Don't allow private fields to be named in constructors or destructured 2012-09-04 19:07:23 -07:00
Patrick Walton
fba673b26b rustc: Implement private methods.
Doesn't work cross-crate yet.
2012-09-04 18:30:27 -07:00
Brian Anderson
a618d0d7ce std: Convert test to camel case 2012-09-04 18:26:30 -07:00
Tim Chevalier
451da07718 Allow anonymous extern mods
Now you can write:

extern {
  f() -> int;
}

and f will be accessible in the enclosing scope.
2012-09-04 16:41:19 -07:00
Brian Anderson
c491bf939e std: Camel case smallintmap 2012-09-04 16:04:10 -07:00
Brian Anderson
200959d7ce Remove 'with' 2012-09-04 15:47:04 -07:00
Patrick Walton
127144bf38 rustc: Implement private fields for max/min classes 2012-09-04 14:50:46 -07:00
Brian Anderson
3764fe3f2a std: Camel case list 2012-09-04 14:12:49 -07:00
Patrick Walton
a26837c478 rustc: "import" -> "use" 2012-09-04 11:54:36 -07:00
Brian Anderson
5aedabf1a3 rustc: Run all intrinsics through the monomorphiser
Intrinsics always want to be inlined.
2012-09-03 16:46:15 -07:00