]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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]

10 years agoRemove reference to ~str in documentation
fort [Fri, 6 Jun 2014 01:13:30 +0000 (18:13 -0700)]
Remove reference to ~str in documentation

10 years agorustdoc: Inline static documentation across crates
Alex Crichton [Fri, 6 Jun 2014 00:20:59 +0000 (17:20 -0700)]
rustdoc: Inline static documentation across crates

10 years agorustc: Avoid 16-byte filenames in rlibs
Alex Crichton [Thu, 5 Jun 2014 22:31:45 +0000 (15:31 -0700)]
rustc: Avoid 16-byte filenames in rlibs

In addition to avoiding 16-byte filenames with bytecode files, this commit also
avoids 16-byte filenames with object files pulled in from native libraries.

10 years agoAdd workaround for archive reading bug in LLDB.
Michael Woerister [Thu, 5 Jun 2014 08:24:34 +0000 (10:24 +0200)]
Add workaround for archive reading bug in LLDB.

LLDB contains a bug that makes it crash if an archive it reads
contains a file the name of which is exactly 16 bytes long. This
bug recently has made it impossible to debug Rust applications with
LLDB because some standard libraries triggered it indirectly:
For rlibs, rustc includes the LLVM bytecode in the archive, giving
it the extension ".bc.deflate". For liballoc (for example) this
results in the 16 character filename "alloc.bc.deflate", which is
bad.

This commit replaces the ".bc.deflate" suffix with
".bytecode.deflate" which itself is already longer than 16 bytes,
thus making sure that the bug won't be run into anymore.

The bug could still be run into with 14 character filenames because
then the .o files will trigger it. However, this is much more rare
and working around it would introduce more complexity than necessary
at the moment. It can always be done later on, if the need arises.

Fixes #14356.

10 years agolibrustc: Update AutoObject adjustment in writeback.
Luqman Aden [Thu, 5 Jun 2014 22:06:33 +0000 (18:06 -0400)]
librustc: Update AutoObject adjustment in writeback.

10 years agorustc: Avoid UB with signed division/remainder
Alex Crichton [Thu, 5 Jun 2014 19:23:34 +0000 (12:23 -0700)]
rustc: Avoid UB with signed division/remainder

Division and remainder by 0 are undefined behavior, and are detected at runtime.
This commit adds support for ensuring that MIN / -1 is also checked for at
runtime, as this would cause signed overflow, or undefined behvaior.

Closes #8460

10 years agorustc: Encode argument names for traits
Alex Crichton [Thu, 5 Jun 2014 17:07:19 +0000 (10:07 -0700)]
rustc: Encode argument names for traits

This ensures that rustdoc can properly document inlined traits across crates.

Closes #14670

10 years agoauto merge of #14702 : nikomatsakis/rust/issue-5527-namespace-substs-b, r=pnkfelix
bors [Sat, 7 Jun 2014 00:02:00 +0000 (17:02 -0700)]
auto merge of #14702 : nikomatsakis/rust/issue-5527-namespace-substs-b, r=pnkfelix

Separate out initial refactorings for PR #14604

10 years agoFix resolve to not permit refs to type vars from outer fns
Niko Matsakis [Sat, 31 May 2014 05:54:04 +0000 (01:54 -0400)]
Fix resolve to not permit refs to type vars from outer fns
(Fixes #14603)

10 years agoAdd missing test case for contravariant trait matching
Niko Matsakis [Sat, 31 May 2014 22:48:20 +0000 (18:48 -0400)]
Add missing test case for contravariant trait matching

10 years agoStop passing around Option<&substs> in trans and just pass &substs, making the code...
Niko Matsakis [Thu, 15 May 2014 00:53:48 +0000 (20:53 -0400)]
Stop passing around Option<&substs> in trans and just pass &substs, making the code more regular

10 years agoMove Def out of syntax crate, where it does not belong
Niko Matsakis [Wed, 14 May 2014 19:31:30 +0000 (15:31 -0400)]
Move Def out of syntax crate, where it does not belong

10 years agoSimplify MonoId not to include parameters which, given coherence, are purely derived
Niko Matsakis [Tue, 13 May 2014 15:49:06 +0000 (11:49 -0400)]
Simplify MonoId not to include parameters which, given coherence, are purely derived

10 years agoMove subst data structures into subst.rs, fix capitalization
Niko Matsakis [Tue, 13 May 2014 15:35:42 +0000 (11:35 -0400)]
Move subst data structures into subst.rs, fix capitalization

10 years agoauto merge of #14680 : Kimundi/rust/master, r=brson
bors [Fri, 6 Jun 2014 22:21:59 +0000 (15:21 -0700)]
auto merge of #14680 : Kimundi/rust/master, r=brson

Also updated/corrected a few other details in the tuple and struct sections.

10 years agoMake sync::raw::Sem use Unsafe to manage mutability instead of transmuting an unsafe...
Jonathan S [Fri, 6 Jun 2014 20:24:14 +0000 (15:24 -0500)]
Make sync::raw::Sem use Unsafe to manage mutability instead of transmuting an unsafe pointer

10 years agoauto merge of #14318 : zwarich/rust/check-loans-refactor, r=nikomatsakis
bors [Fri, 6 Jun 2014 19:17:10 +0000 (12:17 -0700)]
auto merge of #14318 : zwarich/rust/check-loans-refactor, r=nikomatsakis

I tried to split up the less mechanical changes into separate commits so they are easier to review. One thing I'm not quite sure of is whether `MoveReason` should just be replaced with `move_data::MoveKind`.

10 years agoAdd a test for borrowck errors with multiple closure captures.
Cameron Zwarich [Fri, 6 Jun 2014 18:59:33 +0000 (11:59 -0700)]
Add a test for borrowck errors with multiple closure captures.

When converting check_loans to use ExprUseVisitor I encountered a few
issues where the wrong number of errors were being emitted for multiple
closure captures, but there is no existing test for this.

10 years agoAdd new tests for borrowck field-sensitivity.
Cameron Zwarich [Fri, 6 Jun 2014 18:59:33 +0000 (11:59 -0700)]
Add new tests for borrowck field-sensitivity.

10 years agoChange check_loans to use ExprUseVisitor.
Cameron Zwarich [Fri, 6 Jun 2014 18:59:33 +0000 (11:59 -0700)]
Change check_loans to use ExprUseVisitor.

10 years agoAdd a kind_of_move_of_path method to FlowedMoveData.
Cameron Zwarich [Fri, 6 Jun 2014 18:59:33 +0000 (11:59 -0700)]
Add a kind_of_move_of_path method to FlowedMoveData.

10 years agoUse the MoveReason to determine a more precise MoveKind in gather_moves.
Cameron Zwarich [Fri, 6 Jun 2014 18:59:33 +0000 (11:59 -0700)]
Use the MoveReason to determine a more precise MoveKind in gather_moves.

10 years agoAdd a move reason to the Move ConsumeMode.
Cameron Zwarich [Fri, 6 Jun 2014 18:59:33 +0000 (11:59 -0700)]
Add a move reason to the Move ConsumeMode.

Currently it is not possible to distinguish moves caused by captures
in the ExprUseVisitor interface. Since check_Loans needs to make that
distinction for generating good diagnostics, this is necessary for
check_loans to switch to ExprUseVisitor.

10 years agoAdd an Init mode to MutateMode.
Cameron Zwarich [Fri, 6 Jun 2014 18:59:32 +0000 (11:59 -0700)]
Add an Init mode to MutateMode.

This isn't necessary right now, but check_loans needs to be able to
distinguish between initialization and writes in the ExprUseVisitor
mutate callback.

10 years agoFix mem_categorization to treat an AutoObject adjustment as an rvalue.
Cameron Zwarich [Fri, 6 Jun 2014 18:59:32 +0000 (11:59 -0700)]
Fix mem_categorization to treat an AutoObject adjustment as an rvalue.

Currently mem_categorization categorizes an AutoObject adjustment the
same as the original expression. This can cause two moves to be
generated for the same underlying expression. Currently this isn't a
problem in practice, since check_loans doesn't rely on ExprUseVisitor.

10 years agoClean up check_loans.
Cameron Zwarich [Fri, 6 Jun 2014 18:59:32 +0000 (11:59 -0700)]
Clean up check_loans.

Refactor a number of functions in check_loans to take node IDs and spans
rather than taking expressions directly. Also rename some variables to
make them less ambiguous.

This is the first step towards using ExprUseVisitor in check_loans, as
now some of the interfaces more closely match those used in
ExprUseVisitor.