Commit graph

27344 commits

Author SHA1 Message Date
Flavio Percoco
034e1382af cell: Remove Freeze / NoFreeze 2014-03-22 15:47:34 +01:00
Flavio Percoco
16e07602f9 std::comm: Remove Freeze / NoFreeze 2014-03-22 15:47:34 +01:00
Flavio Percoco
0169abd91d sync: Remove Freeze / NoFreeze 2014-03-22 15:47:33 +01:00
Flavio Percoco
392348f347 arena: Remove Freeze / NoFreeze 2014-03-22 15:47:33 +01:00
Flavio Percoco
aa7519400e rustc: Remove special treatment for Freeze and NoFreeze
Fixes #12577
2014-03-22 15:44:13 +01:00
bors
30165e059c auto merge of #13052 : sfackler/rust/clean-refcell, r=alexcrichton
These are superfluous now that we have fixed rvalue lifetimes and Deref.

I'd also like to kill off `get` and `set`, but that'll be a large change so I want to make sure that we actually want to do that first.
2014-03-22 04:56:49 -07:00
bors
092afdba3c auto merge of #12907 : alexcrichton/rust/issue-12892, r=brson
These methods can be mistaken for general "read some bytes" utilities when
they're actually only meant for reading an exact number of bytes. By renaming
them it's much clearer about what they're doing without having to read the
documentation.

Closes #12892
2014-03-22 00:56:47 -07:00
bors
993dee4f14 auto merge of #13051 : alexcrichton/rust/issue-13047, r=thestinger
It's useful for structures which use deriving(Clone), even though it's
implicitly copyable.

Closes #13047
2014-03-21 22:41:42 -07:00
bors
069cede305 auto merge of #13036 : alexcrichton/rust/atomics, r=alexcrichton
Closes #11583, rebasing of #12430 now that we've got `Share` and better analysis with statics.
2014-03-21 21:31:42 -07:00
bors
f5357cf3ce auto merge of #13016 : huonw/rust/new-opt-vec, r=cmr
Replace syntax::opt_vec with syntax::owned_slice

The `owned_slice::OwnedSlice` is  `(*T, uint)` (i.e. a direct equivalent to DSTs `~[T]`).

This shaves two words off the old OptVec type; and also makes substituting in other implementations easy, by removing all the mutation methods. (And also everything that's very rarely/never used.)
2014-03-21 20:06:44 -07:00
bors
bbf8cdc43f auto merge of #12833 : alexcrichton/rust/libnative, r=brson
The compiler will no longer inject libgreen as the default runtime for rust
programs, this commit switches it over to libnative by default. Now that
libnative has baked for some time, it is ready enough to start getting more
serious usage as the default runtime for rustc generated binaries.

We've found that there isn't really a correct decision in choosing a 1:1 or M:N
runtime as a default for all applications, but it seems that a larger number of
programs today would work more reasonably with a native default rather than a
green default.

With this commit come a number of bugfixes:

* The main native task is now named `<main>`
* The main native task has the stack bounds set up properly
* #[no_uv] was renamed to #[no_start]
* The core-run-destroy test was rewritten for both libnative and libgreen and
  one of the tests was modified to be more robust.
* The process-detach test was locked to libgreen because it uses signal handling
2014-03-21 18:51:51 -07:00
bors
3e3a3cf712 auto merge of #13043 : alexcrichton/rust/fix-rustdoc-windows, r=brson
If the dwShareMode parameter is 0 on windows, it "prevents other processes from
opening a file or device if they request delete, read, or write access", which
is the opposite of what we want! This changes the 0 parameter to something which
will allow multiple processes to open the file and then lock it.
2014-03-21 16:41:48 -07:00
Huon Wilson
e33676b793 Migrate all users of opt_vec to owned_slice, delete opt_vec.
syntax::opt_vec is now entirely unused, and so can go.
2014-03-22 09:54:18 +11:00
bors
cff012dc90 auto merge of #13024 : brson/rust/issue-12799, r=thestinger
The only stage that can be installed from is 2 everywhere but windows,
3 on windows.

Lightly tested. Not actually tested on Windows, but I did confirm that a *similar* change fixed the problem on Windows.

Closes #12799
2014-03-21 13:51:47 -07:00
Alex Crichton
e7c4fb692b rand: Fix a bug acquiring a context on windows
The details can be found in the comment I wrote on the block in question, but
the gist of it is that our usage of the TIB for a stack limit was causing
CryptAcquireContext to fail, so we temporarily get around it by setting the
stack limit to 0.
2014-03-21 12:03:13 -07:00
Alex Crichton
d2e99a0b33 rand: Rewrite OsRng in Rust for windows
This removes even more rust_builtin.c code, and allows us to more gracefully
handle errors (not a process panic, but a task failure).
2014-03-21 12:03:13 -07:00
Alex Crichton
ab1dd09d73 rustc: Switch defaults from libgreen to libnative
The compiler will no longer inject libgreen as the default runtime for rust
programs, this commit switches it over to libnative by default. Now that
libnative has baked for some time, it is ready enough to start getting more
serious usage as the default runtime for rustc generated binaries.

We've found that there isn't really a correct decision in choosing a 1:1 or M:N
runtime as a default for all applications, but it seems that a larger number of
programs today would work more reasonable with a native default rather than a
green default.

With this commit come a number of bugfixes:

* The main native task is now named "<main>"
* The main native task has the stack bounds set up properly
* #[no_uv] was renamed to #[no_start]
* The core-run-destroy test was rewritten for both libnative and libgreen and
  one of the tests was modified to be more robust.
* The process-detach test was locked to libgreen because it uses signal handling
2014-03-21 12:03:13 -07:00
Alex Crichton
988664ac8a rustdoc: Fix file locking on windows
If the dwShareMode parameter is 0 on windows, it "prevents other processes from
opening a file or device if they request delete, read, or write access", which
is the opposite of what we want! This changes the 0 parameter to something which
will allow multiple processes to open the file and then lock it.
2014-03-21 09:26:34 -07:00
bors
7b957a879b auto merge of #13056 : huonw/rust/devecing-tests, r=pnkfelix
test: Remove all `~[T]` from tests, libgetopts, compiletest, librustdoc, and libnum

And most from libtest, libflate, and adds `deny(deprecated_owned_vector)`s to the smaller modules with that have zero (or nearly zero) uses of `~[T]`.

Revival of #12837
2014-03-21 08:21:51 -07:00
Huon Wilson
0384952a65 syntax: add the OwnedSlice vector wrapper.
This is a stand-in until we have a saner `~[T]` type (i.e. a proper
owned slice). It's a library version of what `~[T]` will be, i.e. an
owned pointer and a length.
2014-03-22 01:36:46 +11:00
Huon Wilson
40a52c0f0a Add #[deny(deprecated_owned_vector)] to several modules. 2014-03-22 01:08:57 +11:00
Huon Wilson
d50f5bd722 getopts: remove all uses of ~[].
And stop regressions with the lint.
2014-03-22 01:08:57 +11:00
Huon Wilson
bc3a10b9f9 Remove nearly all uses of ~[] from libtest.
Deny further uses, with explicit allows on a few specific functions.
2014-03-22 01:08:57 +11:00
Huon Wilson
6d778ff610 Remove outdated and unnecessary std::vec_ng::Vec imports.
(And fix some tests.)
2014-03-22 01:08:57 +11:00
bors
a0f943cd3a auto merge of #12654 : edwardw/rust/rc-arc, r=huonw
Since `Arc` has been using `Atomic`, this closes 12625.

Closes #12625.
2014-03-21 07:06:49 -07:00
Edward Wang
db5206c32a Rewrite rc::Rc using cell::Cell
Since `Arc` has been using `Atomic`, this closes 12625.

Closes #12625.
2014-03-21 20:49:18 +08:00
Patrick Walton
af79a5aa7d test: Make manual changes to deal with the fallout from removal of
`~[T]` in test, libgetopts, compiletest, librustdoc, and libnum.
2014-03-21 23:37:21 +11:00
Patrick Walton
579eb2400b test: Automatically remove all ~[T] from tests. 2014-03-21 23:37:21 +11:00
Patrick Walton
0b714b4ba6 libstd: Add some methods to Vec<T>. 2014-03-21 23:37:21 +11:00
bors
caf17fea06 auto merge of #13029 : FlaPer87/rust/master, r=alexcrichton
This should prevent lot of doc errors in Rust's buildbot and it shouldn't take long to run on travis. We could probably limit it to `std` but I preferred to just check all docs in this phase too.

@alexcrichton r?
2014-03-21 02:21:50 -07:00
bors
739f22f611 auto merge of #13037 : alexcrichton/rust/attr-syntax, r=brson
This will require a snapshot to finish, but these commits update the parser to parse attributes of the form `#![...]`

Thanks to @TheHydroImpulse for all the initial work!

cc #2569
2014-03-20 21:11:47 -07:00
Steven Fackler
1d98fe12a8 Clean up marker types and Unsafe initialization 2014-03-20 20:33:23 -07:00
Alex Crichton
e1ca02ec02 std: Implement Clone/TotalEq for ProcessExit
It's useful for structures which use deriving(Clone, TotalEq), even though it's
implicitly copyable.

Closes #13047
2014-03-20 20:30:12 -07:00
Steven Fackler
181875ca50 Remove RefCell::{with, with_mut}
These are superfluous now that we have fixed rvalue lifetimes and Deref.
2014-03-20 19:55:52 -07:00
Alex Crichton
811257eda5 std: Rename {push,read}_bytes to {push,read}_exact
These methods can be mistaken for general "read some bytes" utilities when
they're actually only meant for reading an exact number of bytes. By renaming
them it's much clearer about what they're doing without having to read the
documentation.

Closes #12892
2014-03-20 19:45:56 -07:00
Alex Crichton
84a91b8603 syntax: Tidy up parsing the new attribute syntax 2014-03-20 18:51:52 -07:00
Daniel Fagnan
4e00cf6134 Added new attribute syntax with backward compatibility.
Signed-off-by: Daniel Fagnan <dnfagnan@gmail.com>
2014-03-20 18:06:53 -07:00
Huon Wilson
7785fe1916 syntax: make OptVec immutable.
This is the first step to replacing OptVec with a new representation:
remove all mutability. Any mutations have to go via `Vec` and then make
to `OptVec`.

Many of the uses of OptVec are unnecessary now that Vec has no-alloc
emptiness (and have been converted to Vec): the only ones that really
need it are the AST and sty's (and so on) where there are a *lot* of
instances of them, and they're (mostly) immutable.
2014-03-21 10:52:48 +11:00
Alex Crichton
9e66f2c6b4 std: Update atomic documentation to remove 'mut'
It's all no longer necessary
2014-03-20 15:06:34 -07:00
bors
6eae7df43c auto merge of #13023 : thestinger/rust/deep_clone, r=alexcrichton 2014-03-20 15:01:47 -07:00
Brian Anderson
61622dd20c std: Remove AtomicU64
Support for this is less universal than for word-size things;
it has no users; i'd rather play it safe.
2014-03-20 13:33:43 -07:00
Brian Anderson
8748322c9b std: Make the generic atomics in sync::atomics private
I'm not comfortable exposing public functions that purport to do
atomic operations on arbitrary T.
2014-03-20 13:33:43 -07:00
Brian Anderson
eb25c42fc8 std: Make the generic atomics take unsafe pointers
These mutate values behind references that are Freeze, which is not
allowed.
2014-03-20 13:33:43 -07:00
bors
7334c11b4b auto merge of #13026 : alexcrichton/rust/snapshots, r=huonw 2014-03-20 11:06:42 -07:00
Alex Crichton
11ac4df4d2 Register new snapshots 2014-03-20 11:02:26 -07:00
bors
b568efc0cf auto merge of #13020 : alexcrichton/rust/vec, r=brson
The commits have the details.
2014-03-20 09:51:44 -07:00
Brian Anderson
f3fef9a649 std: Make atomics immutable. #11583
In Rust, the strongest guarantee that `&mut` provides is that the memory
pointed to is *not aliased*, whereas `&`'s guarantees are much weaker:
that the value can be aliased, and may be mutated under proper precautions
(interior mutability).

Our atomics though use `&mut` for mutation even while creating multiple
aliases, so this changes them to use 'interior mutability', mutating
through immutable references.
2014-03-20 09:44:29 -07:00
Alex Crichton
da3625161d Removing imports of std::vec_ng::Vec
It's now in the prelude.
2014-03-20 09:30:14 -07:00
Alex Crichton
7a5a8c3c07 rustc: Default the ~[] lint to allow for now
Most of the standard distribution is still using ~[] instead of Vec, so this
lint is essentially useless currently. When the standard distribution has been
ported to not use ~[], then we can turn the lint back on.
2014-03-20 09:13:44 -07:00
Alex Crichton
0305ed5d22 std: Add Vec to the prelude
This is an incredibly common type, and it is expected to be used in many many
places. This type should be in the prelude.
2014-03-20 09:13:44 -07:00