]> git.lizzy.rs Git - rust.git/log
rust.git
11 years agoextra: use deriving more in workcache, switch to treemaps.
Graydon Hoare [Wed, 17 Jul 2013 23:10:11 +0000 (16:10 -0700)]
extra: use deriving more in workcache, switch to treemaps.

11 years agoauto merge of #7848 : michaelwoerister/rust/trans_cleanup_1, r=jdm
bors [Tue, 23 Jul 2013 18:10:47 +0000 (11:10 -0700)]
auto merge of #7848 : michaelwoerister/rust/trans_cleanup_1, r=jdm

The following types are renamed:
```rust
block_ => Block
block => @mut Block

fn_ctx_ => FunctionContext
fn_ctx => @mut FunctionContext

scope_info => ScopeInfo
```
I also tried to convert instances of `@mut` to `&mut` or `&` but a lot of them are blocked by issue #6268, so I left it for some time later.

11 years agoAdapted `trans::common::{block, fn_ctxt, scope_info}` to new naming convention.
Michael Woerister [Wed, 17 Jul 2013 10:12:08 +0000 (12:12 +0200)]
Adapted `trans::common::{block, fn_ctxt, scope_info}` to new naming convention.

11 years agoauto merge of #7944 : blake2-ppc/rust/dlist-move-nodes, r=bblum
bors [Tue, 23 Jul 2013 11:46:41 +0000 (04:46 -0700)]
auto merge of #7944 : blake2-ppc/rust/dlist-move-nodes, r=bblum

Factor out internal methods to pop/push list nodes so that .merge() and .rotate_to_front(), .rotate_to_back() (new methods) can be implemented without allocating nodes.

With that, some cleanup changes to DList use of Option, and adding a missing Encodable implementation.

11 years agoauto merge of #7934 : sfackler/rust/smallintset, r=alexcrichton
bors [Tue, 23 Jul 2013 10:04:39 +0000 (03:04 -0700)]
auto merge of #7934 : sfackler/rust/smallintset, r=alexcrichton

SmallIntSet is equivalent to BitvSet but with 64 times the memory
overhead. There's no reason for it to exist.

SmallIntSet's overhead should really only be 8 times, but for some
reason, `sys::size_of::<Option<()>>() == 8`, not 1.

11 years agoauto merge of #7875 : sstewartgallus/rust/fubar, r=alexcrichton
bors [Tue, 23 Jul 2013 06:13:41 +0000 (23:13 -0700)]
auto merge of #7875 : sstewartgallus/rust/fubar, r=alexcrichton

11 years agoauto merge of #7873 : sstewartgallus/rust/cleanup_syntax, r=alexcrichton
bors [Tue, 23 Jul 2013 03:58:35 +0000 (20:58 -0700)]
auto merge of #7873 : sstewartgallus/rust/cleanup_syntax, r=alexcrichton

11 years agoauto merge of #7703 : sfackler/rust/bitv, r=alexcrichton
bors [Tue, 23 Jul 2013 02:13:39 +0000 (19:13 -0700)]
auto merge of #7703 : sfackler/rust/bitv, r=alexcrichton

Switched Bitv and BitvSet to external iterators. They still use some internal iterators internally (ha).

Derived clone for all Bitv types.

Removed indirection in BitvVariant. It previously held a unique pointer to the appropriate Bitv struct, even though those structs are the size of a pointer themselves. BitvVariant is the same size (16 bytes) as it was previously.

11 years agoauto merge of #7916 : olsonjeffery/rust/newrt_timer, r=brson
bors [Tue, 23 Jul 2013 00:28:35 +0000 (17:28 -0700)]
auto merge of #7916 : olsonjeffery/rust/newrt_timer, r=brson

My first bit of newsched IO work. Pretty simple and limited in scope.

the RtioTimer trait only has a `sleep(msecs: u64)` method, for now. Taking requests on what else ought to be here.

oh yeah: this resolves #6435

11 years agodlist: Rename rotate methods to .rotate_forward() and .rotate_backward()
blake2-ppc [Mon, 22 Jul 2013 23:31:30 +0000 (01:31 +0200)]
dlist: Rename rotate methods to .rotate_forward() and .rotate_backward()

11 years agoauto merge of #7883 : brson/rust/rm-std-net, r=graydon
bors [Mon, 22 Jul 2013 22:40:36 +0000 (15:40 -0700)]
auto merge of #7883 : brson/rust/rm-std-net, r=graydon

This removes all the code from libextra that depends on libuv. After that it removes three runtime features that existed to support the global uv loop: weak tasks, runtime-global variables, and at_exit handlers.

The networking code doesn't have many users besides servo, so shouldn't have much fallout. The timer code though is useful and will probably break out-of-tree code until the new scheduler lands, but I expect that to be soon.

It also incidentally moves `os::change_dir_locked` to `std::unstable`. This is a function used by test cases to avoid cwd races and in my opinion shouldn't be public (#7870).

Closes #7251 and #7870

11 years agostd: fix for blocked task resume
Jeff Olson [Mon, 22 Jul 2013 22:28:32 +0000 (15:28 -0700)]
std: fix for blocked task resume

11 years agostd: Remove at_exit API. Unused
Brian Anderson [Thu, 18 Jul 2013 02:51:40 +0000 (19:51 -0700)]
std: Remove at_exit API. Unused

11 years agostd: Remove unstable::global. Unused
Brian Anderson [Thu, 18 Jul 2013 02:14:58 +0000 (19:14 -0700)]
std: Remove unstable::global. Unused

11 years agostd: Move change_dir_locked to unstable. #7870
Brian Anderson [Thu, 18 Jul 2013 01:59:29 +0000 (18:59 -0700)]
std: Move change_dir_locked to unstable. #7870

11 years agostd::rt: Stop using unstable::global in change_dir_locked
Brian Anderson [Thu, 18 Jul 2013 01:38:12 +0000 (18:38 -0700)]
std::rt: Stop using unstable::global in change_dir_locked

11 years agostd: Remove weak_task API. Unused
Brian Anderson [Thu, 18 Jul 2013 01:04:10 +0000 (18:04 -0700)]
std: Remove weak_task API. Unused

11 years agoextra: Add url module
Brian Anderson [Thu, 18 Jul 2013 00:47:20 +0000 (17:47 -0700)]
extra: Add url module

Used to be under extra::net, which no longer exists

11 years agoextra: Remove uv, net, timer code
Brian Anderson [Wed, 17 Jul 2013 22:14:34 +0000 (15:14 -0700)]
extra: Remove uv, net, timer code

This will all be reimplemented in the new runtime.

11 years agoauto merge of #7943 : Dretch/rust/vec-slice-from-to, r=huonw
bors [Mon, 22 Jul 2013 20:49:34 +0000 (13:49 -0700)]
auto merge of #7943 : Dretch/rust/vec-slice-from-to, r=huonw

11 years agostd: make check appeasement
Jeff Olson [Fri, 19 Jul 2013 23:24:07 +0000 (16:24 -0700)]
std: make check appeasement

11 years agostd: minor timer cleanup based on feedback
Jeff Olson [Fri, 19 Jul 2013 23:22:13 +0000 (16:22 -0700)]
std: minor timer cleanup based on feedback

11 years agostd: add rt::io::Timer
Jeff Olson [Fri, 19 Jul 2013 23:03:02 +0000 (16:03 -0700)]
std: add rt::io::Timer

11 years agostd: add RtioTimer and UvTimer impl atop rt::uv
Jeff Olson [Fri, 19 Jul 2013 23:02:38 +0000 (16:02 -0700)]
std: add RtioTimer and UvTimer impl atop rt::uv

11 years agoauto merge of #7942 : Dretch/rust/os-listdir-path-no-squiggle, r=brson
bors [Mon, 22 Jul 2013 19:01:41 +0000 (12:01 -0700)]
auto merge of #7942 : Dretch/rust/os-listdir-path-no-squiggle, r=brson

11 years agoauto merge of #7940 : cmr/rust/comments, r=pnkfelix
bors [Mon, 22 Jul 2013 17:07:34 +0000 (10:07 -0700)]
auto merge of #7940 : cmr/rust/comments, r=pnkfelix

11 years agodlist: Fix .peek_next() w.r.t double ended iterators
blake2-ppc [Mon, 22 Jul 2013 15:51:11 +0000 (17:51 +0200)]
dlist: Fix .peek_next() w.r.t double ended iterators

.peek_next() needs to check the element counter just like the .next()
and .next_back() iterators do.

Also clarify .insert_next() doc w.r.t double ended iteration.

11 years agoauto merge of #7903 : michaelwoerister/rust/end_of_spanned, r=jdm
bors [Mon, 22 Jul 2013 15:19:32 +0000 (08:19 -0700)]
auto merge of #7903 : michaelwoerister/rust/end_of_spanned, r=jdm

Continuation of https://github.com/mozilla/rust/pull/7826.

AST spanned<T> refactoring, AST type renamings:

`crate => Crate`
`local => Local`
`blk => Block`
`crate_num => CrateNum`
`crate_cfg => CrateConfig`
`field => Field`

Also, Crate, Field and Local are not wrapped in spanned<T> anymore.

11 years agoDe-spanned<T> and renamed ast::field (now ast::Field)
Michael Woerister [Fri, 19 Jul 2013 14:24:22 +0000 (16:24 +0200)]
De-spanned<T> and renamed ast::field (now ast::Field)

11 years agoAst spanned<T> refactoring, renaming: crate, local, blk, crate_num, crate_cfg.
Michael Woerister [Fri, 19 Jul 2013 05:38:55 +0000 (07:38 +0200)]
Ast spanned<T> refactoring, renaming: crate, local, blk, crate_num, crate_cfg.

`crate => Crate`
`local => Local`
`blk => Block`
`crate_num => CrateNum`
`crate_cfg => CrateConfig`

Also, Crate and Local are not wrapped in spanned<T> anymore.

11 years agoauto merge of #7941 : dotdash/rust/codegen, r=huonw
bors [Mon, 22 Jul 2013 13:28:35 +0000 (06:28 -0700)]
auto merge of #7941 : dotdash/rust/codegen, r=huonw

These changes remove unnecessary basic blocks and the associated branches from
the LLVM IR that we emit. Together, they reduce the time for unoptimized builds
in stage2 by about 10% on my box.

11 years agoauto merge of #7926 : brson/rust/issue-4116, r=graydon
bors [Mon, 22 Jul 2013 11:37:36 +0000 (04:37 -0700)]
auto merge of #7926 : brson/rust/issue-4116, r=graydon

When loading a module the parser will look for either foo.rs or foo/mod.rs and generate
an error when both are found.

11 years agoauto merge of #7957 : alexcrichton/rust/ignore-warnings, r=thestinger
bors [Mon, 22 Jul 2013 09:49:36 +0000 (02:49 -0700)]
auto merge of #7957 : alexcrichton/rust/ignore-warnings, r=thestinger

The new snapshot now enables this.

11 years agoAllow all warnings in stage0 to account for bugs
Alex Crichton [Mon, 22 Jul 2013 07:30:32 +0000 (00:30 -0700)]
Allow all warnings in stage0 to account for bugs

11 years agoauto merge of #7955 : thestinger/rust/snapshot, r=huonw
bors [Mon, 22 Jul 2013 05:34:36 +0000 (22:34 -0700)]
auto merge of #7955 : thestinger/rust/snapshot, r=huonw

11 years agotemporarily disable 3 rustpkg tests
Daniel Micay [Mon, 22 Jul 2013 05:00:00 +0000 (01:00 -0400)]
temporarily disable 3 rustpkg tests

Re-enabling these when the ephemeral failures are fixed is filed as
issue #7956.

11 years agonew snapshot
Daniel Micay [Mon, 22 Jul 2013 04:06:29 +0000 (00:06 -0400)]
new snapshot

11 years agoauto merge of #7938 : crabtw/rust/foreign-vis, r=huonw
bors [Mon, 22 Jul 2013 03:46:33 +0000 (20:46 -0700)]
auto merge of #7938 : crabtw/rust/foreign-vis, r=huonw

11 years agoCleanup libsyntax a bit
Steven Stewart-Gallus [Thu, 18 Jul 2013 03:04:37 +0000 (20:04 -0700)]
Cleanup libsyntax a bit

11 years agoMinor cleanup of hashmap
Steven Stewart-Gallus [Thu, 18 Jul 2013 05:35:34 +0000 (22:35 -0700)]
Minor cleanup of hashmap

11 years agoMerge pull request #7936 from thestinger/cleanup
Daniel Micay [Mon, 22 Jul 2013 03:04:15 +0000 (20:04 -0700)]
Merge pull request #7936 from thestinger/cleanup

rm obsolete no-op lints

11 years agosyntax: Bless mod.rs. #4116
Brian Anderson [Sat, 20 Jul 2013 02:11:30 +0000 (19:11 -0700)]
syntax: Bless mod.rs. #4116

When loading a module the parser will look for either foo.rs or foo/mod.rs and generate
an error when both are found.

11 years agoEliminated SmallIntSet
Steven Fackler [Sat, 20 Jul 2013 22:38:10 +0000 (18:38 -0400)]
Eliminated SmallIntSet

SmallIntSet is equivalent to BitvSet but with 8 times the memory
overhead. There's no reason for it to exist.

11 years agoauto merge of #7932 : blake2-ppc/rust/str-clear, r=huonw
bors [Sun, 21 Jul 2013 22:28:38 +0000 (15:28 -0700)]
auto merge of #7932 : blake2-ppc/rust/str-clear, r=huonw

~str and @str need separate implementations for use in generic
functions, where it will not automatically use the impl on &str.

fixes issue #7900

11 years agodlist: Remove extraneous unwrap in .pop_back_node()
blake2-ppc [Sun, 21 Jul 2013 20:37:14 +0000 (22:37 +0200)]
dlist: Remove extraneous unwrap in .pop_back_node()

11 years agoauto merge of #7923 : alexcrichton/rust/add-tests, r=graydon
bors [Sun, 21 Jul 2013 20:07:45 +0000 (13:07 -0700)]
auto merge of #7923 : alexcrichton/rust/add-tests, r=graydon

Closes #5275, #4547

11 years agodlist: Use Ord for .insert_ordered()
blake2-ppc [Sun, 21 Jul 2013 19:05:48 +0000 (21:05 +0200)]
dlist: Use Ord for .insert_ordered()

We don't need TotalOrd for ordered insertion, just the normal sort order
Ord.

11 years agodlist: Remove bench tests for vec
blake2-ppc [Sun, 21 Jul 2013 19:05:48 +0000 (21:05 +0200)]
dlist: Remove bench tests for vec

These tests for ~[] performance don't really belong here, they were for
comparison.

11 years agodlist: Add bench test for rotate_to_{front, back}
blake2-ppc [Sun, 21 Jul 2013 19:05:48 +0000 (21:05 +0200)]
dlist: Add bench test for rotate_to_{front, back}

11 years agoauto merge of #7921 : bytewiseand/rust/smallint-iter, r=huonw
bors [Sun, 21 Jul 2013 18:22:38 +0000 (11:22 -0700)]
auto merge of #7921 : bytewiseand/rust/smallint-iter, r=huonw

Made the `iter` and `mut_iter` methods on SmallIntMap and SmallIntSet return double-ended-iterators. These iterators now implement `size_hint`.

Also the iterator tests only tested dense maps/sets, which aren't very useful. So they were changed to iterate over sparse maps/sets.

Fixes #7721

11 years agoRemove what appears to be redundant indirection from
Gareth Smith [Sun, 21 Jul 2013 17:33:29 +0000 (18:33 +0100)]
Remove what appears to be redundant indirection from
os::list_dir_path.

11 years agodlist: Add .rotate_to_front(), .rotate_to_back()
blake2-ppc [Sun, 21 Jul 2013 17:31:40 +0000 (19:31 +0200)]
dlist: Add .rotate_to_front(), .rotate_to_back()

Add methods to move back element to front or front element to back,
without reallocating nodes.

11 years agodlist: Factor out pop and push operations by list node
blake2-ppc [Sun, 21 Jul 2013 17:31:40 +0000 (19:31 +0200)]
dlist: Factor out pop and push operations by list node

Factor out internal methods for pop/push ~Node<T>, This allows moving
nodes instead of destructuring and allocating new.

Make use of this in .merge() so that it requires no allocations when
merging two DList.

11 years agodlist: Simplify match clauses to use Option methods
blake2-ppc [Sun, 21 Jul 2013 17:31:40 +0000 (19:31 +0200)]
dlist: Simplify match clauses to use Option methods

Make the core Deque implementation a bit simpler by using Option methods
when we simply map on a Some value, and deduplicate some common lines.

11 years agoserialize: implement Encodable for DList
blake2-ppc [Sun, 21 Jul 2013 17:31:40 +0000 (19:31 +0200)]
serialize: implement Encodable for DList

This impl was missing for unknown reason.

11 years agoAvoid blocks for static allocas and loading the closure environment
Björn Steinbrink [Sun, 21 Jul 2013 14:19:34 +0000 (16:19 +0200)]
Avoid blocks for static allocas and loading the closure environment

These blocks were required because previously we could only insert
instructions at the end of blocks, but we wanted to have all allocas in
one place, so they can be collapse. But now we have "direct" access the
the LLVM IR builder and can position it freely. This allows us to use
the same trick that clang uses, which means that we insert a dummy
"marker" instruction to identify the spot at which we want to insert
allocas. We can then later position the IR builder at that spot and
insert the alloca instruction, without any dedicated block.

The block for loading the closure environment can now also go away,
because the function context now provides the toplevel block, and the
translation of the loading happens first, so that's good enough.

Makes the LLVM IR a bit more readable, saving a bunch of branches in the
unoptimized code, which benefits unoptimized builds.

11 years agoProvide lower level access to the LLVM IR builder
Björn Steinbrink [Sun, 21 Jul 2013 13:33:40 +0000 (15:33 +0200)]
Provide lower level access to the LLVM IR builder

Currently, the helper functions in the "build" module can only append
at the end of a block. For certain things we'll want to be able to
insert code at arbitrary locations inside a block though. Although can
we do that by directly calling the LLVM functions, that is rather ugly
and means that somethings need to be implemented twice. Once in terms
of the helper functions and once in terms of low level LLVM functions.

Instead of doing that, we should provide a Builder type that provides
low level access to the builder, and which can be used by both, the
helper functions in the "build" module, as well larger units of
abstractions that combine several LLVM instructions.

11 years agoRemove an unnecessary block/jump from the drop glue for @-pointer
Björn Steinbrink [Thu, 18 Jul 2013 18:45:01 +0000 (20:45 +0200)]
Remove an unnecessary block/jump from the drop glue for @-pointer

The nested with_cond calls each introduce a "next" block, with the
inner one just jumping to the outer one.

11 years agoAvoid creating llenv blocks when there's nothing to load
Björn Steinbrink [Wed, 17 Jul 2013 19:59:58 +0000 (21:59 +0200)]
Avoid creating llenv blocks when there's nothing to load

Currently, all closures have an llenv block to load values from the
captured environment, but for closure that don't actually capture
anything, that block is useless and can be skipped.

11 years agoAdd slice_from and slice_to methods for vec, like the
Gareth Smith [Sun, 21 Jul 2013 13:39:01 +0000 (14:39 +0100)]
Add slice_from and slice_to methods for vec, like the
methods of the same names that already exist for strs.

11 years agoDoc for ast::Path
Corey Richardson [Thu, 18 Jul 2013 11:12:07 +0000 (07:12 -0400)]
Doc for ast::Path

11 years agosyntax: print visibilities of foreign items
Jyun-Yan You [Sun, 21 Jul 2013 07:35:02 +0000 (15:35 +0800)]
syntax: print visibilities of foreign items

11 years agoAdded bitv iterator benchmarks
Steven Fackler [Sun, 14 Jul 2013 18:52:49 +0000 (11:52 -0700)]
Added bitv iterator benchmarks

11 years agoAdded iterator tests
Steven Fackler [Fri, 12 Jul 2013 06:13:26 +0000 (02:13 -0400)]
Added iterator tests

11 years agoRemoved unecessary indirection in Bitv
Steven Fackler [Wed, 10 Jul 2013 07:29:24 +0000 (03:29 -0400)]
Removed unecessary indirection in Bitv

BitvVariant is the same size as it was before (16 bytes).

11 years agoDerive Clone for bitv stuff
Steven Fackler [Wed, 10 Jul 2013 05:57:07 +0000 (01:57 -0400)]
Derive Clone for bitv stuff

11 years agoSwitched bitv to external iterators
Steven Fackler [Wed, 10 Jul 2013 05:06:38 +0000 (01:06 -0400)]
Switched bitv to external iterators

11 years agoauto merge of #7913 : brson/rust/rm-install-snap, r=graydon
bors [Sun, 21 Jul 2013 06:55:27 +0000 (23:55 -0700)]
auto merge of #7913 : brson/rust/rm-install-snap, r=graydon

11 years agoauto merge of #7912 : graydon/rust/extra-new-benchmarks-1, r=catamorphism
bors [Sun, 21 Jul 2013 05:10:28 +0000 (22:10 -0700)]
auto merge of #7912 : graydon/rust/extra-new-benchmarks-1, r=catamorphism

This adds new #[bench] benchmarks for extra::smallintmap, treemap, sha1, sha256 and 512, and base64. Also fixes a bunch of warnings in bitv.

11 years agoauto merge of #7902 : huonw/rust/attr++, r=cmr,pcwalton
bors [Sun, 21 Jul 2013 03:25:31 +0000 (20:25 -0700)]
auto merge of #7902 : huonw/rust/attr++, r=cmr,pcwalton

This does a number of things, but especially dramatically reduce the
number of allocations performed for operations involving attributes/
meta items:

- Converts ast::meta_item & ast::attribute and other associated enums
  to CamelCase.
- Converts several standalone functions in syntax::attr into methods,
  defined on two traits AttrMetaMethods & AttributeMethods. The former
  is common to both MetaItem and Attribute since the latter is a thin
  wrapper around the former.
- Deletes functions that are unnecessary due to iterators.
- Converts other standalone functions to use iterators and the generic
  AttrMetaMethods rather than allocating a lot of new vectors (e.g. the
  old code would have to allocate a new vector to use functions that
  operated on &[meta_item] on &[attribute].)
- Moves the core algorithm of the #[cfg] matching to syntax::attr,
  similar to find_inline_attr and find_linkage_metas.

This doesn't have much of an effect on the speed of #[cfg] stripping,
despite hugely reducing the number of allocations performed; presumably
most of the time is spent in the ast folder rather than doing attribute
checks.

Also fixes the Eq instance of MetaItem_ to correctly ignore spans, so
that `rustc --cfg 'foo(bar)'` now works.

11 years agoauto merge of #7896 : pcwalton/rust/pub-extern, r=pcwalton
bors [Sun, 21 Jul 2013 01:40:39 +0000 (18:40 -0700)]
auto merge of #7896 : pcwalton/rust/pub-extern, r=pcwalton

r? @nikomatsakis

11 years agolibrustc: Remove `pub extern` and `priv extern` from the language.
Patrick Walton [Fri, 19 Jul 2013 02:08:57 +0000 (19:08 -0700)]
librustc: Remove `pub extern` and `priv extern` from the language.

Place `pub` or `priv` on individual items instead.

11 years agorm obsolete no-op lints
Daniel Micay [Sat, 20 Jul 2013 23:59:58 +0000 (19:59 -0400)]
rm obsolete no-op lints

11 years agoauto merge of #7882 : blake2-ppc/rust/iterator-clone, r=thestinger
bors [Sat, 20 Jul 2013 23:58:30 +0000 (16:58 -0700)]
auto merge of #7882 : blake2-ppc/rust/iterator-clone, r=thestinger

Implement method .cycle() that repeats an iterator endlessly

Implement Clone for simple iterators (without closures), including VecIterator.

> The theory is simple, the immutable iterators simply hold state
> variables (indicies or pointers) into frozen containers. We can freely
> clone these iterators, just like we can clone borrowed pointers.

11 years agoauto merge of #7910 : brson/rust/rm-fixme, r=graydon
bors [Sat, 20 Jul 2013 22:16:33 +0000 (15:16 -0700)]
auto merge of #7910 : brson/rust/rm-fixme, r=graydon

11 years agoauto merge of #7908 : anasazi/rust/fix_udp_mut, r=brson
bors [Sat, 20 Jul 2013 20:31:34 +0000 (13:31 -0700)]
auto merge of #7908 : anasazi/rust/fix_udp_mut, r=brson

11 years agodlist: Implement Clone for immutable iterators
blake2-ppc [Thu, 18 Jul 2013 16:46:37 +0000 (18:46 +0200)]
dlist: Implement Clone for immutable iterators

11 years agostd: Implement Clone for VecIterator and iterators using it
blake2-ppc [Thu, 18 Jul 2013 15:38:17 +0000 (17:38 +0200)]
std: Implement Clone for VecIterator and iterators using it

The theory is simple, the immutable iterators simply hold state
variables (indicies or pointers) into frozen containers. We can freely
clone these iterators, just like we can clone borrowed pointers.

VecIterator needs a manual impl to handle the lifetime struct member.

11 years agoiterator: Add test for .cycle()
blake2-ppc [Thu, 18 Jul 2013 15:34:28 +0000 (17:34 +0200)]
iterator: Add test for .cycle()

11 years agoiterator: Let closure-less iterators derive Clone
blake2-ppc [Thu, 18 Jul 2013 15:31:33 +0000 (17:31 +0200)]
iterator: Let closure-less iterators derive Clone

11 years agoiterator: Add .cycle() to repeat an iterator
blake2-ppc [Thu, 18 Jul 2013 15:09:08 +0000 (17:09 +0200)]
iterator: Add .cycle() to repeat an iterator

11 years agoauto merge of #7894 : pcwalton/rust/and-pointers-in-at-boxes, r=brson
bors [Sat, 20 Jul 2013 17:55:34 +0000 (10:55 -0700)]
auto merge of #7894 : pcwalton/rust/and-pointers-in-at-boxes, r=brson

r? @brson

11 years agostr: Implement Container for ~str, @str and Mutable for ~str
blake2-ppc [Sat, 20 Jul 2013 17:28:38 +0000 (19:28 +0200)]
str: Implement Container for ~str, @str and Mutable for ~str

~str and @str need separate implementations for use in generic
functions, where it will not automatically use the impl on &str.

11 years agoauto merge of #7710 : michaelwoerister/rust/WP4, r=jdm
bors [Sat, 20 Jul 2013 16:10:34 +0000 (09:10 -0700)]
auto merge of #7710 : michaelwoerister/rust/WP4, r=jdm

This pull request includes various improvements:

+ Composite types (structs, tuples, boxes, etc) are now handled more cleanly by debuginfo generation. Most notably, field offsets are now extracted directly from LLVM types, as opposed to trying to reconstruct them. This leads to more stable handling of edge cases (e.g. packed structs or structs implementing drop).

+ `debuginfo.rs` in general has seen a major cleanup. This includes better formatting, more readable variable and function names, removal of dead code, and better factoring of functionality.

+ Handling of `VariantInfo` in `ty.rs` has been improved. That is, the `type VariantInfo = @VariantInfo_` typedef has been replaced with explicit uses of @VariantInfo, and the duplicated logic for creating VariantInfo instances in `ty::enum_variants()` and `typeck::check::mod::check_enum_variants()` has been unified into a single constructor function. Both function now look nicer too :)

+ Debug info generation for enum types is now mostly supported. This includes:
  + Good support for C-style enums. Both DWARF and `gdb` know how to handle them.
  + Proper description of tuple- and struct-style enum variants as unions of structs.
  + Proper handling of univariant enums without discriminator field.
  + Unfortunately `gdb` always prints all possible interpretations of a union, so debug output of enums is verbose and unintuitive. Neither `LLVM` nor `gdb` support DWARF's `DW_TAG_variant` which allows to properly describe tagged unions. Adding support for this to `LLVM` seems doable. `gdb` however is another story. In the future we might be able to use `gdb`'s Python scripting support to alleviate this problem. In agreement with @jdm this is not a high priority for now.

+ The debuginfo test suite has been extended with 14 test files including tests for packed structs (with Drop), boxed structs, boxed vecs, vec slices, c-style enums (standalone and embedded), empty enums, tuple- and struct-style enums, and various pointer types to the above.

~~What is not yet included is DI support for some enum edge-cases represented as described in `trans::adt::NullablePointer`.~~

Cheers,
Michael

PS: closes #7819,  fixes #7712

11 years agoauto merge of #7886 : msullivan/rust/default-methods, r=pcwalton
bors [Sat, 20 Jul 2013 14:28:36 +0000 (07:28 -0700)]
auto merge of #7886 : msullivan/rust/default-methods, r=pcwalton

This does a bunch of cleanup on the data structures for the trait system. (Unfortunately it doesn't remove `provided_method_sources`. Maybe later.)

It also changes how cross crate methods are handled, so that information about them is exported in metadata, instead of having the methods regenerated by every crate that imports an impl.

r? @nikomatsakis, maybe?

11 years agoauto merge of #7884 : pcwalton/rust/check-loans-and-inside-at, r=graydon
bors [Sat, 20 Jul 2013 12:43:38 +0000 (05:43 -0700)]
auto merge of #7884 : pcwalton/rust/check-loans-and-inside-at, r=graydon

r? @graydon

11 years agoauto merge of #7858 : bblum/rust/kill, r=brson
bors [Sat, 20 Jul 2013 10:55:39 +0000 (03:55 -0700)]
auto merge of #7858 : bblum/rust/kill, r=brson

Some notes about the commits.

Exit code propagation commits:
* ```Reimplement unwrap()``` has the same old code from ```arc::unwrap``` ported to use modern atomic types and finally (it's considerably nicer this way)
* ```Add try_unwrap()``` has some new slightly-tricky (but pretty simple) concurrency primitive code
* ```Add KillHandle``` and ```Add kill::Death``` are the bulk of the logic.

Task killing commits:
* ```Implement KillHandle::kill() and friends```, ```Do a task-killed check```, and ```Add BlockedTask``` implement the killing logic;
* ```Change the HOF context switchers``` turns said logic on

Linked failure commits:
* ```Replace *rust_task ptrs``` adapts the taskgroup code to work for both runtimes
* ```Enable taskgroup code``` does what it says on the tin.

r? @brson

11 years agoauto merge of #7419 : catamorphism/rust/default-package, r=graydon
bors [Sat, 20 Jul 2013 09:16:41 +0000 (02:16 -0700)]
auto merge of #7419 : catamorphism/rust/default-package, r=graydon

r? @brson `rustpkg build`, if executed in a package source directory inside
a workspace, will now build that package. By "inside a workspace"
I mean that the parent directory has to be called `src`, and rustpkg
will create a `build` directory in .. if there isn't already one.

Same goes for `rustpkg install` and `rustpkg clean`.

For the time being, `rustpkg build` (etc.) will still error out if
you run it inside a directory whose parent isn't called `src`.
I'm not sure whether or not it's desirable to have it do something
in a non-workspace directory.

11 years agoUse Option .take() or .take_unwrap() instead of util::replace where possible
blake2-ppc [Wed, 17 Jul 2013 21:41:50 +0000 (23:41 +0200)]
Use Option .take() or .take_unwrap() instead of util::replace where possible

11 years agoFix warnings in stdtest and extratest. Maybe somebody will care.
Ben Blum [Wed, 17 Jul 2013 21:01:03 +0000 (17:01 -0400)]
Fix warnings in stdtest and extratest. Maybe somebody will care.

11 years agoFix warnings in src/test/bench tests. Nobody will ever care.
Ben Blum [Wed, 17 Jul 2013 19:31:20 +0000 (15:31 -0400)]
Fix warnings in src/test/bench tests. Nobody will ever care.

11 years agoAdd watched and indestructible spawn modes.
Ben Blum [Tue, 16 Jul 2013 21:28:46 +0000 (17:28 -0400)]
Add watched and indestructible spawn modes.

11 years agoRename TCB to Taskgroup
Ben Blum [Tue, 16 Jul 2013 17:42:12 +0000 (13:42 -0400)]
Rename TCB to Taskgroup

11 years agoEnable taskgroup code for newsched spawns.
Ben Blum [Mon, 15 Jul 2013 19:32:35 +0000 (15:32 -0400)]
Enable taskgroup code for newsched spawns.

11 years agoFix linked failure tests to block forever instead of looping around yield.
Ben Blum [Tue, 16 Jul 2013 01:28:37 +0000 (21:28 -0400)]
Fix linked failure tests to block forever instead of looping around yield.

11 years ago(cleanup) impl TaskSet
Ben Blum [Mon, 15 Jul 2013 18:27:33 +0000 (14:27 -0400)]
(cleanup) impl TaskSet

11 years ago(cleanup) Don't check taskgroup generation monotonicity unless cfg(test).
Ben Blum [Mon, 15 Jul 2013 18:08:25 +0000 (14:08 -0400)]
(cleanup) Don't check taskgroup generation monotonicity unless cfg(test).

11 years ago(cleanup) Modernize taskgroup code for the new borrow-checker.
Ben Blum [Mon, 15 Jul 2013 17:59:17 +0000 (13:59 -0400)]
(cleanup) Modernize taskgroup code for the new borrow-checker.

11 years agoReplace *rust_task ptrs in taskgroup code with TaskHandle, for transitioning to newsc...
Ben Blum [Sat, 13 Jul 2013 02:45:19 +0000 (22:45 -0400)]
Replace *rust_task ptrs in taskgroup code with TaskHandle, for transitioning to newsched killing.

11 years agoAdd option::take(), the building block of the option::take_* family.
Ben Blum [Sat, 13 Jul 2013 02:40:57 +0000 (22:40 -0400)]
Add option::take(), the building block of the option::take_* family.