]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #13036 : alexcrichton/rust/atomics, r=alexcrichton
bors [Sat, 22 Mar 2014 04:31:42 +0000 (21:31 -0700)]
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.

10 years agoauto merge of #13016 : huonw/rust/new-opt-vec, r=cmr
bors [Sat, 22 Mar 2014 03:06:44 +0000 (20:06 -0700)]
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.)

10 years agoauto merge of #12833 : alexcrichton/rust/libnative, r=brson
bors [Sat, 22 Mar 2014 01:51:51 +0000 (18:51 -0700)]
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

10 years agoauto merge of #13043 : alexcrichton/rust/fix-rustdoc-windows, r=brson
bors [Fri, 21 Mar 2014 23:41:48 +0000 (16:41 -0700)]
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.

10 years agoMigrate all users of opt_vec to owned_slice, delete opt_vec.
Huon Wilson [Wed, 19 Mar 2014 14:52:37 +0000 (01:52 +1100)]
Migrate all users of opt_vec to owned_slice, delete opt_vec.

syntax::opt_vec is now entirely unused, and so can go.

10 years agoauto merge of #13024 : brson/rust/issue-12799, r=thestinger
bors [Fri, 21 Mar 2014 20:51:47 +0000 (13:51 -0700)]
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

10 years agorand: Fix a bug acquiring a context on windows
Alex Crichton [Fri, 21 Mar 2014 18:51:11 +0000 (11:51 -0700)]
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.

10 years agorand: Rewrite OsRng in Rust for windows
Alex Crichton [Thu, 20 Mar 2014 00:53:57 +0000 (17:53 -0700)]
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).

10 years agorustc: Switch defaults from libgreen to libnative
Alex Crichton [Tue, 11 Mar 2014 20:38:36 +0000 (13:38 -0700)]
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

10 years agorustdoc: Fix file locking on windows
Alex Crichton [Thu, 20 Mar 2014 20:59:07 +0000 (13:59 -0700)]
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.

10 years agoauto merge of #13056 : huonw/rust/devecing-tests, r=pnkfelix
bors [Fri, 21 Mar 2014 15:21:51 +0000 (08:21 -0700)]
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

10 years agosyntax: add the OwnedSlice vector wrapper.
Huon Wilson [Wed, 19 Mar 2014 14:51:08 +0000 (01:51 +1100)]
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.

10 years agoAdd #[deny(deprecated_owned_vector)] to several modules.
Huon Wilson [Fri, 21 Mar 2014 12:34:12 +0000 (23:34 +1100)]
Add #[deny(deprecated_owned_vector)] to several modules.

10 years agogetopts: remove all uses of `~[]`.
Huon Wilson [Fri, 21 Mar 2014 12:25:16 +0000 (23:25 +1100)]
getopts: remove all uses of `~[]`.

And stop regressions with the lint.

10 years agoRemove nearly all uses of `~[]` from libtest.
Huon Wilson [Fri, 21 Mar 2014 12:17:33 +0000 (23:17 +1100)]
Remove nearly all uses of `~[]` from libtest.

Deny further uses, with explicit allows on a few specific functions.

10 years agoRemove outdated and unnecessary std::vec_ng::Vec imports.
Huon Wilson [Fri, 21 Mar 2014 11:37:41 +0000 (22:37 +1100)]
Remove outdated and unnecessary std::vec_ng::Vec imports.

(And fix some tests.)

10 years agoauto merge of #12654 : edwardw/rust/rc-arc, r=huonw
bors [Fri, 21 Mar 2014 14:06:49 +0000 (07:06 -0700)]
auto merge of #12654 : edwardw/rust/rc-arc, r=huonw

Since `Arc` has been using `Atomic`, this closes 12625.

Closes #12625.

10 years agoRewrite rc::Rc using cell::Cell
Edward Wang [Fri, 21 Mar 2014 07:16:07 +0000 (15:16 +0800)]
Rewrite rc::Rc using cell::Cell

Since `Arc` has been using `Atomic`, this closes 12625.

Closes #12625.

10 years agotest: Make manual changes to deal with the fallout from removal of
Patrick Walton [Wed, 5 Mar 2014 23:28:08 +0000 (15:28 -0800)]
test: Make manual changes to deal with the fallout from removal of
`~[T]` in test, libgetopts, compiletest, librustdoc, and libnum.

10 years agotest: Automatically remove all `~[T]` from tests.
Patrick Walton [Wed, 5 Mar 2014 22:02:44 +0000 (14:02 -0800)]
test: Automatically remove all `~[T]` from tests.

10 years agolibstd: Add some methods to `Vec<T>`.
Patrick Walton [Thu, 6 Mar 2014 18:22:21 +0000 (10:22 -0800)]
libstd: Add some methods to `Vec<T>`.

10 years agoauto merge of #13029 : FlaPer87/rust/master, r=alexcrichton
bors [Fri, 21 Mar 2014 09:21:50 +0000 (02:21 -0700)]
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?

10 years agoauto merge of #13037 : alexcrichton/rust/attr-syntax, r=brson
bors [Fri, 21 Mar 2014 04:11:47 +0000 (21:11 -0700)]
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

10 years agosyntax: Tidy up parsing the new attribute syntax
Alex Crichton [Thu, 20 Mar 2014 18:21:17 +0000 (11:21 -0700)]
syntax: Tidy up parsing the new attribute syntax

10 years agoAdded new attribute syntax with backward compatibility.
Daniel Fagnan [Tue, 25 Feb 2014 02:42:40 +0000 (19:42 -0700)]
Added new attribute syntax with backward compatibility.

Signed-off-by: Daniel Fagnan <dnfagnan@gmail.com>
10 years agosyntax: make OptVec immutable.
Huon Wilson [Wed, 19 Mar 2014 12:16:56 +0000 (23:16 +1100)]
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.

10 years agostd: Update atomic documentation to remove 'mut'
Alex Crichton [Thu, 20 Mar 2014 22:06:34 +0000 (15:06 -0700)]
std: Update atomic documentation to remove 'mut'

It's all no longer necessary

10 years agoauto merge of #13023 : thestinger/rust/deep_clone, r=alexcrichton
bors [Thu, 20 Mar 2014 22:01:47 +0000 (15:01 -0700)]
auto merge of #13023 : thestinger/rust/deep_clone, r=alexcrichton

10 years agostd: Remove AtomicU64
Brian Anderson [Tue, 25 Feb 2014 02:23:01 +0000 (18:23 -0800)]
std: Remove AtomicU64

Support for this is less universal than for word-size things;
it has no users; i'd rather play it safe.

10 years agostd: Make the generic atomics in `sync::atomics` private
Brian Anderson [Tue, 25 Feb 2014 02:22:09 +0000 (18:22 -0800)]
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.

10 years agostd: Make the generic atomics take unsafe pointers
Brian Anderson [Tue, 25 Feb 2014 02:20:52 +0000 (18:20 -0800)]
std: Make the generic atomics take unsafe pointers

These mutate values behind references that are Freeze, which is not
allowed.

10 years agoauto merge of #13026 : alexcrichton/rust/snapshots, r=huonw
bors [Thu, 20 Mar 2014 18:06:42 +0000 (11:06 -0700)]
auto merge of #13026 : alexcrichton/rust/snapshots, r=huonw

10 years agoRegister new snapshots
Alex Crichton [Thu, 20 Mar 2014 06:04:25 +0000 (23:04 -0700)]
Register new snapshots

10 years agoauto merge of #13020 : alexcrichton/rust/vec, r=brson
bors [Thu, 20 Mar 2014 16:51:44 +0000 (09:51 -0700)]
auto merge of #13020 : alexcrichton/rust/vec, r=brson

The commits have the details.

10 years agostd: Make atomics immutable. #11583
Brian Anderson [Mon, 17 Feb 2014 09:37:26 +0000 (01:37 -0800)]
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.

10 years agoRemoving imports of std::vec_ng::Vec
Alex Crichton [Thu, 20 Mar 2014 06:23:00 +0000 (23:23 -0700)]
Removing imports of std::vec_ng::Vec

It's now in the prelude.

10 years agorustc: Default the ~[] lint to allow for now
Alex Crichton [Wed, 19 Mar 2014 21:21:42 +0000 (14:21 -0700)]
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.

10 years agostd: Add Vec to the prelude
Alex Crichton [Wed, 19 Mar 2014 21:21:12 +0000 (14:21 -0700)]
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.

10 years agoauto merge of #13017 : alexcrichton/rust/issue-13010, r=huonw
bors [Thu, 20 Mar 2014 15:21:46 +0000 (08:21 -0700)]
auto merge of #13017 : alexcrichton/rust/issue-13010, r=huonw

Previously, any library of the pattern `lib<name>-<hash>-<version>.so` was
>considered a candidate (rightly so) for loading a crate. Sets are generated for
each unique `<hash>`, and then from these sets a candidate is selected. If a set
contained more than one element, then it immediately generated an error saying
that multiple copies of the same dylib were found.

This is incorrect because each candidate needs to be validated to actually
contain a rust library (valid metadata). This commit alters the logic to filter
each set of candidates for a hash to only libraries which are actually rust
libraries. This means that if multiple false positives are found with the right
name pattern, they're all ignored.

Closes #13010

10 years agoauto merge of #13015 : tbu-/rust/pr_remove_immut, r=alexcrichton
bors [Thu, 20 Mar 2014 14:06:45 +0000 (07:06 -0700)]
auto merge of #13015 : tbu-/rust/pr_remove_immut, r=alexcrichton

Remove std::cast::transmute_immut_unsafe.
It can be done in safe code using `as *T`.

10 years agoauto merge of #12686 : FlaPer87/rust/shared, r=nikomatsakis
bors [Thu, 20 Mar 2014 12:51:48 +0000 (05:51 -0700)]
auto merge of #12686 : FlaPer87/rust/shared, r=nikomatsakis

`Share` implies that all *reachable* content is *threadsafe*.

Threadsafe is defined as "exposing no operation that permits a data race if multiple threads have access to a &T pointer simultaneously". (NB: the type system should guarantee that if you have access to memory via a &T pointer, the only other way to gain access to that memory is through another &T pointer)...

Fixes #11781
cc #12577

What this PR will do
================

- [x] Add Share kind and
- [x]  Replace usages of Freeze with Share in bounds.
- [x] Add Unsafe<T> #12577
- [x] Forbid taking the address of a immutable static item with `Unsafe<T>` interior

What's left to do in a separate PR (after the snapshot)?
===========================================

- Remove `Freeze` completely

10 years agoauto merge of #12980 : cmr/rust/overhaul-stdio, r=thestinger
bors [Thu, 20 Mar 2014 11:36:50 +0000 (04:36 -0700)]
auto merge of #12980 : cmr/rust/overhaul-stdio, r=thestinger

this comes from a discussion on IRC where the split between stdin and stdout
seemed unnatural, and the fact that reading on stdin won't flush stdout, which
is unlike every other language (including C's stdio).

10 years agoauto merge of #13028 : thestinger/rust/vec_ng, r=huonw
bors [Thu, 20 Mar 2014 09:46:49 +0000 (02:46 -0700)]
auto merge of #13028 : thestinger/rust/vec_ng, r=huonw

Closes #12771

10 years agoA couple of fixes to vec_ng docs
Steven Fackler [Thu, 20 Mar 2014 06:01:08 +0000 (23:01 -0700)]
A couple of fixes to vec_ng docs

10 years agoMention Share in the tutorial
Flavio Percoco [Sun, 16 Mar 2014 12:24:33 +0000 (13:24 +0100)]
Mention Share in the tutorial

10 years agoMention share in guide-unsafe instead of freeze
Flavio Percoco [Sun, 16 Mar 2014 12:16:46 +0000 (13:16 +0100)]
Mention share in guide-unsafe instead of freeze

10 years agoLet travis check docs for stage1
Flavio Percoco [Thu, 20 Mar 2014 09:20:08 +0000 (10:20 +0100)]
Let travis check docs for stage1

10 years agoMake atomics interior Unsafe<T>
Flavio Percoco [Fri, 14 Mar 2014 21:59:50 +0000 (22:59 +0100)]
Make atomics interior Unsafe<T>

10 years agoAllow static items that don't fulfill `Freeze`
Flavio Percoco [Fri, 14 Mar 2014 21:56:10 +0000 (22:56 +0100)]
Allow static items that don't fulfill `Freeze`

10 years agoForbid borrow of static items with unsafe interior
Flavio Percoco [Thu, 13 Mar 2014 00:02:31 +0000 (01:02 +0100)]
Forbid borrow of static items with unsafe interior

10 years agoGather loans for static items
Flavio Percoco [Fri, 14 Mar 2014 16:01:05 +0000 (17:01 +0100)]
Gather loans for static items

We currently gather loans for static items that are defined within
functions. This change enables loan gathering on static items declared
globally.

10 years agoLet ArcData use Unsafe<T>
Flavio Percoco [Tue, 11 Mar 2014 21:24:25 +0000 (22:24 +0100)]
Let ArcData use Unsafe<T>

10 years agoMake Cell and RefCell use Unsafe<T>
Flavio Percoco [Mon, 10 Mar 2014 21:55:37 +0000 (22:55 +0100)]
Make Cell and RefCell use Unsafe<T>

10 years agoAdd Unsafe<T> type
Flavio Percoco [Mon, 10 Mar 2014 21:55:15 +0000 (22:55 +0100)]
Add Unsafe<T> type

10 years agoRelax interner's Share bound
Flavio Percoco [Wed, 19 Mar 2014 14:14:08 +0000 (15:14 +0100)]
Relax interner's Share bound

The interner uses `RefCell` internally which opted out from Share.

10 years agoReplace Freeze bounds with Share bounds
Flavio Percoco [Fri, 7 Mar 2014 17:57:35 +0000 (18:57 +0100)]
Replace Freeze bounds with Share bounds

10 years agoMake `Rc`, `Cell` and `RefCell` NoShare
Flavio Percoco [Wed, 5 Mar 2014 21:09:38 +0000 (22:09 +0100)]
Make `Rc`, `Cell` and `RefCell` NoShare

10 years agoAdd a Share kind
Flavio Percoco [Mon, 3 Mar 2014 22:27:46 +0000 (23:27 +0100)]
Add a Share kind

Fixes #11781

10 years agorename std::vec_ng -> std::vec
Daniel Micay [Thu, 20 Mar 2014 07:35:51 +0000 (03:35 -0400)]
rename std::vec_ng -> std::vec

Closes #12771

10 years agoauto merge of #12854 : nick29581/rust/parse-enum-struct, r=alexcrichton
bors [Thu, 20 Mar 2014 07:41:54 +0000 (00:41 -0700)]
auto merge of #12854 : nick29581/rust/parse-enum-struct, r=alexcrichton

...where the field and variable are unified

10 years agoauto merge of #12772 : thestinger/rust/slice, r=alexcrichton
bors [Thu, 20 Mar 2014 06:21:49 +0000 (23:21 -0700)]
auto merge of #12772 : thestinger/rust/slice, r=alexcrichton

Closes #12702

10 years agomk: Simplify how prepare.mk, install.mk, and dist.mk deal with stages
Brian Anderson [Thu, 20 Mar 2014 05:47:37 +0000 (22:47 -0700)]
mk: Simplify how prepare.mk, install.mk, and dist.mk deal with stages

The only stage that can be installed from is 2 everywhere but windows,
3 on windows.

Closes #12799

10 years agorename std::vec -> std::slice
Daniel Micay [Sat, 8 Mar 2014 23:11:52 +0000 (18:11 -0500)]
rename std::vec -> std::slice

Closes #12702

10 years agorm obsolete references to `DeepClone`
Daniel Micay [Thu, 20 Mar 2014 05:24:05 +0000 (01:24 -0400)]
rm obsolete references to `DeepClone`

10 years agostd: io: flush stdout on stdin read from tty
Corey Richardson [Thu, 20 Mar 2014 03:20:39 +0000 (23:20 -0400)]
std: io: flush stdout on stdin read from tty

10 years agoauto merge of #13013 : huonw/rust/tytrait, r=cmr
bors [Thu, 20 Mar 2014 03:21:48 +0000 (20:21 -0700)]
auto merge of #13013 : huonw/rust/tytrait, r=cmr

These variants occur rarely but inflate the whole enum for the other variants, leaving a lot of wasted space. In total this reduces `ty::sty` from 160 bytes to 96 (on a 64-bit platform).

After this, `ty_struct` and `ty_enum` are the largest variants, with the 80-byte `substs` being the major contributor.

10 years agoFix spans for enum-struct match arms
Nick Cameron [Wed, 12 Mar 2014 22:51:20 +0000 (15:51 -0700)]
Fix spans for enum-struct match arms

Correct spans for fields in enum struct arms where the field and variable are unified

10 years agoauto merge of #12770 : eddyb/rust/drop-tld, r=cmr
bors [Wed, 19 Mar 2014 20:01:49 +0000 (13:01 -0700)]
auto merge of #12770 : eddyb/rust/drop-tld, r=cmr

Sadly, this seems to make memory usage worse (unless `Vec<T>` makes it worse and this PR doesn't change that much, which is entirely possible).

10 years agorustc: Prevent false positives in crate loading
Alex Crichton [Wed, 19 Mar 2014 15:47:59 +0000 (08:47 -0700)]
rustc: Prevent false positives in crate loading

Previously, any library of the pattern `lib<name>-<hash>-<version>.so` was
>considered a candidate (rightly so) for loading a crate. Sets are generated for
each unique `<hash>`, and then from these sets a candidate is selected. If a set
contained more than one element, then it immediately generated an error saying
that multiple copies of the same dylib were found.

This is incorrect because each candidate needs to be validated to actually
contain a rust library (valid metadata). This commit alters the logic to filter
each set of candidates for a hash to only libraries which are actually rust
libraries. This means that if multiple false positives are found with the right
name pattern, they're all ignored.

Closes #13010

10 years agoauto merge of #12879 : Aatch/rust/rustdoc-mod-privacy, r=alexcrichton
bors [Wed, 19 Mar 2014 17:11:54 +0000 (10:11 -0700)]
auto merge of #12879 : Aatch/rust/rustdoc-mod-privacy, r=alexcrichton

Modules don't actually inherit privacy, so anything other than Public should be considered private.

Fixes #12801

cc @cmr

10 years agoauto merge of #12762 : klutzy/rust/win-struct-abi, r=alexcrichton
bors [Wed, 19 Mar 2014 15:51:50 +0000 (08:51 -0700)]
auto merge of #12762 : klutzy/rust/win-struct-abi, r=alexcrichton

This fixes struct passing abi on x86 ffi: Structs are now passed
indirectly with byval attribute (as clang does).
Empty structs are also explicitly ignored rather than directly passed.

Fixes #5744
Fixes #11198
Fixes #11343

10 years agoRemove std::cast::transmute_immut_unsafe
Tobias Bucher [Wed, 19 Mar 2014 15:15:22 +0000 (16:15 +0100)]
Remove std::cast::transmute_immut_unsafe

It can be done in safe code using `as *T`.

10 years agoauto merge of #12982 : brson/rust/optiondocs, r=alexcrichton
bors [Wed, 19 Mar 2014 13:01:48 +0000 (06:01 -0700)]
auto merge of #12982 : brson/rust/optiondocs, r=alexcrichton

Various improvements. There's a lot more that can be done.

10 years agorustc: put ty_closure behind some indirection.
Huon Wilson [Wed, 19 Mar 2014 11:20:56 +0000 (22:20 +1100)]
rustc: put ty_closure behind some indirection.

This reduces the size of sty from 112 to 96; like with the ty_trait
variant, this variant of sty occurs rarely (~1%) so the benefits are
large and the costs small.

10 years agorustc: put ty_trait behind some indirection.
Huon Wilson [Wed, 19 Mar 2014 11:01:30 +0000 (22:01 +1100)]
rustc: put ty_trait behind some indirection.

This reduces ty::sty from 160 bytes to just 112, and some measurements
eddyb made suggest that the ty_trait variant occurs very
rarely (e.g. ~1% of all sty instances) hence this will result in a large
memory saving, and the cost of the indirection is unlikely to be an
issue.

10 years agoauto merge of #12955 : sfackler/rust/vec_ng-doc, r=alexcrichton
bors [Wed, 19 Mar 2014 08:41:43 +0000 (01:41 -0700)]
auto merge of #12955 : sfackler/rust/vec_ng-doc, r=alexcrichton

I also removed a couple of methods that were silly and added sort.

10 years agorustc: Fix x86 ffi for empty struct arguments
klutzy [Sun, 9 Mar 2014 06:42:22 +0000 (15:42 +0900)]
rustc: Fix x86 ffi for empty struct arguments

10 years agorustc: Fix x86 ffi for struct arguments
klutzy [Sat, 8 Mar 2014 02:23:06 +0000 (11:23 +0900)]
rustc: Fix x86 ffi for struct arguments

This fixes struct passing abi on x86 ffi: Structs are now passed
indirectly with byval attribute (as clang does).

10 years agoDiscard MTWT & interner tables from TLD after they stop being useful.
Eduard Burtescu [Sat, 8 Mar 2014 22:18:58 +0000 (00:18 +0200)]
Discard MTWT & interner tables from TLD after they stop being useful.

10 years agoDocify std::vec_ng
Steven Fackler [Sun, 16 Mar 2014 23:04:29 +0000 (16:04 -0700)]
Docify std::vec_ng

I also removed a couple of methods that were silly and added sort.

10 years agoauto merge of #12954 : brson/rust/atomicdocs, r=alexcrichton
bors [Wed, 19 Mar 2014 04:16:46 +0000 (21:16 -0700)]
auto merge of #12954 : brson/rust/atomicdocs, r=alexcrichton

This adds lots of docs to the atomics module. Two of the examples
are using the future atomics API (relying on `Share`) and are ignored temporarily.
I discovered a bug in the way AtomicBool's fetch_nand method is
implemented and fixed it by using the correct value for `true`.
I also fixed the implementation of AcqRel fences (it was only doing
a release barrier), and made a "relaxed" fence a failure.

10 years agostd: Improve option docs
Brian Anderson [Mon, 17 Mar 2014 01:43:47 +0000 (18:43 -0700)]
std: Improve option docs

10 years agoauto merge of #13006 : alexcrichton/rust/rollup, r=alexcrichton
bors [Wed, 19 Mar 2014 01:22:23 +0000 (18:22 -0700)]
auto merge of #13006 : alexcrichton/rust/rollup, r=alexcrichton

Closes #13008 (Made the `clone_from` implementation for `~T` reuse the `T` itself if possible)
Closes #13003 (Make method Vec::remove() public)
Closes #13002 (disallow duplicate methods in trait impls)
Closes #13000 (rustc: test: don't silently ignore bad benches)
Closes #12999 (rustc: buffer the output writer for -Z ast-json[-noexpand].)
Closes #12993 (syntax: Don't parameterize the the pretty printer)
Closes #12990 (`char` reference: s/character/Unicode scalar value/)
Closes #12987 (Move syntax-extension-hexfloat.rs)
Closes #12983 (Fix linkage1 test which fails due to --as-needed)
Closes #12978 (rustc: remove linker_private/linker_private_weak)
Closes #12976 (libsyntax: librustdoc: ignore utf-8 BOM in .rs files)
Closes #12973 (closes #12967 fix [en|de]coding of HashMap<K,V> where K is a numeric type)
Closes #12972 (Add impl IntoStr for ::std::vec_ng::Vec<Ascii>)
Closes #12968 (deny missing docs getopts)
Closes #12965 (Documentation and formatting changes for option.rs.)
Closes #12962 (Relax the memory ordering on the implementation of UnsafeArc)
Closes #12958 (Typo fixes.)
Closes #12950 (Docsprint: Document ops module, primarily Deref.)
Closes #12946 (rustdoc: Implement cross-crate searching)

10 years agoTest fixes from the rollup
Alex Crichton [Tue, 18 Mar 2014 21:03:45 +0000 (14:03 -0700)]
Test fixes from the rollup

10 years agoMade the `clone_from` implementation for `~T` reuse the `T` itself if
Marvin Löbel [Tue, 18 Mar 2014 22:16:21 +0000 (23:16 +0100)]
Made the `clone_from` implementation for `~T` reuse the `T` itself if
possible by also calling `clone_from` on it.

In general, `Clone` implementors that overwrite `clone_from`
should try to to use it recursivly for substructures.

10 years agorustdoc: Implement cross-crate searching
Alex Crichton [Sun, 16 Mar 2014 08:08:56 +0000 (01:08 -0700)]
rustdoc: Implement cross-crate searching

A major discoverability issue with rustdoc is that all crates have their
documentation built in isolation, so it's difficult when looking at the
documentation for libstd to learn that there's a libcollections crate with a
HashMap in it.

This commit moves rustdoc a little closer to improving the multiple crate
experience. This unifies all search indexes for all crates into one file so all
pages share the same search index. This allows searching to work across crates
in the same documentation directory (as the standard distribution is currently
built).

This strategy involves updating a shared file amongst many rustdoc processes, so
I implemented a simple file locking API for handling synchronization for updates
to the shared files.

cc #12554

10 years agoDocsprint: Document ops module, primarily Deref.
Matthew McPherrin [Sun, 16 Mar 2014 22:35:35 +0000 (15:35 -0700)]
Docsprint: Document ops module, primarily Deref.

10 years agoTypo fixes.
Lindsey Kuper [Mon, 17 Mar 2014 00:12:49 +0000 (20:12 -0400)]
Typo fixes.

10 years agoRelaxed the memory ordering on the implementation of UnsafeArc
Jonathan S [Mon, 17 Mar 2014 00:39:38 +0000 (19:39 -0500)]
Relaxed the memory ordering on the implementation of UnsafeArc

10 years agoDocumentation and formatting changes for option.rs.
Ziad Hatahet [Mon, 17 Mar 2014 03:42:25 +0000 (20:42 -0700)]
Documentation and formatting changes for option.rs.

10 years agodeny missing docs
Alan Andrade [Mon, 17 Mar 2014 05:53:54 +0000 (22:53 -0700)]
deny missing docs

10 years agoAdd impl IntoStr for ::std::vec_ng::Vec<Ascii>
Eunchong Yu [Mon, 17 Mar 2014 06:30:27 +0000 (15:30 +0900)]
Add impl IntoStr for ::std::vec_ng::Vec<Ascii>

10 years agocloses #12967 fix [en|de]coding of HashMap<K,V> where K is a numeric type
Jeff Olson [Mon, 17 Mar 2014 07:26:36 +0000 (00:26 -0700)]
closes #12967 fix [en|de]coding of HashMap<K,V> where K is a numeric type

serialize: ref #12697 minor adj. to last char check + prettyencode test

10 years agolibsyntax: librustdoc: ignore utf-8 BOM in .rs files
Liigo Zhuang [Tue, 18 Mar 2014 00:59:44 +0000 (08:59 +0800)]
libsyntax: librustdoc: ignore utf-8 BOM in .rs files
Closes #12974

10 years agorustc: remove obsolete linkage types
Ben Noordhuis [Mon, 17 Mar 2014 15:37:23 +0000 (16:37 +0100)]
rustc: remove obsolete linkage types

Remove obsolete linkage types from the llvm::Linkage enum.  The linkage
types are no-ops and weren't used inside rustc anyway.

10 years agorustc: remove linker_private/linker_private_weak
Ben Noordhuis [Sun, 16 Mar 2014 13:39:51 +0000 (14:39 +0100)]
rustc: remove linker_private/linker_private_weak

Remove the linker_private and linker_private_weak linkage attributes,
they have been superseded by private and private_weak and have been
removed in upstream LLVM in commit r203866.

10 years agoFix linkage1 test which fails due to --as-needed
Nick Cameron [Mon, 17 Mar 2014 21:54:35 +0000 (10:54 +1300)]
Fix linkage1 test which fails due to --as-needed

It appears that the --as-needed flag to linkers will not pull in a dynamic library unless it satisfies a non weak undefined symbol. The linkage1 test was creating a dynamic library where it was only used for a weak-symbol as part of an executable, so the dynamic library was getting discarded.

This commit adds another symbol to the library which satisfies a strong undefined symbol, so the library is pulled in to resolve the weak reference.

10 years agoMove syntax-extension-hexfloat.rs
Nick Cameron [Tue, 18 Mar 2014 01:21:35 +0000 (14:21 +1300)]
Move syntax-extension-hexfloat.rs

Move syntax-extension-hexfloat.rs to run-pass-fulldeps so it depends on libhexfloat being compiled before running.

10 years ago`char`: s/character/Unicode scalar value/
Simon Sapin [Tue, 18 Mar 2014 04:19:18 +0000 (12:19 +0800)]
`char`: s/character/Unicode scalar value/

Tweak the definition of `char` to use the appropriate Unicode terminology.

10 years agosyntax: Don't parameterize the the pretty printer
Alex Crichton [Tue, 18 Mar 2014 05:27:37 +0000 (22:27 -0700)]
syntax: Don't parameterize the the pretty printer

The pretty printer constitues an enormous amount of code, there's no reason for
it to be generic. This just least to a huge amount of metadata which isn't
necessary. Instead, this change migrates the pretty printer to using a trait
object instead.

Closes #12985