]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agounbreak openbsd build after 1860ee52
Sébastien Marie [Fri, 20 Feb 2015 10:00:24 +0000 (11:00 +0100)]
unbreak openbsd build after 1860ee52

The commit 1860ee52 has break the openbsd build.
Repair it.

9 years agoAuto merge of #22541 - Manishearth:rollup, r=Gankro
bors [Thu, 19 Feb 2015 18:36:59 +0000 (18:36 +0000)]
Auto merge of #22541 - Manishearth:rollup, r=Gankro

Continued from #22520

9 years agoRound 8 tex fixes
Manish Goregaokar [Thu, 19 Feb 2015 17:48:20 +0000 (23:18 +0530)]
Round 8 tex fixes

9 years agoMerge remote-tracking branch 'origin/master' into rollup
Alex Crichton [Thu, 19 Feb 2015 15:03:43 +0000 (07:03 -0800)]
Merge remote-tracking branch 'origin/master' into rollup

9 years agoRound 5 test fixes and rebase conflicts
Alex Crichton [Thu, 19 Feb 2015 02:02:58 +0000 (18:02 -0800)]
Round 5 test fixes and rebase conflicts

9 years agoAuto merge of #22517 - brson:relnotes, r=Gankro
bors [Thu, 19 Feb 2015 10:54:08 +0000 (10:54 +0000)]
Auto merge of #22517 - brson:relnotes, r=Gankro

p=1 please

9 years agoAuto merge of #22497 - nikomatsakis:suffixes, r=alexcrichton
bors [Thu, 19 Feb 2015 07:59:27 +0000 (07:59 +0000)]
Auto merge of #22497 - nikomatsakis:suffixes, r=alexcrichton

The old suffixes now issue warnings unless a feature-gate is given.

Fixes #22496.

r? @alexcrichton

9 years agoFix from niko for cfail tests
Alex Crichton [Thu, 19 Feb 2015 02:01:03 +0000 (18:01 -0800)]
Fix from niko for cfail tests

9 years agorollup merge of #22517: brson/relnotes
Alex Crichton [Thu, 19 Feb 2015 01:58:01 +0000 (17:58 -0800)]
rollup merge of #22517: brson/relnotes

p=1 please

9 years agoRound 4 test fixes and rebase conflicts
Alex Crichton [Thu, 19 Feb 2015 00:39:32 +0000 (16:39 -0800)]
Round 4 test fixes and rebase conflicts

9 years agoUpdate AUTHORS.txt and RELEASES.md
Brian Anderson [Thu, 19 Feb 2015 01:02:34 +0000 (17:02 -0800)]
Update AUTHORS.txt and RELEASES.md

9 years agoExempt phantom fns from the object safety check
Niko Matsakis [Thu, 19 Feb 2015 00:35:20 +0000 (19:35 -0500)]
Exempt phantom fns from the object safety check

9 years agoRound 3 test fixes and conflicts
Alex Crichton [Wed, 18 Feb 2015 23:58:07 +0000 (15:58 -0800)]
Round 3 test fixes and conflicts

9 years agoAuto merge of #22436 - nikomatsakis:issue-22246-bound-lifetimes-of-assoc-types, r...
bors [Wed, 18 Feb 2015 23:58:38 +0000 (23:58 +0000)]
Auto merge of #22436 - nikomatsakis:issue-22246-bound-lifetimes-of-assoc-types, r=nikomatsakis

Take 2. This PR includes a bunch of refactoring that was part of an experimental branch implementing [implied bounds]. That particular idea isn't ready to go yet, but the refactoring proved useful for fixing #22246. The implied bounds branch also exposed #22110 so a simple fix for that is included here. I still think some more refactoring would be a good idea here -- in particular I think most of the code in wf.rs is kind of duplicating the logic in implicator and should go, but I decided to post this PR and call it a day before diving into that. I'll write a bit more details about the solutions I adopted in the various bugs. I patched the two issues I was concerned about, which was the handling of supertraits and HRTB (the latter turned out to be fine, so I added a comment explaining why.)

r? @pnkfelix (for now, anyway)
cc @aturon

[implied bounds]: http://smallcultfollowing.com/babysteps/blog/2014/07/06/implied-bounds/

9 years agorollup merge of #22286: nikomatsakis/variance-4b
Alex Crichton [Wed, 18 Feb 2015 23:52:01 +0000 (15:52 -0800)]
rollup merge of #22286: nikomatsakis/variance-4b

Conflicts:
src/librustc/middle/infer/combine.rs
src/librustc_typeck/check/wf.rs

9 years agoRound 2 test fixes and conflicts
Alex Crichton [Wed, 18 Feb 2015 23:48:45 +0000 (15:48 -0800)]
Round 2 test fixes and conflicts

9 years agorollup merge of #22502: nikomatsakis/deprecate-bracket-bracket
Alex Crichton [Wed, 18 Feb 2015 23:48:40 +0000 (15:48 -0800)]
rollup merge of #22502: nikomatsakis/deprecate-bracket-bracket

Conflicts:
src/libcollections/slice.rs
src/libcollections/str.rs
src/librustc/middle/lang_items.rs
src/librustc_back/rpath.rs
src/librustc_typeck/check/regionck.rs
src/libstd/ffi/os_str.rs
src/libsyntax/diagnostic.rs
src/libsyntax/parse/parser.rs
src/libsyntax/util/interner.rs
src/test/run-pass/regions-refcell.rs

9 years agorollup merge of #22210: aturon/stab-final-borrow
Alex Crichton [Wed, 18 Feb 2015 23:34:32 +0000 (15:34 -0800)]
rollup merge of #22210: aturon/stab-final-borrow

Conflicts:
src/libcollections/btree/map.rs
src/libcollections/str.rs
src/libcollections/vec.rs
src/libcore/borrow.rs
src/libcore/hash/mod.rs
src/libstd/collections/hash/map.rs
src/libstd/collections/hash/set.rs

9 years agoRound 1 fixes and rebase conflicts
Alex Crichton [Wed, 18 Feb 2015 22:39:37 +0000 (14:39 -0800)]
Round 1 fixes and rebase conflicts

9 years agoStabilize std::borrow
Aaron Turon [Thu, 12 Feb 2015 07:16:32 +0000 (23:16 -0800)]
Stabilize std::borrow

This commit stabilizes `std::borrow`, making the following modifications
to catch up the API with language changes:

* It renames `BorrowFrom` to `Borrow`, as was originally intended (but
  blocked for technical reasons), and reorders the parameters
  accordingly.

* It moves the type parameter of `ToOwned` to an associated type. This
  is somewhat less flexible, in that each borrowed type must have a
  unique owned type, but leads to a significant simplification for
  `Cow`. Flexibility can be regained by using newtyped slices, which is
  advisable for other reasons anyway.

* It removes the owned type parameter from `Cow`, making the type much
  less verbose.

* Deprecates the `is_owned` and `is_borrowed` predicates in favor of
  direct matching.

The above API changes are relatively minor; the basic functionality
remains the same, and essentially the whole module is now marked
`#[stable]`.

[breaking-change]

9 years agoReplace all uses of `&foo[]` with `&foo[..]` en masse.
Niko Matsakis [Wed, 18 Feb 2015 19:48:57 +0000 (14:48 -0500)]
Replace all uses of `&foo[]` with `&foo[..]` en masse.

9 years agoDeclare `&foo[]` to be obsolete syntax. Modify the obsolete mechanism to
Niko Matsakis [Wed, 18 Feb 2015 19:47:14 +0000 (14:47 -0500)]
Declare `&foo[]` to be obsolete syntax. Modify the obsolete mechanism to
support warnings.

9 years agorollup merge of #22498: nagisa/style-fixes
Alex Crichton [Wed, 18 Feb 2015 22:35:03 +0000 (14:35 -0800)]
rollup merge of #22498: nagisa/style-fixes

9 years agorollup merge of #22497: nikomatsakis/suffixes
Alex Crichton [Wed, 18 Feb 2015 22:35:01 +0000 (14:35 -0800)]
rollup merge of #22497: nikomatsakis/suffixes

Conflicts:
src/librustc_trans/trans/tvec.rs

9 years agorollup merge of #22491: Gankro/into_iter
Alex Crichton [Wed, 18 Feb 2015 22:34:08 +0000 (14:34 -0800)]
rollup merge of #22491: Gankro/into_iter

Conflicts:
src/libcollections/bit.rs
src/libcollections/linked_list.rs
src/libcollections/vec_deque.rs
src/libstd/sys/common/wtf8.rs

9 years agorollup merge of #22485: pnkfelix/fsk-int-uint-audit
Alex Crichton [Wed, 18 Feb 2015 22:32:14 +0000 (14:32 -0800)]
rollup merge of #22485: pnkfelix/fsk-int-uint-audit

cc #22240

9 years agorollup merge of #22484: riginding/master
Alex Crichton [Wed, 18 Feb 2015 22:32:12 +0000 (14:32 -0800)]
rollup merge of #22484: riginding/master

9 years agorollup merge of #22482: alexcrichton/cstr-changes
Alex Crichton [Wed, 18 Feb 2015 22:32:10 +0000 (14:32 -0800)]
rollup merge of #22482: alexcrichton/cstr-changes

This commit is an implementation of [RFC 592][r592] and [RFC 840][r840]. These
two RFCs tweak the behavior of `CString` and add a new `CStr` unsized slice type
to the module.

[r592]: https://github.com/rust-lang/rfcs/blob/master/text/0592-c-str-deref.md
[r840]: https://github.com/rust-lang/rfcs/blob/master/text/0840-no-panic-in-c-string.md

The new `CStr` type is only constructable via two methods:

1. By `deref`'ing from a `CString`
2. Unsafely via `CStr::from_ptr`

The purpose of `CStr` is to be an unsized type which is a thin pointer to a
`libc::c_char` (currently it is a fat pointer slice due to implementation
limitations). Strings from C can be safely represented with a `CStr` and an
appropriate lifetime as well. Consumers of `&CString` should now consume `&CStr`
instead to allow producers to pass in C-originating strings instead of just
Rust-allocated strings.

A new constructor was added to `CString`, `new`, which takes `T: IntoBytes`
instead of separate `from_slice` and `from_vec` methods (both have been
deprecated in favor of `new`). The `new` method returns a `Result` instead of
panicking.  The error variant contains the relevant information about where the
error happened and bytes (if present). Conversions are provided to the
`io::Error` and `old_io::IoError` types via the `FromError` trait which
translate to `InvalidInput`.

This is a breaking change due to the modification of existing `#[unstable]` APIs
and new deprecation, and more detailed information can be found in the two RFCs.
Notable breakage includes:

* All construction of `CString` now needs to use `new` and handle the outgoing
  `Result`.
* Usage of `CString` as a byte slice now explicitly needs a `.as_bytes()` call.
* The `as_slice*` methods have been removed in favor of just having the
  `as_bytes*` methods.

Closes #22469
Closes #22470
[breaking-change]

9 years agorollup merge of #22480: alexcrichton/hashv3
Alex Crichton [Wed, 18 Feb 2015 22:32:03 +0000 (14:32 -0800)]
rollup merge of #22480: alexcrichton/hashv3

This commit is an implementation of [RFC 823][rfc] which is another pass over
the `std::hash` module for stabilization. The contents of the module were not
entirely marked stable, but some portions which remained quite similar to the
previous incarnation are now marked `#[stable]`. Specifically:

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0823-hash-simplification.md

* `std::hash` is now stable (the name)
* `Hash` is now stable
* `Hash::hash` is now stable
* `Hasher` is now stable
* `SipHasher` is now stable
* `SipHasher::new` and `new_with_keys` are now stable
* `Hasher for SipHasher` is now stable
* Many `Hash` implementations are now stable

All other portions of the `hash` module remain `#[unstable]` as they are less
commonly used and were recently redesigned.

This commit is a breaking change due to the modifications to the `std::hash` API
and more details can be found on the [RFC][rfc].

Closes #22467
[breaking-change]

9 years agorollup merge of #22452: nikomatsakis/issue-22040-18956-Self
Alex Crichton [Wed, 18 Feb 2015 22:32:02 +0000 (14:32 -0800)]
rollup merge of #22452: nikomatsakis/issue-22040-18956-Self

The big change here is that we update the object-safety rules to prohibit references to `Self` in the supertrait listing. See #22040 for the motivation. The other change is to handle the interaction of defaults that reference `Self` and object types (where `Self` is erased). We force users to give an explicit type in that scenario.

r? @aturon

9 years agorollup merge of #22438: dotdash/iter_vec_loop
Alex Crichton [Wed, 18 Feb 2015 22:32:01 +0000 (14:32 -0800)]
rollup merge of #22438: dotdash/iter_vec_loop

No need to create a bunch of blocks and a stack allocated temporary just
to build a simple loop.

9 years agorollup merge of #22437: dotdash/fix_array_type
Alex Crichton [Wed, 18 Feb 2015 22:31:59 +0000 (14:31 -0800)]
rollup merge of #22437: dotdash/fix_array_type

In trans_slice_vec we currently use arrayalloca, which gives us a
pointer to the element type with enough memory allocated for the
requested number of elements.  This works, but everywhere else we use
the [n x T] type for fixed size arrays and so we have to bitcast the
pointer here. Let's directly use the proper type for the allocation and
remove some code duplication along the way.

9 years agorollup merge of #22436: nikomatsakis/issue-22246-bound-lifetimes-of-assoc-types
Alex Crichton [Wed, 18 Feb 2015 22:31:58 +0000 (14:31 -0800)]
rollup merge of #22436: nikomatsakis/issue-22246-bound-lifetimes-of-assoc-types

Take 2. This PR includes a bunch of refactoring that was part of an experimental branch implementing [implied bounds]. That particular idea isn't ready to go yet, but the refactoring proved useful for fixing #22246. The implied bounds branch also exposed #22110 so a simple fix for that is included here. I still think some more refactoring would be a good idea here -- in particular I think most of the code in wf.rs is kind of duplicating the logic in implicator and should go, but I decided to post this PR and call it a day before diving into that. I'll write a bit more details about the solutions I adopted in the various bugs. I patched the two issues I was concerned about, which was the handling of supertraits and HRTB (the latter turned out to be fine, so I added a comment explaining why.)

r? @pnkfelix (for now, anyway)
cc @aturon

[implied bounds]: http://smallcultfollowing.com/babysteps/blog/2014/07/06/implied-bounds/

9 years agorollup merge of #22395: brson/readme-cleanup
Alex Crichton [Wed, 18 Feb 2015 22:31:57 +0000 (14:31 -0800)]
rollup merge of #22395: brson/readme-cleanup

Just a few things to make the README ever more perfect.

r? @steveklabnik

9 years agorollup merge of #22287: Ryman/purge_carthographers
Alex Crichton [Wed, 18 Feb 2015 22:31:55 +0000 (14:31 -0800)]
rollup merge of #22287: Ryman/purge_carthographers

This overlaps with #22276 (I left make check running overnight) but covers a number of additional cases and has a few rewrites where the clones are not even necessary.

This also implements `RandomAccessIterator` for `iter::Cloned`

cc @steveklabnik, you may want to glance at this before #22281 gets the bors treatment

9 years agoUpdate tests to use #[feature(rustc_attrs)]
Niko Matsakis [Wed, 18 Feb 2015 22:31:42 +0000 (17:31 -0500)]
Update tests to use #[feature(rustc_attrs)]

9 years agoMinor unused imports etc.
Niko Matsakis [Wed, 18 Feb 2015 22:31:26 +0000 (17:31 -0500)]
Minor unused imports etc.

9 years agorollup merge of #22118: fhahn/separate-parse-fail-2
Alex Crichton [Wed, 18 Feb 2015 22:31:23 +0000 (14:31 -0800)]
rollup merge of #22118: fhahn/separate-parse-fail-2

After making `rustc` fail on errors at a stop point, like `-Z parse-only`, in #22117, the files in this PR also fail during the parse stage and should be moved as well. Sorry for spliting this move up in two PRs.

9 years agorollup merge of #21886: dotdash/fast_slice_iter
Alex Crichton [Wed, 18 Feb 2015 22:31:21 +0000 (14:31 -0800)]
rollup merge of #21886: dotdash/fast_slice_iter

The data pointer used in the slice is never null, using assume() to tell
LLVM about it gets rid of various unneeded null checks when iterating
over the slice.

Since the snapshot compiler is still using an older LLVM version, omit
the call in stage0, because compile times explode otherwise.

Benchmarks from #18193
````
running 5 tests
test _range    ... bench:     33329 ns/iter (+/- 417)
test assembly  ... bench:     33299 ns/iter (+/- 58)
test enumerate ... bench:     33318 ns/iter (+/- 83)
test iter      ... bench:     33311 ns/iter (+/- 130)
test position  ... bench:     33300 ns/iter (+/- 47)

test result: ok. 0 passed; 0 failed; 0 ignored; 5 measured
````

Fixes #18193

9 years agoStabilize Send/Sync.
Niko Matsakis [Wed, 18 Feb 2015 22:30:14 +0000 (17:30 -0500)]
Stabilize Send/Sync.

9 years agoTry to write some basic docs.
Niko Matsakis [Wed, 18 Feb 2015 22:30:02 +0000 (17:30 -0500)]
Try to write some basic docs.

9 years agostd: Implement CString-related RFCs
Alex Crichton [Wed, 18 Feb 2015 06:47:40 +0000 (22:47 -0800)]
std: Implement CString-related RFCs

This commit is an implementation of [RFC 592][r592] and [RFC 840][r840]. These
two RFCs tweak the behavior of `CString` and add a new `CStr` unsized slice type
to the module.

[r592]: https://github.com/rust-lang/rfcs/blob/master/text/0592-c-str-deref.md
[r840]: https://github.com/rust-lang/rfcs/blob/master/text/0840-no-panic-in-c-string.md

The new `CStr` type is only constructable via two methods:

1. By `deref`'ing from a `CString`
2. Unsafely via `CStr::from_ptr`

The purpose of `CStr` is to be an unsized type which is a thin pointer to a
`libc::c_char` (currently it is a fat pointer slice due to implementation
limitations). Strings from C can be safely represented with a `CStr` and an
appropriate lifetime as well. Consumers of `&CString` should now consume `&CStr`
instead to allow producers to pass in C-originating strings instead of just
Rust-allocated strings.

A new constructor was added to `CString`, `new`, which takes `T: IntoBytes`
instead of separate `from_slice` and `from_vec` methods (both have been
deprecated in favor of `new`). The `new` method returns a `Result` instead of
panicking.  The error variant contains the relevant information about where the
error happened and bytes (if present). Conversions are provided to the
`io::Error` and `old_io::IoError` types via the `FromError` trait which
translate to `InvalidInput`.

This is a breaking change due to the modification of existing `#[unstable]` APIs
and new deprecation, and more detailed information can be found in the two RFCs.
Notable breakage includes:

* All construction of `CString` now needs to use `new` and handle the outgoing
  `Result`.
* Usage of `CString` as a byte slice now explicitly needs a `.as_bytes()` call.
* The `as_slice*` methods have been removed in favor of just having the
  `as_bytes*` methods.

Closes #22469
Closes #22470
[breaking-change]

9 years agoAdd deprecated versions of the old markers and integrate them back into the variance...
Niko Matsakis [Wed, 18 Feb 2015 22:14:27 +0000 (17:14 -0500)]
Add deprecated versions of the old markers and integrate them back into the variance analysis.

9 years agoRemove mention of wiki from README
Brian Anderson [Wed, 18 Feb 2015 21:48:46 +0000 (13:48 -0800)]
Remove mention of wiki from README

9 years agoAddress review feedback
Brian Anderson [Wed, 18 Feb 2015 21:46:20 +0000 (13:46 -0800)]
Address review feedback

9 years agoREADME: Simplify markdown
Brian Anderson [Mon, 16 Feb 2015 05:20:27 +0000 (21:20 -0800)]
README: Simplify markdown

9 years agoREADME: Add one sentence about what Rust is.
Brian Anderson [Mon, 16 Feb 2015 05:08:32 +0000 (21:08 -0800)]
README: Add one sentence about what Rust is.

Most people don't know what Rust is.

9 years agoREADME: Add a link to #rust
Brian Anderson [Mon, 16 Feb 2015 04:58:06 +0000 (20:58 -0800)]
README: Add a link to #rust

9 years agoREADME: Make the wiki links more useful.
Brian Anderson [Mon, 16 Feb 2015 04:46:21 +0000 (20:46 -0800)]
README: Make the wiki links more useful.

The page we want them to find is 'getting started developing'.

9 years agoREADME: Give a hint about how to build Cargo from source.
Brian Anderson [Mon, 16 Feb 2015 04:41:16 +0000 (20:41 -0800)]
README: Give a hint about how to build Cargo from source.

Just a hint.

9 years agoSimplify README by not talking about the source tarball option
Brian Anderson [Mon, 16 Feb 2015 04:20:25 +0000 (20:20 -0800)]
Simplify README by not talking about the source tarball option

I believe that few enough people build from source tarballs that
we don't have to talk about it explicitly.

9 years agoWIP -- improve documentation on the phantom traits
Niko Matsakis [Wed, 18 Feb 2015 21:38:39 +0000 (16:38 -0500)]
WIP -- improve documentation on the phantom traits

9 years agoAdd rustc_attrs feature to test.
Niko Matsakis [Wed, 18 Feb 2015 20:24:20 +0000 (15:24 -0500)]
Add rustc_attrs feature to test.

9 years agoAlways prefer where-clauses over impls in trait selection. Fixes #22110.
Niko Matsakis [Mon, 16 Feb 2015 11:57:38 +0000 (06:57 -0500)]
Always prefer where-clauses over impls in trait selection. Fixes #22110.

9 years agoExtend the implicator so it produces general obligations and also so
Niko Matsakis [Sat, 14 Feb 2015 00:52:55 +0000 (19:52 -0500)]
Extend the implicator so it produces general obligations and also so
that it produces "outlives" relations for associated types. Add
several tests relating to #22246.

9 years agotraits: break apart the "full normalization" code used for normalizing
Niko Matsakis [Sat, 14 Feb 2015 00:51:43 +0000 (19:51 -0500)]
traits: break apart the "full normalization" code used for normalizing
parameter environments so that it can be used elsewhere.

9 years agoMove `tcx` from `Typer` into `ClosureTyper`
Niko Matsakis [Fri, 13 Feb 2015 22:31:44 +0000 (17:31 -0500)]
Move `tcx` from `Typer` into `ClosureTyper`

9 years agoMisc. cleanup in regionck: Remove a one-variant enum for some reason.
Niko Matsakis [Fri, 13 Feb 2015 22:25:05 +0000 (17:25 -0500)]
Misc. cleanup in regionck: Remove a one-variant enum for some reason.

9 years agoReplace `assert_no_late_bound_regions` with
Niko Matsakis [Fri, 13 Feb 2015 22:23:45 +0000 (17:23 -0500)]
Replace `assert_no_late_bound_regions` with
`no_late_bound_regions().unwrap()`, which allows us to write code that
doesn't necessarily *fail* when there are higher-ranked trait bounds.

9 years agoRename various things to "implications"
Niko Matsakis [Wed, 4 Feb 2015 15:48:29 +0000 (10:48 -0500)]
Rename various things to "implications"

9 years agoRename regionmanip to implicator.
Niko Matsakis [Wed, 4 Feb 2015 15:33:56 +0000 (10:33 -0500)]
Rename regionmanip to implicator.

9 years agoFor now, accept the `i`, `u`, `is`, and `us` suffixes, but warn when
Niko Matsakis [Wed, 18 Feb 2015 19:13:38 +0000 (14:13 -0500)]
For now, accept the `i`, `u`, `is`, and `us` suffixes, but warn when
they are used without a feature-gate. This is both kinder to existing
code and should make it easier to land this PR, since we don't
have to catch EVERY SINGLE SUFFIX.

9 years agoFix inconsistent spacing of collapse all button
Simonas Kazlauskas [Wed, 18 Feb 2015 19:38:32 +0000 (21:38 +0200)]
Fix inconsistent spacing of collapse all button

9 years agoStyle all docblock links properly
Simonas Kazlauskas [Wed, 18 Feb 2015 19:37:48 +0000 (21:37 +0200)]
Style all docblock links properly

Fixes #22493

9 years agomake FromIterator use IntoIterator
Alexis [Wed, 18 Feb 2015 18:06:21 +0000 (13:06 -0500)]
make FromIterator use IntoIterator

This breaks all implementors of FromIterator, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument).

Users of FromIterator should be unaffected because Iterators are IntoIterator.

[breaking-change]

9 years agomake Extend use IntoIterator
Alexis [Wed, 18 Feb 2015 15:04:30 +0000 (10:04 -0500)]
make Extend use IntoIterator

This breaks all implementors of Extend, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument).

Users of Extend should be unaffected because Iterators are IntoIterator.

[breaking-change]

9 years agoImplement RFC 580
Aaron Turon [Wed, 18 Feb 2015 07:44:55 +0000 (23:44 -0800)]
Implement RFC 580

This commit implements RFC 580 by renaming:

* DList -> LinkedList
* Bitv -> BitVec
* BitvSet -> BitSet
* RingBuf -> VecDeque

More details are in [the
RFC](https://github.com/rust-lang/rfcs/pull/580)

[breaking-change]

9 years agostd: Stabilize the `hash` module
Alex Crichton [Wed, 18 Feb 2015 04:48:07 +0000 (20:48 -0800)]
std: Stabilize the `hash` module

This commit is an implementation of [RFC 823][rfc] which is another pass over
the `std::hash` module for stabilization. The contents of the module were not
entirely marked stable, but some portions which remained quite similar to the
previous incarnation are now marked `#[stable]`. Specifically:

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0823-hash-simplification.md

* `std::hash` is now stable (the name)
* `Hash` is now stable
* `Hash::hash` is now stable
* `Hasher` is now stable
* `SipHasher` is now stable
* `SipHasher::new` and `new_with_keys` are now stable
* `Hasher for SipHasher` is now stable
* Many `Hash` implementations are now stable

All other portions of the `hash` module remain `#[unstable]` as they are less
commonly used and were recently redesigned.

This commit is a breaking change due to the modifications to the `std::hash` API
and more details can be found on the [RFC][rfc].

Closes #22467
[breaking-change]

9 years agoMissing test.
Niko Matsakis [Wed, 18 Feb 2015 15:20:01 +0000 (10:20 -0500)]
Missing test.

9 years agoAdd regression test for #20533. Fixes #20533.
Niko Matsakis [Fri, 13 Feb 2015 17:49:03 +0000 (12:49 -0500)]
Add regression test for #20533. Fixes #20533.

9 years agoFallout: Accepter trait needs phantomdata. This seems like it should
Niko Matsakis [Thu, 12 Feb 2015 17:49:10 +0000 (12:49 -0500)]
Fallout: Accepter trait needs phantomdata. This seems like it should
be migrated to an associated type anyway.

9 years agoFallout: add phantomdata to hash
Niko Matsakis [Thu, 12 Feb 2015 17:46:40 +0000 (12:46 -0500)]
Fallout: add phantomdata to hash

9 years agoFallout: port hashmap to use Unique
Niko Matsakis [Thu, 12 Feb 2015 17:46:24 +0000 (12:46 -0500)]
Fallout: port hashmap to use Unique

9 years agoFallout: add phantomdata for 'a in path
Niko Matsakis [Thu, 12 Feb 2015 17:45:06 +0000 (12:45 -0500)]
Fallout: add phantomdata for 'a in path

9 years agoFallout: extend thread with phantomdata for `'a` lifetime
Niko Matsakis [Thu, 12 Feb 2015 17:44:06 +0000 (12:44 -0500)]
Fallout: extend thread with phantomdata for `'a` lifetime

9 years agoFallout: add phantom data to the type inferencer
Niko Matsakis [Thu, 12 Feb 2015 17:41:31 +0000 (12:41 -0500)]
Fallout: add phantom data to the type inferencer

9 years agoFallout: add phantom data to librand
Niko Matsakis [Thu, 12 Feb 2015 17:41:03 +0000 (12:41 -0500)]
Fallout: add phantom data to librand

9 years agoFallout: port libflate to new Unique API
Niko Matsakis [Thu, 12 Feb 2015 17:35:05 +0000 (12:35 -0500)]
Fallout: port libflate to new Unique API

9 years agoFallout: Port slice to use `PhantomData` instead of `ContravariantLifetime`
Niko Matsakis [Thu, 12 Feb 2015 17:34:04 +0000 (12:34 -0500)]
Fallout: Port slice to use `PhantomData` instead of `ContravariantLifetime`

9 years agoFallout: remove unused type and region parameters.
Niko Matsakis [Thu, 12 Feb 2015 17:32:37 +0000 (12:32 -0500)]
Fallout: remove unused type and region parameters.

9 years agoFallout: tests. As tests frequently elide things, lots of changes
Niko Matsakis [Thu, 12 Feb 2015 15:29:52 +0000 (10:29 -0500)]
Fallout: tests. As tests frequently elide things, lots of changes
here.  Some of this may have been poorly rebased, though I tried to be
careful and preserve the spirit of the test.

9 years agoFallout: docs, elided examples often elided too much.
Niko Matsakis [Thu, 12 Feb 2015 15:17:02 +0000 (10:17 -0500)]
Fallout: docs, elided examples often elided too much.

9 years agoFallout: iter, add markers or other changes such that all type parameters are used.
Niko Matsakis [Thu, 12 Feb 2015 15:47:38 +0000 (10:47 -0500)]
Fallout: iter, add markers or other changes such that all type parameters are used.

9 years agoFallout: AtomicPtr needs phantom data to indicate that it contains an unsafe pointer.
Niko Matsakis [Thu, 12 Feb 2015 15:47:02 +0000 (10:47 -0500)]
Fallout: AtomicPtr needs phantom data to indicate that it contains an unsafe pointer.

9 years agoFallout: arena needs to use phantomdata since invariantlifetime is gone
Niko Matsakis [Thu, 12 Feb 2015 15:39:32 +0000 (10:39 -0500)]
Fallout: arena needs to use phantomdata since invariantlifetime is gone

9 years agoFallout: RingBuf, use Unique.
Niko Matsakis [Thu, 12 Feb 2015 15:38:45 +0000 (10:38 -0500)]
Fallout: RingBuf, use Unique.

9 years agoFallout: EnumSet, add Marker.
Niko Matsakis [Thu, 12 Feb 2015 15:38:21 +0000 (10:38 -0500)]
Fallout: EnumSet, add Marker.

9 years agoFallout: port btree to use Unique, some markers.
Niko Matsakis [Thu, 12 Feb 2015 15:35:56 +0000 (10:35 -0500)]
Fallout: port btree to use Unique, some markers.

9 years agoFallout: btree. Rephrase invariant lifetime in terms of PhantomData.
Niko Matsakis [Thu, 12 Feb 2015 15:33:53 +0000 (10:33 -0500)]
Fallout: btree. Rephrase invariant lifetime in terms of PhantomData.

9 years agoFallout: Port Vec to use `Unique`
Niko Matsakis [Thu, 12 Feb 2015 15:30:39 +0000 (10:30 -0500)]
Fallout: Port Vec to use `Unique`

9 years agoConstrain operands to outlive the operation. Fixes #21422.
Niko Matsakis [Thu, 12 Feb 2015 17:48:54 +0000 (12:48 -0500)]
Constrain operands to outlive the operation. Fixes #21422.

9 years agoRewrite `Unique<T>` so that it is covariant in T, implies `NonZero` and ownership,
Niko Matsakis [Thu, 12 Feb 2015 15:33:21 +0000 (10:33 -0500)]
Rewrite `Unique<T>` so that it is covariant in T, implies `NonZero` and ownership,
and also follows the API of `NonZero` a bit more closely. More to do
here I think (including perhaps a new name).

9 years agoExtend coherence check to understand subtyping.
Niko Matsakis [Thu, 12 Feb 2015 17:42:02 +0000 (12:42 -0500)]
Extend coherence check to understand subtyping.

9 years agoReport errors for type parameters that are not constrained, either by
Niko Matsakis [Thu, 12 Feb 2015 17:48:01 +0000 (12:48 -0500)]
Report errors for type parameters that are not constrained, either by
variance or an associated type.

9 years agoIntroduce the new phantomdata/phantomfn markers and integrate them
Niko Matsakis [Thu, 12 Feb 2015 10:16:02 +0000 (05:16 -0500)]
Introduce the new phantomdata/phantomfn markers and integrate them
into variance inference; fix various bugs in variance inference
so that it considers the correct set of constraints; modify infer to
consider the results of variance inference for type arguments.

9 years agoFix remaining bench/debuginfo tests (and a few stragglers)
Niko Matsakis [Wed, 18 Feb 2015 14:05:34 +0000 (09:05 -0500)]
Fix remaining bench/debuginfo tests (and a few stragglers)

9 years agoUpdate suffixes en masse in tests using `perl -p -i -e`
Niko Matsakis [Wed, 18 Feb 2015 10:42:01 +0000 (05:42 -0500)]
Update suffixes en masse in tests using `perl -p -i -e`

9 years agoUpdate docs by dropping suffixes except where they served to instruct.
Niko Matsakis [Wed, 18 Feb 2015 10:40:38 +0000 (05:40 -0500)]
Update docs by dropping suffixes except where they served to instruct.

9 years agoTweak pretty printing.
Niko Matsakis [Tue, 17 Feb 2015 16:25:30 +0000 (11:25 -0500)]
Tweak pretty printing.

9 years agoConvert required suffixes into a use of `as`.
Niko Matsakis [Tue, 17 Feb 2015 14:48:01 +0000 (09:48 -0500)]
Convert required suffixes into a use of `as`.