Commit Graph

20298 Commits

Author SHA1 Message Date
Alex Crichton
5c6069141b Add a test for #5844 (a closed issue now) 2013-07-22 23:09:21 -07:00
bors
ff34064aa3 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
2013-07-22 17:28:35 -07:00
bors
73921f91a3 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
2013-07-22 15:40:36 -07:00
Jeff Olson
3169bb70d8 std: fix for blocked task resume 2013-07-22 15:28:32 -07:00
Brian Anderson
407bffb33e std: Remove at_exit API. Unused 2013-07-22 14:17:09 -07:00
Brian Anderson
23b7ee2bda std: Remove unstable::global. Unused 2013-07-22 14:16:52 -07:00
Brian Anderson
6174f9a4d9 std: Move change_dir_locked to unstable. #7870 2013-07-22 14:16:52 -07:00
Brian Anderson
4beda4e582 std::rt: Stop using unstable::global in change_dir_locked 2013-07-22 14:16:52 -07:00
Brian Anderson
f8c4d99df6 std: Remove weak_task API. Unused 2013-07-22 14:16:52 -07:00
Brian Anderson
a637db2aa1 extra: Add url module
Used to be under extra::net, which no longer exists
2013-07-22 14:16:33 -07:00
Brian Anderson
219c1c71da extra: Remove uv, net, timer code
This will all be reimplemented in the new runtime.
2013-07-22 14:16:33 -07:00
bors
9ed82fbb43 auto merge of #7943 : Dretch/rust/vec-slice-from-to, r=huonw 2013-07-22 13:49:34 -07:00
Jeff Olson
73ab6c60f3 std: make check appeasement 2013-07-22 13:19:05 -07:00
Jeff Olson
155470fc9c std: minor timer cleanup based on feedback 2013-07-22 13:19:04 -07:00
Jeff Olson
5da29e3278 std: add rt::io::Timer 2013-07-22 13:19:04 -07:00
Jeff Olson
921d99108c std: add RtioTimer and UvTimer impl atop rt::uv 2013-07-22 13:19:04 -07:00
bors
2f7d86f9a8 auto merge of #7942 : Dretch/rust/os-listdir-path-no-squiggle, r=brson 2013-07-22 12:01:41 -07:00
bors
48f115e168 auto merge of #7940 : cmr/rust/comments, r=pnkfelix 2013-07-22 10:07:34 -07:00
bors
52b7fc14fe 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.
2013-07-22 08:19:32 -07:00
Michael Woerister
5aee3e01a0 De-spanned<T> and renamed ast::field (now ast::Field) 2013-07-22 15:35:29 +02:00
Michael Woerister
4bd1424622 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.
2013-07-22 15:35:28 +02:00
bors
7a3eaf8f27 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.
2013-07-22 06:28:35 -07:00
bors
7b2218d248 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.
2013-07-22 04:37:36 -07:00
bors
40a48e62c1 auto merge of #7957 : alexcrichton/rust/ignore-warnings, r=thestinger
The new snapshot now enables this.
2013-07-22 02:49:36 -07:00
Alex Crichton
634eddb28e Allow all warnings in stage0 to account for bugs 2013-07-22 00:30:32 -07:00
bors
74f4badcab auto merge of #7955 : thestinger/rust/snapshot, r=huonw 2013-07-21 22:34:36 -07:00
Daniel Micay
f51e2ad435 temporarily disable 3 rustpkg tests
Re-enabling these when the ephemeral failures are fixed is filed as
issue #7956.
2013-07-22 01:09:56 -04:00
Daniel Micay
ed67cdb73c new snapshot 2013-07-22 01:09:48 -04:00
bors
3d6c0bc056 auto merge of #7938 : crabtw/rust/foreign-vis, r=huonw 2013-07-21 20:46:33 -07:00
Daniel Micay
fc05819181 Merge pull request #7936 from thestinger/cleanup
rm obsolete no-op lints
2013-07-21 20:04:15 -07:00
Brian Anderson
a74d92e8ab 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.
2013-07-21 19:32:24 -07:00
bors
fe3f75ff8e 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
2013-07-21 15:28:38 -07:00
bors
e336cbf8f9 auto merge of #7923 : alexcrichton/rust/add-tests, r=graydon
Closes #5275, #4547
2013-07-21 13:07:45 -07:00
bors
73e9a121d2 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
2013-07-21 11:22:38 -07:00
Gareth Smith
a6263694ff Remove what appears to be redundant indirection from
os::list_dir_path.
2013-07-21 18:33:29 +01:00
Björn Steinbrink
205baa6ca2 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.
2013-07-21 18:29:20 +02:00
Björn Steinbrink
565a9bf20b 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.
2013-07-21 16:43:06 +02:00
Björn Steinbrink
3cccdbd9cc 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.
2013-07-21 15:54:42 +02:00
Björn Steinbrink
d405117897 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.
2013-07-21 15:54:41 +02:00
Gareth Smith
30f13e661a Add slice_from and slice_to methods for vec, like the
methods of the same names that already exist for strs.
2013-07-21 14:39:01 +01:00
Corey Richardson
93133ab10d Doc for ast::Path 2013-07-21 09:17:42 -04:00
Jyun-Yan You
85387e1925 syntax: print visibilities of foreign items 2013-07-21 15:35:02 +08:00
bors
c4b6216943 auto merge of #7913 : brson/rust/rm-install-snap, r=graydon 2013-07-20 23:55:27 -07:00
bors
c325cb0a42 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.
2013-07-20 22:10:28 -07:00
bors
d029ebfc5f 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.
2013-07-20 20:25:31 -07:00
bors
8476419fef auto merge of #7896 : pcwalton/rust/pub-extern, r=pcwalton
r? @nikomatsakis
2013-07-20 18:40:39 -07:00
Patrick Walton
06594ed96b librustc: Remove pub extern and priv extern from the language.
Place `pub` or `priv` on individual items instead.
2013-07-20 17:39:38 -07:00
Daniel Micay
13b474dcbb rm obsolete no-op lints 2013-07-20 20:17:08 -04:00
bors
75b4b1b027 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.
2013-07-20 16:58:30 -07:00
bors
bb8ca1f52c auto merge of #7910 : brson/rust/rm-fixme, r=graydon 2013-07-20 15:16:33 -07:00