Commit Graph

413 Commits

Author SHA1 Message Date
bors
b88e4f3b9f auto merge of #5039 : alexcrichton/rust/issue-4875, r=catamorphism
It looks like the type for the whole pattern wasn't being written back, so when privacy tried to look it up everything died.
2013-02-19 17:38:29 -08:00
Alex Crichton
cc3fbcee51 Fix for issue 4875 2013-02-19 17:35:02 -05:00
bors
1f956fc3b2 auto merge of #4999 : erickt/rust/incoming, r=brson
This patch series is doing a couple things with the ultimate goal of removing `#[allow(vecs_implicitly_copyable)]`, although I'm not quite there yet. The main change is passing around `@~str`s in most places, and using `ref`s in others. As far as I could tell, there are no performance changes with these patches, and all the tests pass on my mac.
2013-02-19 12:24:30 -08:00
Erick Tryzelaar
68746cd4fb librustc: change driver::session::Session::str_of to return @~str 2013-02-19 10:11:05 -08:00
Erick Tryzelaar
b90ccc9a38 librustc: minor cleanup 2013-02-19 10:02:52 -08:00
Erick Tryzelaar
ae86c03af2 librustc: change check_item_non_camel_case_types to not copy 2013-02-19 10:02:52 -08:00
Erick Tryzelaar
3c0eca7940 librustc: convert creader and cstore to use @~strs 2013-02-19 10:02:52 -08:00
Erick Tryzelaar
a18e7d6656 librustc: minor cleanup 2013-02-19 10:02:52 -08:00
Erick Tryzelaar
53951afe48 librustc: convert lint_dict to take @~strs as keys 2013-02-19 10:02:52 -08:00
Erick Tryzelaar
04334c1ae0 librustc: convert LangItemsCollector::item_refs to take @~str as a key 2013-02-19 10:02:52 -08:00
Erick Tryzelaar
de5fdaf934 convert ast::meta_items to take @~strs 2013-02-19 10:02:52 -08:00
Erick Tryzelaar
a2b754788d convert syntax::attr to use @~strs 2013-02-19 10:02:51 -08:00
Kang Seonghoon
f513c567cb fix ICE after incorrect number of args in calls 2013-02-20 00:53:54 +09:00
bors
396f911925 auto merge of #5017 : catamorphism/rust/less-copy, r=catamorphism 2013-02-18 22:06:33 -08:00
bors
24603afc93 auto merge of #5010 : youknowone/rust/match_const_typecheck, r=catamorphism
Fix of issue #4968
2013-02-18 20:18:34 -08:00
bors
9ba2e65fd6 auto merge of #5004 : luqmana/rust/rename-use-import, r=catamorphism
Seems like my previous pull request got lost along the way somehow. So here it is updated.
2013-02-18 17:48:34 -08:00
Tim Chevalier
43dc67b74a rustc: Less copy in trans, rs=removing copies 2013-02-18 15:53:37 -08:00
Jeong YunWon
092b6114c1 add missing typecheck for const pattern match arm
Issue #4968
2013-02-19 00:56:02 +09:00
Luqman Aden
5b5ac331db Long lines. 2013-02-17 21:53:29 -05:00
Luqman Aden
0f09c106f0 libsyntax: Update view_item_use/import to reflect actual usage 2013-02-17 21:45:00 -05:00
Jed Davis
d009c6330b Make univariant enums act like structs, so that they're aligned correctly.
Consts of such enums are aligned correctly, so we could either misalign
them to match the type_of, or fix the type_of.  The latter seems like a
better idea.
2013-02-17 12:20:42 -08:00
Seth Pink
60bd4a5385 Removed more capture claueses. 2013-02-17 12:41:45 +10:00
Patrick Walton
548c0982ca librustc: Remove simplify_type and replace with sizing_type_of. rs=blocking-servo
`simplify_type` was bogus, as there was no way for it to handle enums
properly. It was also slow, because it created many Rust types at runtime. In
general creating Rust types during trans is a source of slowness, and I'd like
to avoid doing it as much as possible. (It is probably not possible to
eliminate it entirely, due to `subst`, but we should get rid of as much of it
as we can.) So this patch replaces `simplify_type` with `sizing_type_of`,
which creates a size-equivalent LLVM type directly without going through a
Rust type first.

Because this is causing an ICE in Servo, I'm rubber stamping it.
2013-02-16 10:20:52 -08:00
Patrick Walton
bb833ca0f0 librustc: Stop parsing impl Type : Trait and fix several declarations that slipped through. r=tjc 2013-02-15 16:59:56 -08:00
bors
566bcf2225 auto merge of #4969 : nickdesaulniers/rust/issue3869, r=brson
Issue #3869
review? @nikomatsakis 

Convert all uses of vec::slice to vec::view Issue #3869
Rename const_view to const_slice
Renamed mut_view to mut_slice
Fix windows build error.  `buf` is borrowed by the call to
`as_mut_buf()` and so we must invoke `slice()` outside of that
call.
2013-02-15 13:54:49 -08:00
Luqman Aden
99b3c07b4e librustc: Get rid of move. 2013-02-15 02:49:55 -08:00
bors
9727008ed0 auto merge of #4944 : catamorphism/rust/xxx-to-fixme, r=catamorphism 2013-02-14 23:11:13 -08:00
Tim Chevalier
3201c6fe3f rustc: De-XXX resolve and borrowck...
and remove an un-needed hashmap from resolve
2013-02-14 23:08:18 -08:00
bors
af2f0ef088 auto merge of #4927 : sanxiyn/rust/remove-dvec, r=catamorphism 2013-02-14 17:23:18 -08:00
Nick Desaulniers
5d62a4a52e Convert all uses of vec::slice to vec::view Issue #3869
Rename const_view to const_slice
Renamed mut_view to mut_slice
2013-02-14 16:14:32 -08:00
Patrick Walton
9143688197 librustc: Replace impl Type : Trait with impl Trait for Type. rs=implflipping 2013-02-14 14:44:12 -08:00
Daniel Micay
762ce323c0 stop applying noinline to glue code 2013-02-14 14:48:34 -05:00
Seo Sanghyeon
ae38935ff3 Remove DVec from check_const 2013-02-14 22:36:56 +09:00
bors
6efa3543a8 auto merge of #4922 : jbclements/rust/add-deriving-eq-to-asts, r=catamorphism
r?

Apply deriving_eq to the data structures in ast.rs, and get rid of the custom definitions of eq that were everywhere. resulting ast.rs is about 400 lines shorter.

Also: add a few test cases and a bunch of comments.

Also: change ast_ty_to_ty_cache to use node ids rather than ast::ty's. I believe this was a suggestion related to my changes, and it appears to pass all tests.

Also: tiny doc fix, remove references to crate keywords.
2013-02-13 18:49:29 -08:00
Nick Desaulniers
4445b38df2 Remove die!, raplace invocations with fail! Issue #4524 pt 3 2013-02-13 17:01:32 -08:00
bors
d5bf3b85d1 auto merge of #4908 : bstrie/rust/rimov3, r=pcwalton
This patch finishes removing inner vector mutability from the vast majority of the compiler. Exceptions:

* core::dvec: ideally this entire type will be able to be replaced by `~[]`, but Niko asked me to hold off on removing Dvecs until he makes some fixes to borrowed pointers. 
* liveness: liveness.rs is an impenetrable neutron star of deprecated semantics.
* compile-fail: I'm not sure if a lot of these tests are testing inner mutability or mutability in general. I figure that RIMOVing this folder should wait until this syntax is removed from the parser.

I also took this chance to remove many of the inner-mutability-related functions from core::vec, or as many uses of those functions as possible where still necessary. consume_mut and append_mut have been axed. cast_to_mut and cast_from_mut are still needed in a few places.
2013-02-13 15:09:07 -08:00
John Clements
16da4e15af use node_id for indexing in ast_to_ty_cache 2013-02-13 15:08:27 -08:00
Graydon Hoare
e5aa399e0d rustc and std: teach about #[bench], modernize to use quote_expr! some. 2013-02-13 11:46:25 -08:00
Ben Striegel
e6c82c0375 RIMOV core::vec
Also remove as many uses as possible of vec::cast_to_mut and
cast_from_mut
2013-02-13 12:48:24 -05:00
Ben Striegel
e58c812f77 Partially de-vec-mut librustc 2013-02-13 12:47:43 -05:00
Patrick Walton
e07623d70b librustc: Make monomorphic newtype structs work cross-crate 2013-02-13 09:47:20 -08:00
bors
27b3e01377 auto merge of #4914 : nikomatsakis/rust/issue-4856, r=nikomatsakis
and then adjust code to match. rs=unsound (will review post-landing)

rs=unsound
2013-02-12 20:40:19 -08:00
Niko Matsakis
ab2534974c Adjust borrow checker algorithm to address #4856 unsoundness,
and then adjust code to match. rs=unsound (will review post-landing)
2013-02-12 20:10:50 -08:00
Patrick Walton
a165f88272 librustc: Speed up moves a lot. r=nmatsakis 2013-02-12 16:16:23 -08:00
Graydon Hoare
1d82d8dd5d Revert "librustc: Make monomorphic newtype structs work cross-crate"
This reverts commit a8f039a085.
2013-02-12 09:02:17 -08:00
Patrick Walton
a8f039a085 librustc: Make monomorphic newtype structs work cross-crate 2013-02-11 20:09:11 -08:00
Jed Davis
3742b62f64 Omit discriminant from nullary univariant enums.
If an enum is isomorphic to unit, there's no need to use any bits to
represent it.  The only obvious reason this wasn't the case was because
the enum could be C-like and have a user-specified discriminant -- but
that value is constant, so it doesn't need to be stored.

This change means that all newtype-like enums have the same size (and
layout) as their underlying type, which might be a useful property to
have, at least in terms of making programs' low-level behavior less
surprising.
2013-02-09 22:28:43 -08:00
bors
d6442e97a5 auto merge of #4854 : thestinger/rust/oldmap, r=catamorphism 2013-02-09 15:02:51 -08:00
bors
d90abd5879 auto merge of #4848 : nikomatsakis/rust/issue-4821-bad-kind-computation, r=catamorphism
...ear

values to be copied.  Rewrite kind computation so that instead of directly
computing the kind it computes what kinds of values are present in the type,
and then derive kinds based on that. I find this easier to think about.

Fixes #4821.

r? @catamorphism
2013-02-09 10:20:55 -08:00
Daniel Micay
a32c5c73ee oldmap: get rid of legacy _ref suffixes 2013-02-08 19:12:51 -05:00