]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoRemoved doubled wording.
Zach Pomerantz [Tue, 10 Jun 2014 23:53:04 +0000 (16:53 -0700)]
Removed doubled wording.

The guide previously stated:

> The compiler will automatically convert a box box point to a reference like &point.

This fixes the doubled word `box`, so the statement reads

> The compiler will automatically convert a box point to a reference like &point.

The code it is referring to is `compute_distance(&on_the_stack, on_the_heap);`, so a single `box` is appropriate.

10 years agoauto merge of #14752 : jakub-/rust/issue-11940, r=alexcrichton
bors [Tue, 10 Jun 2014 20:17:10 +0000 (13:17 -0700)]
auto merge of #14752 : jakub-/rust/issue-11940, r=alexcrichton

Fixes #8315
Fixes #11940

10 years agoauto merge of #14696 : jakub-/rust/dead-struct-fields, r=alexcrichton
bors [Tue, 10 Jun 2014 16:49:29 +0000 (09:49 -0700)]
auto merge of #14696 : jakub-/rust/dead-struct-fields, r=alexcrichton

This uncovered some dead code, most notably in middle/liveness.rs, which I think suggests there must be something fishy with that part of the code.

The #[allow(dead_code)] annotations on some of the fields I am not super happy about but as I understand, marker type may disappear at some point.

10 years agoauto merge of #14606 : pcwalton/rust/fn-trait-sugar, r=alexcrichton
bors [Tue, 10 Jun 2014 06:41:53 +0000 (23:41 -0700)]
auto merge of #14606 : pcwalton/rust/fn-trait-sugar, r=alexcrichton

r? @alexcrichton

10 years agoauto merge of #14783 : alexcrichton/rust/rollup, r=alexcrichton
bors [Tue, 10 Jun 2014 04:57:09 +0000 (21:57 -0700)]
auto merge of #14783 : alexcrichton/rust/rollup, r=alexcrichton

Closes #14611 (std: Remove the as_utf16_p functions)
Closes #14694 (Num cleanup)
Closes #14760 (Add --color to test binary options)
Closes #14763 (std: Move dynamic_lib from std::unstable to std)
Closes #14766 (Add test for issue #13446)
Closes #14769 (collections: Add missing Default impls)
Closes #14773 (General nits)
Closes #14776 (rustdoc: Correctly classify enums/typedefs)

10 years agoTest fixes from rollup
Alex Crichton [Tue, 10 Jun 2014 02:55:28 +0000 (19:55 -0700)]
Test fixes from rollup

10 years agolibrustc: Implement sugar for the `FnMut` trait
Patrick Walton [Mon, 2 Jun 2014 01:41:46 +0000 (18:41 -0700)]
librustc: Implement sugar for the `FnMut` trait

10 years agoauto merge of #14694 : aochagavia/rust/num-cleanup, r=alexcrichton
bors [Tue, 10 Jun 2014 02:52:08 +0000 (19:52 -0700)]
auto merge of #14694 : aochagavia/rust/num-cleanup, r=alexcrichton

10 years agorustdoc: Correctly classify enums/typedefs
Alex Crichton [Mon, 9 Jun 2014 19:56:37 +0000 (12:56 -0700)]
rustdoc: Correctly classify enums/typedefs

Both of these items are surfaced as a DefTy, so some extra logic was needed in
the decoder module to figure out whether one is actually an enum or whether it's
a typedef.

Closes #14757

10 years agostd: adjust the TCP io doc example to work reliably.
Huon Wilson [Mon, 9 Jun 2014 14:33:04 +0000 (00:33 +1000)]
std: adjust the TCP io doc example to work reliably.

Fixes #11576 by making the code never run (and hence never
pass when the test was marked `should_fail`).

10 years agonative: add more info to the native unimplemented error.
Huon Wilson [Mon, 9 Jun 2014 14:31:31 +0000 (00:31 +1000)]
native: add more info to the native unimplemented error.

This refers to green, which (AFAICT) has everything implemented. In
particular, this will help guide people to get working signal handling
via libgreen.

10 years agocollections: Add missing Default impls
Tom Jakubowski [Mon, 9 Jun 2014 07:30:04 +0000 (00:30 -0700)]
collections: Add missing Default impls

Add Default impls for TreeMap, TreeSet, SmallIntMap, BitvSet, DList,
PriorityQueue, RingBuf, TrieMap, and TrieSet.

10 years agoAdd test for issue #13446
Piotr Jawniak [Mon, 9 Jun 2014 05:44:49 +0000 (07:44 +0200)]
Add test for issue #13446

Closes #13446

10 years agostd: Move dynamic_lib from std::unstable to std
Brian Anderson [Mon, 9 Jun 2014 03:12:10 +0000 (20:12 -0700)]
std: Move dynamic_lib from std::unstable to std

This leaves a deprecated reexport in place temporarily.

Closes #1457.

10 years agoAdd a --color flag to test binaries
Steven Fackler [Mon, 9 Jun 2014 00:10:27 +0000 (17:10 -0700)]
Add a --color flag to test binaries

It uses the same behavior as rustc's.

10 years agoCleanup bigint
Adolfo Ochagavía [Fri, 6 Jun 2014 08:56:03 +0000 (10:56 +0200)]
Cleanup bigint

10 years agoMoved integer trait and functions to submodule
Adolfo Ochagavía [Thu, 5 Jun 2014 19:07:50 +0000 (21:07 +0200)]
Moved integer trait and functions to submodule

10 years agostd: Remove the as_utf16_p functions
Alex Crichton [Mon, 2 Jun 2014 21:51:58 +0000 (14:51 -0700)]
std: Remove the as_utf16_p functions

These functions are all much better expressed via RAII using the to_utf16()
method on strings. This refactoring also takes this opportunity to properly
handle when filenames aren't valid unicode when passed through to the windows
I/O layer by properly returning I/O errors.

All previous users of the `as_utf16_p` or `as_utf16_mut_p` functions will need
to convert their code to using `foo.to_utf16().append_one(0)` to get a
null-terminated utf16 string.

[breaking-change]

10 years agoauto merge of #14590 : pcwalton/rust/overloaded-call, r=nick29581
bors [Tue, 10 Jun 2014 00:37:08 +0000 (17:37 -0700)]
auto merge of #14590 : pcwalton/rust/overloaded-call, r=nick29581

gate.

This is part of unboxed closures.

r? @nick29581

10 years agoauto merge of #14554 : kmcallister/rust/plugin_registrar, r=cmr
bors [Mon, 9 Jun 2014 22:52:07 +0000 (15:52 -0700)]
auto merge of #14554 : kmcallister/rust/plugin_registrar, r=cmr

This implements the design in rust-lang/rfcs#86.  It shouldn't be merged until that RFC is accepted, but it would be great if somebody has time to review the code before then.

10 years agoMacro crates now depend on librustc
Keegan McAllister [Sat, 31 May 2014 00:55:42 +0000 (17:55 -0700)]
Macro crates now depend on librustc

10 years agoDocument rustc::plugin
Keegan McAllister [Mon, 26 May 2014 21:48:54 +0000 (14:48 -0700)]
Document rustc::plugin

10 years agoAdd a test for deprecated phase(syntax)
Keegan McAllister [Sun, 25 May 2014 05:22:24 +0000 (22:22 -0700)]
Add a test for deprecated phase(syntax)

10 years agoConvert tests to use #[plugin_registrar]
Keegan McAllister [Sun, 25 May 2014 04:38:16 +0000 (21:38 -0700)]
Convert tests to use #[plugin_registrar]

10 years agoConvert libraries to use #[plugin_registrar]
Keegan McAllister [Sun, 25 May 2014 04:31:50 +0000 (21:31 -0700)]
Convert libraries to use #[plugin_registrar]

10 years agoUse phase(plugin) in tests
Keegan McAllister [Sun, 25 May 2014 04:24:35 +0000 (21:24 -0700)]
Use phase(plugin) in tests

10 years agoUse phase(plugin) in other crates
Keegan McAllister [Sun, 25 May 2014 04:22:52 +0000 (21:22 -0700)]
Use phase(plugin) in other crates

10 years agoUse phase(plugin) in bootstrap crates
Keegan McAllister [Sun, 25 May 2014 04:15:16 +0000 (21:15 -0700)]
Use phase(plugin) in bootstrap crates

Do this to avoid warnings on post-stage0 builds.

10 years agoImplement #[plugin_registrar]
Keegan McAllister [Sat, 24 May 2014 23:16:10 +0000 (16:16 -0700)]
Implement #[plugin_registrar]

See RFC 22.

[breaking-change]

10 years agoauto merge of #14775 : alexcrichton/rust/fix-master, r=brson
bors [Mon, 9 Jun 2014 21:07:12 +0000 (14:07 -0700)]
auto merge of #14775 : alexcrichton/rust/fix-master, r=brson

Apparently one of the linux bots doesn't have the USER variable defined, and
this fix will likely land more quickly than a fix to the bots.

10 years agoAdd missing repr(C) annotations to mutex.rs
Jakub Wieczorek [Mon, 9 Jun 2014 20:14:51 +0000 (22:14 +0200)]
Add missing repr(C) annotations to mutex.rs

10 years agostd: Read HOME instead of USER
Alex Crichton [Mon, 9 Jun 2014 19:44:45 +0000 (12:44 -0700)]
std: Read HOME instead of USER

Apparently one of the linux bots doesn't have the USER variable defined, and
this fix will likely land more quickly than a fix to the bots.

10 years agolibrustc: Implement overloading for the call operator behind a feature
Patrick Walton [Sun, 1 Jun 2014 23:35:01 +0000 (16:35 -0700)]
librustc: Implement overloading for the call operator behind a feature
gate.

This is part of unboxed closures.

10 years agoCleanup bigint
Adolfo Ochagavía [Fri, 6 Jun 2014 08:56:03 +0000 (10:56 +0200)]
Cleanup bigint

10 years agoMoved integer trait and functions to submodule
Adolfo Ochagavía [Thu, 5 Jun 2014 19:07:50 +0000 (21:07 +0200)]
Moved integer trait and functions to submodule

10 years agoauto merge of #14709 : alexcrichton/rust/collections, r=brson
bors [Mon, 9 Jun 2014 08:11:58 +0000 (01:11 -0700)]
auto merge of #14709 : alexcrichton/rust/collections, r=brson

This is mostly just a cosmetic change, continuing the work from #14333.

10 years agocore: Move the collections traits to libcollections
Alex Crichton [Fri, 6 Jun 2014 23:33:44 +0000 (16:33 -0700)]
core: Move the collections traits to libcollections

This commit moves Mutable, Map, MutableMap, Set, and MutableSet from
`core::collections` to the `collections` crate at the top-level. Additionally,
this removes the `deque` module and moves the `Deque` trait to only being
available at the top-level of the collections crate.

All functionality continues to be reexported through `std::collections`.

[breaking-change]

10 years agoauto merge of #14740 : P1start/rust/name-warnings, r=alexcrichton
bors [Mon, 9 Jun 2014 06:26:57 +0000 (23:26 -0700)]
auto merge of #14740 : P1start/rust/name-warnings, r=alexcrichton

This updates identifier warnings such as ``struct `foo_bar` should have a
camel case identifier`` to provide an example.

Closes #14738.

10 years agocore: Rename `container` mod to `collections`. Closes #12543
Brian Anderson [Mon, 19 May 2014 18:32:09 +0000 (11:32 -0700)]
core: Rename `container` mod to `collections`. Closes #12543

Also renames the `Container` trait to `Collection`.

[breaking-change]

10 years agoauto merge of #14765 : rapha/rust/master, r=alexcrichton
bors [Mon, 9 Jun 2014 04:26:59 +0000 (21:26 -0700)]
auto merge of #14765 : rapha/rust/master, r=alexcrichton

10 years agoConverted PortReader and ChanWriter to use Vec.
Raphael Speyer [Mon, 9 Jun 2014 04:18:11 +0000 (14:18 +1000)]
Converted PortReader and ChanWriter to use Vec.

10 years agoauto merge of #14756 : TeXitoi/rust/relicense-shootout-fannkuch-redux, r=brson
bors [Sun, 8 Jun 2014 21:56:52 +0000 (14:56 -0700)]
auto merge of #14756 : TeXitoi/rust/relicense-shootout-fannkuch-redux, r=brson

Part of #14248

Main contributors are @pcwalton, @alexcrichton and me.  Only
@dguenther appear in git blame as a minor contribution, but it is
only adding the rust license, so removed by this relicensing.

@brson OK?

10 years agorelicense shootout-fannkuch-redux.rs
Guillaume Pinot [Sun, 8 Jun 2014 20:25:49 +0000 (22:25 +0200)]
relicense shootout-fannkuch-redux.rs

Part of #14248

Main contributors are @pcwalton, @alexcrichton and me.  Only
@dguenther appear in git blame as a minor contribution, but it is
only adding the rust license, so removed by this relicensing.

10 years agoMark relevant structs with repr(C)
Jakub Wieczorek [Sun, 8 Jun 2014 19:55:17 +0000 (21:55 +0200)]
Mark relevant structs with repr(C)

10 years agoauto merge of #14751 : jbcrail/rust/fix-comments, r=alexcrichton
bors [Sun, 8 Jun 2014 19:51:51 +0000 (12:51 -0700)]
auto merge of #14751 : jbcrail/rust/fix-comments, r=alexcrichton

10 years agoRemove a redundant bitcast from fail!() handling
Jakub Wieczorek [Sun, 8 Jun 2014 18:01:38 +0000 (20:01 +0200)]
Remove a redundant bitcast from fail!() handling

10 years agoFix an LLVM assertion when matching against static strings
Jakub Wieczorek [Sun, 8 Jun 2014 17:37:45 +0000 (19:37 +0200)]
Fix an LLVM assertion when matching against static strings

Fixes #8315
Fixes #11940

10 years agoFix spelling errors in comments.
Joseph Crail [Sun, 8 Jun 2014 17:22:49 +0000 (13:22 -0400)]
Fix spelling errors in comments.

10 years agoauto merge of #14749 : sfackler/rust/bitv-hash, r=alexcrichton
bors [Sun, 8 Jun 2014 17:36:54 +0000 (10:36 -0700)]
auto merge of #14749 : sfackler/rust/bitv-hash, r=alexcrichton

Closes #14744

10 years agoImplement Hash for Bitv and BitvSet
Steven Fackler [Sun, 8 Jun 2014 16:30:03 +0000 (09:30 -0700)]
Implement Hash for Bitv and BitvSet

Closes #14744

10 years agoauto merge of #14745 : huonw/rust/timer-doc, r=alexcrichton
bors [Sun, 8 Jun 2014 13:01:49 +0000 (06:01 -0700)]
auto merge of #14745 : huonw/rust/timer-doc, r=alexcrichton

std::io: expand the oneshot/periodic docs.

Examples!

Fixes #14714.

10 years agoRemove the dead code identified by the new lint
Jakub Wieczorek [Fri, 6 Jun 2014 13:51:42 +0000 (15:51 +0200)]
Remove the dead code identified by the new lint

10 years agoAdd detection of dead struct fields
Jakub Wieczorek [Thu, 5 Jun 2014 22:00:29 +0000 (00:00 +0200)]
Add detection of dead struct fields

10 years agoauto merge of #14741 : sfackler/rust/visit-attr, r=alexcrichton
bors [Sun, 8 Jun 2014 11:16:53 +0000 (04:16 -0700)]
auto merge of #14741 : sfackler/rust/visit-attr, r=alexcrichton

The lint was missing a *lot* of cases previously.

10 years agoauto merge of #14728 : TeXitoi/rust/relicense-shootout-regex-dna, r=brson
bors [Sun, 8 Jun 2014 09:31:53 +0000 (02:31 -0700)]
auto merge of #14728 : TeXitoi/rust/relicense-shootout-regex-dna, r=brson

Part of #14248

The authors are @pcwalton and @BurntSushi, and we have their agreement.

@brson OK?

10 years agostd::io: expand the oneshot/periodic docs.
Huon Wilson [Sun, 8 Jun 2014 07:30:28 +0000 (17:30 +1000)]
std::io: expand the oneshot/periodic docs.

Examples!

Fixes #14714.

10 years agoauto merge of #14743 : Sawyer47/rust/range-msg, r=huonw
bors [Sun, 8 Jun 2014 07:46:57 +0000 (00:46 -0700)]
auto merge of #14743 : Sawyer47/rust/range-msg, r=huonw

Range allows char and numeric types, but previous error message
mentioned only numeric types.

10 years agoRemove unused name_str_pair method
Steven Fackler [Sun, 8 Jun 2014 07:21:35 +0000 (00:21 -0700)]
Remove unused name_str_pair method

10 years agoAdd back hint for crate level attributes
Steven Fackler [Sun, 8 Jun 2014 07:21:15 +0000 (00:21 -0700)]
Add back hint for crate level attributes

10 years agoImprove error message for range in match
Piotr Jawniak [Sat, 24 May 2014 17:30:25 +0000 (19:30 +0200)]
Improve error message for range in match

Range allows char and numeric types, but previous error message
mentioned only numeric types.

10 years agoRemove the attribute_usage lint
Steven Fackler [Sun, 8 Jun 2014 06:46:32 +0000 (23:46 -0700)]
Remove the attribute_usage lint

It has been superseded by the unused_attribute lint.

[breaking change]

10 years agoAdd visit_attribute to Visitor, use it for unused_attribute
Steven Fackler [Sun, 8 Jun 2014 06:02:48 +0000 (23:02 -0700)]
Add visit_attribute to Visitor, use it for unused_attribute

The lint was missing a *lot* of cases previously.

10 years agoupdate identifier naming warnings to give an example
P1start [Sun, 8 Jun 2014 05:27:00 +0000 (17:27 +1200)]
update identifier naming warnings to give an example

This updates identifier warnings such as ``struct `foo_bar` should have a
camel case identifier`` to provide an example.

Closes #14738.

10 years agoauto merge of #14733 : sfackler/rust/partial-eq-nan-docs, r=alexcrichton
bors [Sun, 8 Jun 2014 01:01:46 +0000 (18:01 -0700)]
auto merge of #14733 : sfackler/rust/partial-eq-nan-docs, r=alexcrichton

It is in fact the case that `NaN != NaN`. The true relations for
compareQuietNotEqual are LT, GT *and* UN.

I also rephrased the docs for PartialOrd since floats are not the only
types which are not totally ordered.

10 years agoClarify restrictions on ne
Steven Fackler [Sun, 8 Jun 2014 00:50:45 +0000 (17:50 -0700)]
Clarify restrictions on ne

I can't think of any sane cases where this restriction would not hold,
and the standard library seems to assume it pretty much everywhere.

10 years agoFix PartialEq documentation with regards to floats
Steven Fackler [Sat, 7 Jun 2014 20:38:24 +0000 (13:38 -0700)]
Fix PartialEq documentation with regards to floats

It is in fact the case that `NaN != NaN`. The true relations for
compareQuietNotEqual are LT, GT *and* UN.

I also rephrased the docs for PartialOrd since floats are not the only
types which are not totally ordered.

10 years agoauto merge of #14725 : aochagavia/rust/show, r=alexcrichton
bors [Sat, 7 Jun 2014 22:31:44 +0000 (15:31 -0700)]
auto merge of #14725 : aochagavia/rust/show, r=alexcrichton

10 years agoauto merge of #14722 : hannobraun/rust/quote-args, r=alexcrichton
bors [Sat, 7 Jun 2014 20:46:42 +0000 (13:46 -0700)]
auto merge of #14722 : hannobraun/rust/quote-args, r=alexcrichton

The need for this came up while I worked on a procedural macro that parses an argument and adds the same argument to a generated function.

10 years agoauto merge of #14730 : alexcrichton/rust/issue-14723, r=cmr
bors [Sat, 7 Jun 2014 19:01:41 +0000 (12:01 -0700)]
auto merge of #14730 : alexcrichton/rust/issue-14723, r=cmr

Closes #14723

10 years agorustdoc: More selectively remove execute links
Alex Crichton [Sat, 7 Jun 2014 17:53:22 +0000 (10:53 -0700)]
rustdoc: More selectively remove execute links

Closes #14723

10 years agoImplement Show for SmallIntMap
Adolfo Ochagavía [Sat, 7 Jun 2014 16:17:58 +0000 (18:17 +0200)]
Implement Show for SmallIntMap

10 years agorelicense shootout-regex-dna.rs
Guillaume Pinot [Sat, 7 Jun 2014 17:34:29 +0000 (19:34 +0200)]
relicense shootout-regex-dna.rs

Part of #14248

The authors are @pcwalton and @BurntSushi, and we have their agreement.

10 years agoauto merge of #14717 : zwarich/rust/borrowck-tests, r=cmr
bors [Sat, 7 Jun 2014 17:17:38 +0000 (10:17 -0700)]
auto merge of #14717 : zwarich/rust/borrowck-tests, r=cmr

After sitting down to build on the work merged in #14318, I realized that some of the test names were not clear, others probably weren't testing the right thing, and they were also not as exhaustive as they could have been.

10 years agoImplement ToSource and ToToken for ast::Arg
Hanno Braun [Sat, 7 Jun 2014 13:46:41 +0000 (13:46 +0000)]
Implement ToSource and ToToken for ast::Arg

This makes ast::Arg usable in the quote_ macros.

Please note that this commit doesn't include a regression test. There
are tests that use the quote macros, but all of them are ignored. Due to
that, there is no obvious (to me) way to test this.

Since this change is absolutely trivial and only hooks up an additional
type to existing infrastructure (which presumably is tested elsewhere),
I concluded it's not worth the effort to follow up on this.

10 years agoImplement Show for DList
Adolfo Ochagavía [Sat, 7 Jun 2014 13:01:44 +0000 (15:01 +0200)]
Implement Show for DList

10 years agoClean up borrows in borrowck field-sensitivity tests
Cameron Zwarich [Sat, 7 Jun 2014 09:55:00 +0000 (02:55 -0700)]
Clean up borrows in borrowck field-sensitivity tests

Instead of calling a borrow() function that takes a pointer type, just
create a local pointer and dereference it. The dereference is there to
outsmart any future liveness analysis in borrowck.

10 years agoFix bad borrowck tests and move them from run-pass to compile-fail
Cameron Zwarich [Sat, 7 Jun 2014 09:46:35 +0000 (02:46 -0700)]
Fix bad borrowck tests and move them from run-pass to compile-fail

The move_after_borrow / fu_move_after_borrow tests in
run-pass/borrowck-field-sensitivity.rs are not testing the right thing,
since the scope of the borrow is limited to the call to borrow(). When
fixed, these tests fail and thus should be moved to the corresponding
compile-fail test file.

10 years agoAdd more borrowck tests for functional update moves
Cameron Zwarich [Sat, 7 Jun 2014 07:44:01 +0000 (00:44 -0700)]
Add more borrowck tests for functional update moves

Add more borrowck field-sensitivity tests for functional update moves.
This makes the collection of test functions more combinatorially
exhaustive.

10 years agoMake borrowck test functions better match their names
Cameron Zwarich [Sat, 7 Jun 2014 09:20:44 +0000 (02:20 -0700)]
Make borrowck test functions better match their names

A number of borrowck field-sensitivity tests perform more moves and
copies than their naming scheme would indicate. This is only necessary
for borrowed pointers (to ensure that the borrowws stay alive in the
near future when borrow liveness is tracked), but all other test
functions should be changed to match their name more closely.

10 years agoMention the specific kind of use in borrowck test function names
Cameron Zwarich [Sat, 7 Jun 2014 07:29:24 +0000 (00:29 -0700)]
Mention the specific kind of use in borrowck test function names

Some of the borrowck field-sensitivity test functions have 'use' in
their name, but they don't refer to the specific kind of use (whether a
copy or a deref). It would be better if the name more precisely
reflected what the function is testing.

10 years agoauto merge of #14708 : gereeter/rust/faster-sem, r=alexcrichton
bors [Sat, 7 Jun 2014 07:51:36 +0000 (00:51 -0700)]
auto merge of #14708 : gereeter/rust/faster-sem, r=alexcrichton

Currently, `Sem`, which is used as a building block for all the blocking primitives, uses a very ugly hack to implement `Share` and be able to mutate the stored `WaitQueue` by hiding it all behind a `transmute`d `*()`. This PR replaces all that ugly machinery with `Unsafe`. Beyond being cleaner and not requiring `transmute`, this removes an allocation in the creation and removes an indirection for access.

10 years agoauto merge of #14638 : alexcrichton/rust/librustrt, r=brson
bors [Sat, 7 Jun 2014 06:06:35 +0000 (23:06 -0700)]
auto merge of #14638 : alexcrichton/rust/librustrt, r=brson

As part of the libstd facade efforts, this commit extracts the runtime interface
out of the standard library into a standalone crate, librustrt. This crate will
provide the following services:

* Definition of the rtio interface
* Definition of the Runtime interface
* Implementation of the Task structure
* Implementation of task-local-data
* Implementation of task failure via unwinding via libunwind
* Implementation of runtime initialization and shutdown
* Implementation of thread-local-storage for the local rust Task

Notably, this crate avoids the following services:

* Thread creation and destruction. The crate does not require the knowledge of
  an OS threading system, and as a result it seemed best to leave out the
  `rt::thread` module from librustrt. The librustrt module does depend on
  mutexes, however.
* Implementation of backtraces. There is no inherent requirement for the runtime
  to be able to generate backtraces. As will be discussed later, this
  functionality continues to live in libstd rather than librustrt.

As usual, a number of architectural changes were required to make this crate
possible. Users of "stable" functionality will not be impacted by this change,
but users of the `std::rt` module will likely note the changes. A list of
architectural changes made is:

* The stdout/stderr handles no longer live directly inside of the `Task`
  structure. This is a consequence of librustrt not knowing about `std::io`.
  These two handles are now stored inside of task-local-data.

  The handles were originally stored inside of the `Task` for perf reasons, and
  TLD is not currently as fast as it could be. For comparison, 100k prints goes
  from 59ms to 68ms (a 15% slowdown). This appeared to me to be an acceptable
  perf loss for the successful extraction of a librustrt crate.

* The `rtio` module was forced to duplicate more functionality of `std::io`. As
  the module no longer depends on `std::io`, `rtio` now defines structures such
  as socket addresses, addrinfo fiddly bits, etc. The primary change made was
  that `rtio` now defines its own `IoError` type. This type is distinct from
  `std::io::IoError` in that it does not have an enum for what error occurred,
  but rather a platform-specific error code.

  The native and green libraries will be updated in later commits for this
  change, and the bulk of this effort was put behind updating the two libraries
  for this change (with `rtio`).

* Printing a message on task failure (along with the backtrace) continues to
  live in libstd, not in librustrt. This is a consequence of the above decision
  to move the stdout/stderr handles to TLD rather than inside the `Task` itself.
  The unwinding API now supports registration of global callback functions which
  will be invoked when a task fails, allowing for libstd to register a function
  to print a message and a backtrace.

  The API for registering a callback is experimental and unsafe, as the
  ramifications of running code on unwinding is pretty hairy.

* The `std::unstable::mutex` module has moved to `std::rt::mutex`.

* The `std::unstable::sync` module has been moved to `std::rt::exclusive` and
  the type has been rewritten to not internally have an Arc and to have an RAII
  guard structure when locking. Old code should stop using `Exclusive` in favor
  of the primitives in `libsync`, but if necessary, old code should port to
  `Arc<Exclusive<T>>`.

* The local heap has been stripped down to have fewer debugging options. None of
  these were tested, and none of these have been used in a very long time.

10 years agolibs: Fix miscellaneous fallout of librustrt
Alex Crichton [Wed, 4 Jun 2014 07:01:40 +0000 (00:01 -0700)]
libs: Fix miscellaneous fallout of librustrt

10 years agotest: Fix fallout of previous changes
Alex Crichton [Wed, 4 Jun 2014 07:01:08 +0000 (00:01 -0700)]
test: Fix fallout of previous changes

10 years agorustuv: Deal with the rtio changes
Alex Crichton [Wed, 4 Jun 2014 07:00:59 +0000 (00:00 -0700)]
rustuv: Deal with the rtio changes

10 years agonative: Deal with the rtio changes
Alex Crichton [Wed, 4 Jun 2014 07:00:49 +0000 (00:00 -0700)]
native: Deal with the rtio changes

10 years agostd: Deal with fallout of rtio changes
Alex Crichton [Wed, 4 Jun 2014 03:09:39 +0000 (20:09 -0700)]
std: Deal with fallout of rtio changes

10 years agostd: Extract librustrt out of libstd
Alex Crichton [Wed, 4 Jun 2014 02:11:49 +0000 (19:11 -0700)]
std: Extract librustrt out of libstd

As part of the libstd facade efforts, this commit extracts the runtime interface
out of the standard library into a standalone crate, librustrt. This crate will
provide the following services:

* Definition of the rtio interface
* Definition of the Runtime interface
* Implementation of the Task structure
* Implementation of task-local-data
* Implementation of task failure via unwinding via libunwind
* Implementation of runtime initialization and shutdown
* Implementation of thread-local-storage for the local rust Task

Notably, this crate avoids the following services:

* Thread creation and destruction. The crate does not require the knowledge of
  an OS threading system, and as a result it seemed best to leave out the
  `rt::thread` module from librustrt. The librustrt module does depend on
  mutexes, however.
* Implementation of backtraces. There is no inherent requirement for the runtime
  to be able to generate backtraces. As will be discussed later, this
  functionality continues to live in libstd rather than librustrt.

As usual, a number of architectural changes were required to make this crate
possible. Users of "stable" functionality will not be impacted by this change,
but users of the `std::rt` module will likely note the changes. A list of
architectural changes made is:

* The stdout/stderr handles no longer live directly inside of the `Task`
  structure. This is a consequence of librustrt not knowing about `std::io`.
  These two handles are now stored inside of task-local-data.

  The handles were originally stored inside of the `Task` for perf reasons, and
  TLD is not currently as fast as it could be. For comparison, 100k prints goes
  from 59ms to 68ms (a 15% slowdown). This appeared to me to be an acceptable
  perf loss for the successful extraction of a librustrt crate.

* The `rtio` module was forced to duplicate more functionality of `std::io`. As
  the module no longer depends on `std::io`, `rtio` now defines structures such
  as socket addresses, addrinfo fiddly bits, etc. The primary change made was
  that `rtio` now defines its own `IoError` type. This type is distinct from
  `std::io::IoError` in that it does not have an enum for what error occurred,
  but rather a platform-specific error code.

  The native and green libraries will be updated in later commits for this
  change, and the bulk of this effort was put behind updating the two libraries
  for this change (with `rtio`).

* Printing a message on task failure (along with the backtrace) continues to
  live in libstd, not in librustrt. This is a consequence of the above decision
  to move the stdout/stderr handles to TLD rather than inside the `Task` itself.
  The unwinding API now supports registration of global callback functions which
  will be invoked when a task fails, allowing for libstd to register a function
  to print a message and a backtrace.

  The API for registering a callback is experimental and unsafe, as the
  ramifications of running code on unwinding is pretty hairy.

* The `std::unstable::mutex` module has moved to `std::rt::mutex`.

* The `std::unstable::sync` module has been moved to `std::rt::exclusive` and
  the type has been rewritten to not internally have an Arc and to have an RAII
  guard structure when locking. Old code should stop using `Exclusive` in favor
  of the primitives in `libsync`, but if necessary, old code should port to
  `Arc<Exclusive<T>>`.

* The local heap has been stripped down to have fewer debugging options. None of
  these were tested, and none of these have been used in a very long time.

[breaking-change]

10 years agortio: Remove usage of `Path`
Alex Crichton [Tue, 3 Jun 2014 05:11:19 +0000 (22:11 -0700)]
rtio: Remove usage of `Path`

The rtio interface is a thin low-level interface over the I/O subsystems, and
the `Path` type is a little too high-level for this interface.

10 years agortio: Remove unused stuct
Alex Crichton [Tue, 3 Jun 2014 05:10:38 +0000 (22:10 -0700)]
rtio: Remove unused stuct

10 years agoauto merge of #14712 : alexcrichton/rust/rollup, r=alexcrichton
bors [Sat, 7 Jun 2014 03:42:01 +0000 (20:42 -0700)]
auto merge of #14712 : alexcrichton/rust/rollup, r=alexcrichton

Closes #14675 (rustc: Encode argument names for traits)
Closes #14681 (rustc: Avoid UB with signed division/remainder)
Closes #14682 (librustc: Update AutoObject adjustment in writeback.)
Closes #14683 (Avoid 16-byte filenames in rlibs)
Closes #14687 (rustdoc: Inline static documentation across crates)
Closes #14689 (Remove reference to ~str in documentation)
Closes #14692 (Rename Iterator::len to count)
Closes #14693 (Implement Eq for HashSet and HashMap)
Closes #14699 (url: encode small bytes correctly.)
Closes #14700 (rustdoc: Submit examples to play.rust-lang.org)
Closes #14701 (mk: Run doc tests with --cfg dox)
Closes #14710 (rustc: Preserve reachable extern fns with LTO)
Closes #14711 (Removing unused wrapper to libc::close.)

10 years agoTest fixes from the rollup
Alex Crichton [Sat, 7 Jun 2014 03:17:19 +0000 (20:17 -0700)]
Test fixes from the rollup

10 years agorustdoc: Submit examples to play.rust-lang.org
Alex Crichton [Fri, 6 Jun 2014 16:12:18 +0000 (09:12 -0700)]
rustdoc: Submit examples to play.rust-lang.org

This grows a new option inside of rustdoc to add the ability to submit examples
to an external website. If the `--markdown-playground-url` command line option
or crate doc attribute `html_playground_url` is present, then examples will have
a button on hover to submit the code to the playground specified.

This commit enables submission of example code to play.rust-lang.org. The code
submitted is that which is tested by rustdoc, not necessarily the exact code
shown in the example.

Closes #14654

10 years agodoc: Turn off special features for rustdoc tests
Alex Crichton [Fri, 6 Jun 2014 06:01:01 +0000 (23:01 -0700)]
doc: Turn off special features for rustdoc tests

These were only used for the markdown tests, and there's no reason they should
be distinct from the other tests.

10 years agoRemoving unused wrapper to libc::close.
Axel Viala [Fri, 6 Jun 2014 22:43:45 +0000 (00:43 +0200)]
Removing unused wrapper to libc::close.

10 years agorustc: Preserve reachable extern fns with LTO
Alex Crichton [Sat, 7 Jun 2014 00:48:46 +0000 (17:48 -0700)]
rustc: Preserve reachable extern fns with LTO

All rust functions are internal implementation details with respect to the ABI
exposed by crates, but extern fns are public components of the ABI and shouldn't
be stripped. This commit serializes reachable extern fns to metadata, so when
LTO is performed all of their symbols are not stripped.

Closes #14500

10 years agomk: Run doc tests with --cfg dox
Alex Crichton [Fri, 6 Jun 2014 16:22:19 +0000 (09:22 -0700)]
mk: Run doc tests with --cfg dox

There were a few examples in the macros::builtin module that weren't being run
because they were being #[cfg]'d out.

Closes #14697

10 years agourl: encode small bytes correctly.
Huon Wilson [Fri, 6 Jun 2014 14:49:19 +0000 (00:49 +1000)]
url: encode small bytes correctly.

Previously, bytes less than 16 would be encoded as %X, rather than %XX,
since the output width was left to be automatic.

10 years agoImplement Eq for HashSet and HashMap
Steven Fackler [Fri, 6 Jun 2014 06:22:01 +0000 (23:22 -0700)]
Implement Eq for HashSet and HashMap

Also fix documentation references to PartialEq.

10 years agoRename Iterator::len to count
Aaron Turon [Fri, 6 Jun 2014 06:18:51 +0000 (23:18 -0700)]
Rename Iterator::len to count

This commit carries out the request from issue #14678:

> The method `Iterator::len()` is surprising, as all the other uses of
> `len()` do not consume the value. `len()` would make more sense to be
> called `count()`, but that would collide with the current
> `Iterator::count(|T| -> bool) -> unit` method. That method, however, is
> a bit redundant, and can be easily replaced with
> `iter.filter(|x| x < 5).count()`.
> After this change, we could then define the `len()` method
> on `iter::ExactSize`.

Closes #14678.

[breaking-change]