Commit Graph

1637 Commits

Author SHA1 Message Date
Graydon Hoare
dffe188991 Install new pub/priv/export rules as defaults, old rules accessible under #[legacy_exports]; 2012-09-21 18:11:43 -07:00
Patrick Walton
3c2b6110dd rustc: Shove the address of the box annihilator into the crate map 2012-09-21 11:42:57 -07:00
Brian Anderson
a51a561852 rustc: Remove middle/tstate
I feel like I've done this before
2012-09-21 00:45:25 -07:00
Brian Anderson
f5be40384f Revert "syntax: Make attributes sendable for rustdoc's benefit"
This reverts commit 90e3665fa7.
2012-09-20 18:15:39 -07:00
Brian Anderson
90e3665fa7 syntax: Make attributes sendable for rustdoc's benefit 2012-09-20 17:37:21 -07:00
Brian Anderson
1b5efaac27 syntax: Pass the correct crate_cfg to the syntax expander 2012-09-20 16:41:53 -07:00
Brian Anderson
7abf55736c core: Move 'unreachable' to util. Improve docs 2012-09-20 14:27:37 -07:00
Niko Matsakis
77b0845a84 fix long lines 2012-09-20 14:08:21 -07:00
Niko Matsakis
1983e3d8d7 Make + mode by-value if the type is immediate, by-ref otherwise
Fixes #3523
2012-09-20 14:04:38 -07:00
Graydon Hoare
348d07f099 Remove export_map from resolve, just use export_map2. 2012-09-20 13:08:50 -07:00
Patrick Walton
5cd9d4d9dd libcore: Make BytesWriters not require shared boxes. 2012-09-20 11:18:22 -07:00
Patrick Walton
9117dcb968 rustc: De-mode all overloaded operators 2012-09-20 09:48:05 -07:00
Brian Anderson
74dbdecb59 Remove old stage0 compat gunk 2012-09-19 19:25:29 -07:00
Niko Matsakis
cfed923600 demode the each() method on vec and other iterables. 2012-09-19 17:03:01 -07:00
Graydon Hoare
5e41739562 Remove final bits of residual hokey-hash functions. Close #1616. 2012-09-19 16:35:53 -07:00
Graydon Hoare
1ffd90edbc Remove redundant hashmap constructor functions. 2012-09-19 15:51:44 -07:00
Graydon Hoare
384906c1e8 Remove unused hokey-hashes from typeck and region inference. 2012-09-19 15:51:44 -07:00
Graydon Hoare
bac89eae48 Remove hokey-hashes from metadata indexes. 2012-09-19 15:51:44 -07:00
Niko Matsakis
9cf271fe96 De-mode vec::each() and many of the str iteration routines
Note that the method foo.each() is not de-moded, nor the other
vec routines.
2012-09-19 10:52:59 -07:00
Niko Matsakis
53abb5edbd use && for fn() even in legacy mode to work around mem leak 2012-09-19 06:56:29 -07:00
Niko Matsakis
8d4928f780 Revert "replace explicit calls to vec::each with vec::each_ref, partially demode str"
This reverts commit 1be24f0758.

Not quite ready.
2012-09-18 21:41:13 -07:00
Niko Matsakis
1be24f0758 replace explicit calls to vec::each with vec::each_ref, partially demode str 2012-09-18 21:31:00 -07:00
Brian Anderson
2906f2de31 core: Rename 'unsafe' mod to 'cast' 2012-09-18 19:36:25 -07:00
Graydon Hoare
e86e8c16e6 Revert "change relative priority of auto-slice and auto-ptr"
This reverts commit 2ac64d91ac.
2012-09-18 16:41:51 -07:00
Graydon Hoare
9b58369f6b Treat static slices and rptrs as sendable. 2012-09-18 16:28:16 -07:00
Patrick Walton
e653d493fb rustc: Remove legacy mode inference, unless #[legacy_modes] is used 2012-09-18 15:53:04 -07:00
Niko Matsakis
2ac64d91ac change relative priority of auto-slice and auto-ptr
rationale: if you have an impl for &const ~[T] or &mut ~[T]
and one for &[T], the first will be more likely to work and not lead
to borrowck errors.  I could imagine us wanting to offer multiple
impls for methods we select the ptr-to-array when possible and
the slice when necessary.  Also, taking a ptr seems like fewer
adaptations than slicing, and we tend to prefer fewer adaptations.
2012-09-18 14:24:52 -07:00
Erick Tryzelaar
d0d68c6036 libcore: make a copyless io::BytesWriter 2012-09-18 12:56:57 -07:00
Brian Anderson
eb35039fe8 Change 'must' to 'should' in non_camel_case_types message 2012-09-18 12:18:00 -07:00
Brian Anderson
2d11a04e74 libsyntax: Remove 'unchecked_blk' from AST 2012-09-18 11:51:17 -07:00
Patrick Walton
c755449fd6 Revert "rustc: Change all non-keyword uses of "link""
This reverts commit 3b013cd800.
2012-09-18 11:47:04 -07:00
Brian Anderson
2cdb23bbc0 Replace uses of 'unchecked' with 'unsafe' 2012-09-18 11:31:57 -07:00
Niko Matsakis
efa6675f1d make filetype() include the "." (fixes #3412) 2012-09-18 11:29:53 -07:00
Patrick Walton
3b013cd800 rustc: Change all non-keyword uses of "link" 2012-09-18 11:27:37 -07:00
Brian Anderson
859a892eb0 Add allow(non_camel_case_types) to unconverted crates 2012-09-18 11:21:07 -07:00
Niko Matsakis
1af4a70759 Revert "Adapt callee to avoid intermediary for move/copy arguments (cc #3402)"
This reverts commit 044fbea416.
2012-09-18 10:41:05 -07:00
Brian Anderson
f563c0b525 warn(non_camel_case_types) by default 2012-09-17 18:52:50 -07:00
Niko Matsakis
2469cba0b1 Make auto-slice, auto-ptr not exclusive (fixes #3514) 2012-09-17 11:00:50 -07:00
Niko Matsakis
527a6f60f1 WIP: make autoslice, autoptr not be mutually exclusive 2012-09-17 09:49:53 -07:00
Erick Tryzelaar
b73f801cc1 int/uint parse_buf => parse_bytes (#3444) 2012-09-15 13:38:41 -07:00
Erick Tryzelaar
651e63cc5c libcore: rename *flate_buf to *flate_bytes (#3444) 2012-09-15 13:38:41 -07:00
Niko Matsakis
e874d37569 add some debug!'s to help diagnose failure of issue-1763.rs 2012-09-15 13:37:35 -07:00
Niko Matsakis
4cad58c464 Fix broken assertion in regionck for code like (a[])() 2012-09-15 12:29:36 -07:00
Niko Matsakis
39d33a653f regionck: fix bug where autoref regions are not inferred to be large enough 2012-09-15 07:35:09 -07:00
Patrick Walton
73e8ce1e1f rustc: Back out box annihilator 2012-09-14 19:59:07 -07:00
Graydon Hoare
aa2ab2659f Add core::reflect, start migrating core::repr to use it. Tidy up various Repr types. 2012-09-14 19:09:38 -07:00
Patrick Walton
1c5db46f8e rustc: Call the box annihilator in main 2012-09-14 18:05:15 -07:00
Patrick Walton
ce773352d0 rustc: Make the box annihilator a language item 2012-09-14 16:50:12 -07:00
Niko Matsakis
7107b4eff5 Have parser recognize static, self region.
Fixes a bug in methods that &self couldn't be referenced in the
body. Also fixes #2479.
2012-09-14 15:22:15 -07:00
Niko Matsakis
044fbea416 Adapt callee to avoid intermediary for move/copy arguments (cc #3402) 2012-09-14 12:03:28 -07:00
Graydon Hoare
120a3dede0 Fix unused variable warning. 2012-09-13 19:53:30 -07:00
Niko Matsakis
0e584f2e74 Fix bug in auto-ref on bounded type parameters 2012-09-13 13:24:34 -07:00
Niko Matsakis
2f6b66ecd3 s/vec::as_buf/vec::as_imm_buf/, fix comment, remove set.rs
hat tip to @jruderman
2012-09-13 13:24:33 -07:00
Niko Matsakis
e21b48c0ce remove commented code that used to cause borrowck error
Fixes #2280
2012-09-13 09:14:49 -07:00
Brian Anderson
308ca06012 Rename str::unsafe to str::raw 2012-09-12 19:55:16 -07:00
Niko Matsakis
34bf0b9e97 trans: overhaul match bindings. No more phi, one code path for guards.
Fixes #3256.
Fixes #3291.
2012-09-12 18:15:22 -07:00
Brian Anderson
ff54ac8e59 Rename vec::unsafe to vec::raw 2012-09-12 17:45:36 -07:00
Brian Anderson
7568dd4564 Promote 'const', 'copy', 'fn' to strict keywords 2012-09-12 16:00:22 -07:00
Niko Matsakis
7eb10c4ce1 purge the separate path for rel ops (e.g., ==) vs other bin ops 2012-09-12 15:41:22 -07:00
Brian Anderson
fa74edf1a0 rustc: Use the correct 'fail' rtcall 2012-09-12 15:04:40 -07:00
Graydon Hoare
719a4750ba Add some monomorphizing instrumentation, simplify types before emitting glue. 2012-09-12 14:48:18 -07:00
Niko Matsakis
5d540de769 fixup mutability of vec::each, make iter_bytes pure
also, change DVec() to work with imm vectors rather than mut ones
2012-09-12 13:29:31 -07:00
Brian Anderson
8fbe4b5841 Rename core::rt_fail to core::rt_fail_ 2012-09-12 11:52:00 -07:00
Tim Chevalier
86e02554fd Make moves in arguments explicit in libsyntax and rustc 2012-09-12 11:33:40 -07:00
Niko Matsakis
8a8f200d10 Introduce auto adjustment table to subsume autoderef/autoref/borrowings.
Fixes #3261
Fixes #3443
2012-09-11 21:25:01 -07:00
Tim Chevalier
02b41097e4 Make the 'move mode but datum will not store' error fatal 2012-09-11 20:02:34 -07:00
Tim Chevalier
8f34752975 Remove dead code 2012-09-11 20:02:34 -07:00
Brian Anderson
be1fdf983f Promote 'impl' from restricted keyword to strict 2012-09-11 19:28:44 -07:00
Brian Anderson
ea01ee2e9e Convert 'use' to 'extern mod'. Remove old 'use' syntax 2012-09-11 19:25:43 -07:00
Brian Anderson
27cc0a36b6 Promote 'struct' from a restricted keyword to a strict keyword 2012-09-11 17:15:33 -07:00
Tim Chevalier
3aa5b0cb44 Make moves explicit in rustc 2012-09-11 13:59:57 -07:00
Patrick Walton
4a865401f5 rustc: Remove a bunch of unused upcalls 2012-09-11 12:17:48 -07:00
Patrick Walton
23880daef2 rustc: Remove the cmp type upcall 2012-09-11 12:12:13 -07:00
Brian Anderson
298eb8c726 Convert 'import' to 'use'. Remove 'import' keyword. 2012-09-10 19:04:26 -07:00
Brian Anderson
1a8a0a77b1 Camel case std::serialization 2012-09-10 19:02:57 -07:00
Patrick Walton
2aa67e9aa9 rustc: Stop calling cmp shape glue in trans.
XFAIL's alt-borrowed_str for now. Will need to fix this up in the future.
2012-09-10 17:26:17 -07:00
Brian Anderson
cb7a5395dd Convert std::map to camel case 2012-09-10 17:08:36 -07:00
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
Brian Anderson
ac31fdd9c4 Fix cross-crate inlining of intrinsics 2012-09-03 16:01:51 -07:00
Patrick Walton
5573ad723f rustc: Fix an LLVM assertion that tripped when borrowing a by-val method receiver.
In certain lvalue code paths, the type of the borrowed value was not
being used to generate temporary spills. I'm a bit surprised we didn't
hit this sooner.
2012-09-03 15:59:10 -07:00
Brian Anderson
f393100b7c Camel case core::ops 2012-09-02 18:13:56 -07:00
Patrick Walton
b808cfbb74 rustc: Don't translate the expression twice when adapting a borrowed method receiver. Closes #3357.
Adds a test case. I had to stare at this one for a bit.
2012-09-02 16:51:05 -07:00
Brian Anderson
7fb1a4e2d1 Camel case core::intrinsic 2012-09-02 15:19:52 -07:00
Brian Anderson
80c4f74c29 Remove the 'to' keyword 2012-09-01 18:38:18 -07:00
Brian Anderson
d777e51333 Demode reinterpret_cast 2012-09-01 18:18:29 -07:00
Tim Chevalier
4128cc4cb4 Make utility funs in core::int, core::uint, etc. not by-reference
Closes #3302
2012-08-31 16:21:47 -07:00
Zack Corr
638db28c47 jit: Correct formatting and argv[0] for JITted programs 2012-08-31 16:20:36 -07:00
Zack Corr
efb576a60d jit: Clean rustllvm code, let rustc expose __morestack instead of linking in libmorestack and return _rust_main and call it from rustc 2012-08-31 16:20:36 -07:00
Brian Anderson
b999973c0f Add a morestack_addr (temporary) intrinsic 2012-08-31 16:20:36 -07:00
Zack Corr
a02ab41b65 jit: correct formatting 2012-08-31 16:20:36 -07:00
Zack Corr
19ea3ab480 jit: Add passes and cleanup code 2012-08-31 16:20:36 -07:00
Zack Corr
7993f48209 jit: Add custom memory manager (still segfaulting) 2012-08-31 16:20:35 -07:00
Zack Corr
d7aa9918ef Add experimental JIT compiler 2012-08-31 16:20:35 -07:00
Lindsey Kuper
6d8d258f35 Tag things that have to do with default methods with issue #2794. 2012-08-31 19:09:01 -04:00
Patrick Walton
5b4d5cee03 rustc: Make entire crates privileged scopes for the purposes of coherence 2012-08-31 15:14:15 -07:00
Kevin Cantu
7d57b4864a Remove deprecated modes from list.rs (and temporarily delete list::push) 2012-08-31 12:55:39 -07:00
Patrick Walton
6e7d5e1cbd rustc: Implement "use mod" 2012-08-31 11:20:50 -07:00
Patrick Walton
4846affedb rustc: "extern mod { ... }" should be written "extern { ... }" instead 2012-08-30 17:10:07 -07:00
Patrick Walton
1f056eda8e rustc: Make the compiler no longer ICE on unused foreign constants 2012-08-30 16:08:58 -07:00
Brian Anderson
65b05a6ce8 Bump version to 0.4 2012-08-30 14:05:59 -07:00
Patrick Walton
a1c11cab2d rustc: Make <=, >=, and > use traits as well 2012-08-29 19:23:15 -07:00
Patrick Walton
96534365c2 rustc: Make < and = into traits 2012-08-29 18:25:22 -07:00
Brian Anderson
c0c8d3aa8f core: Demode int/uint mods 2012-08-29 16:23:36 -07:00
Brian Anderson
ee2ce036cc Camel case more std types 2012-08-29 16:09:50 -07:00
Brian Anderson
aab4d6b8d7 std: Camel case some constructors 2012-08-29 15:34:38 -07:00
Brian Anderson
8aca44ee0c core: Don't normalize paths by default. Add a normalize method 2012-08-29 14:28:37 -07:00
Graydon Hoare
5eef15df12 Rename resolve3 -> resolve. 2012-08-29 13:26:52 -07:00
Tim Chevalier
cb8ecd7984 Allow extern mods to be anonymous
extern mod {
  f();
}

is now allowed, and puts f in the enclosing scope. (Requires a
link_name attribute to be really useful...)
2012-08-29 12:22:05 -07:00
Niko Matsakis
75201cdc04 vtable.rs: adjust formatting, correct build error 2012-08-29 06:07:17 -07:00
Niko Matsakis
e9ac7489b5 Refactor representation of borrowing so that it is tracked by fn_ctxt and not infer 2012-08-29 05:27:43 -07:00
Tim Chevalier
06675caa42 Comment the default case in typeck::check::vtable::lookup_vtable copiously
Try to save the next person who looks at this code the heartbreak that I
went through.
2012-08-28 19:51:11 -07:00
Tim Chevalier
a70e37b214 In ty::impl_traits, treat structs properly
Treat structs just like impls: use their associated list of
trait refs to get the list of traits that one of them implements.
I don't understand what was happening before, but it was wrong.

Closes #2936
2012-08-28 19:51:11 -07:00
Ben Striegel
a605fd0cad CamelCasify lots of std 2012-08-28 18:52:44 -07:00
Graydon Hoare
ecb646477b Add lint modes for uses of @ and ~ pointers, in general. 2012-08-28 18:25:41 -07:00
Graydon Hoare
b769e29680 Compress metadata section. Seems a minor speed win, major space win. 2012-08-28 14:50:39 -07:00
Elliott Slaughter
0031617f30 rustc: Add cfg(gc) and cfg(nogc).
Needed in libcore to determine whether core::gc is being compiled with
GC on or not, which then affects various safety checks to avoid
collecting memory the GC is itself using.
2012-08-28 11:05:32 -07:00
Brian Anderson
161a82e433 Camel case various core constructors 2012-08-27 17:22:18 -07:00
Graydon Hoare
88e0476bd0 Add some counters to metadata. 2012-08-27 16:59:30 -07:00
Brian Anderson
1cd97ee47d Mark intrinsic::tydesc with #[allow(non_camel_case_types)] 2012-08-27 15:06:46 -07:00
Brian Anderson
0c6e470a25 Convert core::result to camel case 2012-08-27 14:37:04 -07:00
Patrick Walton
3a1582012e libcore: Implement ord and eq language items 2012-08-27 14:27:43 -07:00
Patrick Walton
2bb056f4ab rustc: Avoid an allocation on every GEPi 2012-08-27 14:27:42 -07:00
Niko Matsakis
6d788198d7 fix a few remaining unused pattern binding warnings 2012-08-27 14:10:55 -07:00
Erick Tryzelaar
3e6ddf72ba rustc: make sure to import shr. 2012-08-27 14:10:55 -07:00
Erick Tryzelaar
ad19609dbc rustc: Fix typo in variant name 2012-08-27 14:10:55 -07:00
Erick Tryzelaar
c83ab4bcb8 rustc: import vstore_uniq 2012-08-27 14:10:55 -07:00
Erick Tryzelaar
65bd46c8a5 rustc: more pattern cleanup 2012-08-27 14:10:54 -07:00
Erick Tryzelaar
5ce5ee86bc rustc: fix the unused pattern vars warnings. 2012-08-27 14:10:54 -07:00
Elliott Slaughter
38fee9526a rustc: When landing pads are off, avoid skipping cleanup code.
This forces various things to be created (e.g. drop glue), and also
happens to be necessary for GC liveness to recognize cleanups as
roots.
2012-08-27 12:48:35 -07:00
Elliott Slaughter
5593add3a8 rustc: Break cyclical dependence between emit_tydescs and gen_shape_tables.
Force all tydescs to be emitted before emit_tydescs to avoid linker
failures.
2012-08-27 12:48:35 -07:00
Brian Anderson
8337fa1a54 Camel case the option type 2012-08-26 15:56:16 -07:00
Patrick Walton
62be878ed1 rustc: Use memmove in unsafe::reinterpret_cast (issue #3025).
This was causing a bunch of structural copies, which when inlined
was leading to enormous register pressure. Often this is seen in
code which makes use of result::unwrap.
2012-08-26 11:25:53 -07:00
Patrick Walton
ff9151fa55 rustc: Use memset when zeroing allocas out (issue #3025).
Previously, LLVM was generating a ton of byte-by-byte copies,
leading to huge numbers of vregs and bloating the code. Now, using
memset, the code becomes a nice series of SSE moves instead.
2012-08-26 10:50:06 -07:00
Patrick Walton
80429dd7bd rustc: Add some more debugging to vtable 2012-08-25 23:13:50 -07:00
Brian Anderson
09df8f1abf Fix more unused variable warnings 2012-08-25 18:38:21 -07:00
Patrick Walton
8ef4551904 rustc: Implement foreign constants.
This is needed for a lot of Apple libraries, as Apple tends to put a lot of
globals in dynamic libraries.
2012-08-25 15:09:33 -07:00
Tim Chevalier
33ba097069 Add backquotes to error message 2012-08-25 09:15:26 -07:00
Vincent Belliard
bdbedb9d35 implements issue #2356 2012-08-25 17:01:52 +02:00
Tim Chevalier
5e22fb9c7f Remove match check 2012-08-24 22:28:12 -07:00
Tim Chevalier
0dad78e03d Eliminate match checks in trans and typeck 2012-08-24 20:45:30 -07:00
Michael Sullivan
90812c143d Rework method lookup to properly handle self types for non impl matches. Closes #3268. Closes #3274. 2012-08-24 17:57:41 -07:00
Michael Sullivan
6a56212649 A bunch of code refactoring in method matching. 2012-08-24 17:57:41 -07:00
Michael Sullivan
cf62433f43 Comments only: fix a comment in method resolution. 2012-08-24 17:57:41 -07:00
Graydon Hoare
c284b8b1dc Start using core::path2::Path in a lot of places. 2012-08-24 15:51:16 -07:00
Niko Matsakis
a8f1bee457 fix some unused pattern binding warnings 2012-08-24 15:37:21 -07:00
Michael Sullivan
e55c5ceac2 Infer purity for || style closures. Closes #3023. 2012-08-24 14:21:27 -07:00
Michael Sullivan
2c96a43cf1 Get rid of the unsafe hacks in resolve3. Closes #3267. 2012-08-24 14:21:26 -07:00
Elliott Slaughter
7706262a73 rustc: Add flag for enabling GC. 2012-08-24 14:01:27 -07:00
Elliott Slaughter
30768d3609 rustc: Don't emit metadata for default and GC box addrspaces. 2012-08-24 14:01:27 -07:00
Elliott Slaughter
e68db3ad3c rustc: Fix for updated macro syntax. 2012-08-24 14:01:26 -07:00
Elliott Slaughter
a7a74c79fa rustc: Emit index of tydescs by addrspace. 2012-08-24 14:01:26 -07:00
Elliott Slaughter
c2e99ba826 rustc: Root resources with addrspaces. 2012-08-24 14:01:26 -07:00
Ben Blum
37bcd67a09 Enforce copyability in bind_by_value match arms (fix #3255) 2012-08-24 16:43:03 -04:00
Niko Matsakis
e47d2f6060 extend liveness to treat bindings more like other variables
This results in a lot of warnings in rustc.  I left them in because
many are bugs and we should fix our code, but Graydon asked that
I not touch every file in the codebase.
2012-08-24 12:55:08 -07:00
Michael Sullivan
0f996f70a6 Remove purity from fn_decl and move it out to containing AST elements. 2012-08-23 19:40:01 -07:00
Ben Blum
673d0d83cf Less confusing error message when copying into heap closures (close #2942) 2012-08-23 22:07:56 -04:00
Niko Matsakis
a08f3a7d4d More complete fix to #3162 (borrowck bug related to access to rec fields) 2012-08-23 18:54:08 -07:00
Niko Matsakis
5ccf8175a8 don't consider use of @fn to be region-param'd 2012-08-23 17:55:04 -07:00
Tim Chevalier
6b6bea9531 Add boolean constants as part of const_eval
Doesn't exactly eliminate a match check, but simplifies the logic a bit
2012-08-23 17:22:08 -07:00
Niko Matsakis
5eea7d6e61 don't infer region paramaterization for ids in a bound context 2012-08-23 16:22:23 -07:00
Tim Chevalier
9f591319dd Rename str::bytes to str::to_bytes
Closes #3245
2012-08-23 15:46:10 -07:00
Ben Blum
caceac06ce Remove old-moded atomic intrinsics (#3200) 2012-08-23 16:54:25 -04:00
Niko Matsakis
3cf74564b8 update liveness to camel-cased conventions, silence warnings 2012-08-23 12:38:18 -07:00
Paul Stansifer
29f32b4a72 m1!{...} -> m1!(...) 2012-08-23 11:14:14 -07:00
Michael Sullivan
0f0a9775ba Some error message cleanup in check.rs. 2012-08-23 10:21:35 -07:00
Ben Blum
5d5cfcc005 Merge pull request #3258 from erickt/serialization
Fixing serialization no-implicit-copies warnings, and other misc cleanup
2012-08-23 09:37:21 -07:00
Niko Matsakis
511e7626ae Infer variance of types with respect to the region parameter.
A similar approach could be used for type parameters.

Fixes #2282.
2012-08-23 06:30:43 -07:00
Tim Chevalier
c8ce32e7f4 Represent "item families" in the decoder as an enum
This eliminates some match checks. Also get rid of other match checks
in metadata code.
2012-08-22 20:32:09 -07:00
Erick Tryzelaar
cfa71a135b rustc: add all the pretty printer modes to error message 2012-08-22 19:10:28 -07:00
Brian Anderson
4ef1d9d5b5 rustc: Remove typestate source 2012-08-22 18:33:19 -07:00
Ben Blum
9f0b3e3164 remove a debug print statement moving out of enums 2012-08-22 21:16:34 -04:00
Tim Chevalier
f61bbe2709 Dead code elimination 2012-08-22 17:52:27 -07:00
Ben Blum
37962288ec Compile moving out of enums (#2329) 2012-08-22 20:40:25 -04:00
Ben Blum
5b25fc918a Parse and typecheck moving out of enums (#2329) 2012-08-22 20:40:25 -04:00
Tim Chevalier
1b804ce343 Merge find_linkage_attrs with find_linkage_metas
This gets rid of a gratuitous `match check`.
2012-08-22 16:43:23 -07:00
Paul Stansifer
1153b5dcc8 intern identifiers 2012-08-22 14:59:25 -07:00
Michael Sullivan
744fea1a4f Track the type of self properly. Closes #3247. 2012-08-22 13:18:29 -07:00
Tim Chevalier
7284969292 Eliminate many match checks in rustc 2012-08-22 12:25:08 -07:00
Niko Matsakis
ce3cc46ce6 Fix generation of generic methods with explicit self
There used to be two distinct code paths.  Now there is one.
2012-08-21 20:15:22 -07:00
Ben Blum
9b489f6fff Don't refute "()" in let-bindings (fixes #3104). 2012-08-21 21:05:01 -04:00
Ben Blum
f5332769d5 Convert atomic intrinsics away from old argument modes (partial #3200) 2012-08-21 15:30:53 -04:00
Niko Matsakis
9423302c82 remove trailing whitespace 2012-08-21 11:24:41 -07:00
Niko Matsakis
652b312122 more sound treatment of fn& regions; change all & to be distinct 2012-08-21 10:28:34 -07:00
Niko Matsakis
8ee79c79aa new region inference, seperate infer into modules, improve error msgs
Fixes #2806
Fixes #3197
Fixes #3138
2012-08-20 22:00:06 -07:00
Michael Sullivan
71ec545614 Try to do some resolution of vtables earlier, in a fairly ad-hoc way. Closes #3156. 2012-08-20 19:00:27 -07:00
Ben Blum
c321cdbac6 Disallow deconstructing destructing structs (fixes #3147) 2012-08-20 20:05:00 -04:00
Ben Blum
849d5649ef remove fixme in check::alt 2012-08-20 18:25:05 -04:00
Ben Blum
aa3df17445 Re-allow pattern-matching structs (#3215) 2012-08-20 18:22:11 -04:00
Michael Sullivan
a14485b7fd Do vtable resolution for *all* method calls, not just statically resolved ones... Closes #3221. 2012-08-20 13:36:15 -07:00
Patrick Walton
19b8598c09 rustc: Implement "priv" for simple items.
Inherited privacy doesn't work yet. This probably requires a snapshot since
it won't be backwards compatible. Additionally, two errors are printed instead
of one. For this reason the test is XFAIL'd.
2012-08-17 17:56:47 -07:00
Niko Matsakis
4b1d83ca64 fix deprecated-mode lint warning to consider dtors 2012-08-17 17:31:03 -07:00
Michael Sullivan
457e78cd53 Make by-val explicit self actually work. Closes #2585. 2012-08-17 17:14:32 -07:00
Patrick Walton
6b1a9af173 rustc: Remove all the code dealing with named implementations in resolve3 2012-08-17 17:09:53 -07:00
Patrick Walton
26aaf08ff4 rustc: Remove the impl map 2012-08-17 16:53:07 -07:00
Patrick Walton
10c997a746 rustc: Get rid of the impl_map in the encoder 2012-08-17 16:38:07 -07:00
Patrick Walton
1ed94a5674 rustc: Prevent destructors from being run twice with the repeated vector syntax 2012-08-17 16:12:07 -07:00
Patrick Walton
9ea6b3a32e rustc: Remove a few allocations from metadata. Shaves a few milliseconds off compilation of hello world. 2012-08-17 15:54:18 -07:00
Patrick Walton
69daeffddb rustc: Remove a bunch of unused metadata tags from common 2012-08-17 15:25:40 -07:00
Patrick Walton
f79006937a rustc: Remove tag_paths and all of the associated encoding 2012-08-17 15:23:44 -07:00
Niko Matsakis
ea549e7a71 make borrowck more conservative around rvalues.
this will require more temporaries, but is probably less magical.
also, it means that borrowck matches trans better, so fewer crashes.
bonus.

Finally, stop warning about implicit copies when we are actually borrowing.

Also, one test (vec-res-add) stopped failing due to #2587, and hence I
added an xfail-test.

Fixes #3217, #2977, #3067
2012-08-17 15:14:13 -07:00
Patrick Walton
8f01343f01 rustc: Remove resolve_path 2012-08-17 15:07:14 -07:00