]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoUpdate tests to use `?Sized`
Nick Cameron [Wed, 24 Dec 2014 07:05:30 +0000 (20:05 +1300)]
Update tests to use `?Sized`

9 years agoAccept `?Sized` as well as `Sized?`
Nick Cameron [Wed, 24 Dec 2014 06:38:10 +0000 (19:38 +1300)]
Accept `?Sized` as well as `Sized?`

Includes a bit of refactoring to store `?` unbounds as bounds with a modifier, rather than in their own world, in the AST at least.

9 years agoauto merge of #20180 : jroesch/rust/clean-where-predicate, r=alexcrichton
bors [Thu, 25 Dec 2014 18:01:36 +0000 (18:01 +0000)]
auto merge of #20180 : jroesch/rust/clean-where-predicate, r=alexcrichton

Add support for all variants of ast::WherePredicate in clean/mod.rs. Fixes #20048, but will need modification when EqualityPredicates are fully implemented in #20041.

9 years agoauto merge of #20167 : michaelwoerister/rust/for-loop-var, r=alexcrichton
bors [Thu, 25 Dec 2014 14:21:47 +0000 (14:21 +0000)]
auto merge of #20167 : michaelwoerister/rust/for-loop-var, r=alexcrichton

... really this time `:)`

I went for the simpler fix after all since it turned out to become a bit too complicated to extract the current iteration value from its containing `Option` with the different memory layouts it can have. It's also what we already do for match bindings.

I also extended the new test case to include the "simple identifier" case.

Fixes #20127, fixes #19732

9 years agoauto merge of #20024 : mneumann/rust/dragonfly-fixes3, r=alexcrichton
bors [Thu, 25 Dec 2014 05:11:36 +0000 (05:11 +0000)]
auto merge of #20024 : mneumann/rust/dragonfly-fixes3, r=alexcrichton

9 years agoauto merge of #19934 : tomjakubowski/rust/rustdoc-unboxed-closures-redux, r=alexcrichton
bors [Thu, 25 Dec 2014 01:01:42 +0000 (01:01 +0000)]
auto merge of #19934 : tomjakubowski/rust/rustdoc-unboxed-closures-redux, r=alexcrichton

We render HRTB and the unboxed closure trait sugar (the so-called
"parenthesized" notation) where appropriate. Also address the new
`for` syntax on the old closures.

9 years agoauto merge of #20117 : lfairy/rust/rename-include-bin, r=alexcrichton
bors [Wed, 24 Dec 2014 20:47:12 +0000 (20:47 +0000)]
auto merge of #20117 : lfairy/rust/rename-include-bin, r=alexcrichton

According to [RFC 344][], methods that return `&[u8]` should have names ending in `bytes`. Though `include_bin!` is a macro not a method, it seems reasonable to follow the convention anyway.

We keep the old name around for now, but trigger a deprecation warning when it is used.

[RFC 344]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md

[breaking-change]

9 years agoauto merge of #19813 : barosl/rust/autoderef-type-inference-ice, r=pnkfelix
bors [Wed, 24 Dec 2014 18:37:07 +0000 (18:37 +0000)]
auto merge of #19813 : barosl/rust/autoderef-type-inference-ice, r=pnkfelix

`check::autoderef()` returns a `ty_err` when it fails to infer the type. `probe::probe()` should respect this failure and fail together to prevent further corruption.

Fixes #19692.
Fixes #19583.
Fixes #19297.

9 years agorustdoc: Use Fn trait sugar for external paths
Tom Jakubowski [Wed, 17 Dec 2014 10:39:10 +0000 (02:39 -0800)]
rustdoc: Use Fn trait sugar for external paths

Fix #19909

9 years agorustdoc: Use unboxed closure sugar
Tom Jakubowski [Tue, 16 Dec 2014 20:40:43 +0000 (12:40 -0800)]
rustdoc: Use unboxed closure sugar

This unfortunately leaves sugaring Fn/FnMut/FnOnce on cross-crate
re-exports for future work.

cc #19909

9 years agorustdoc: render higher-rank trait bounds
Tom Jakubowski [Tue, 16 Dec 2014 16:50:52 +0000 (08:50 -0800)]
rustdoc: render higher-rank trait bounds

Fix #19915

9 years agorustdoc: render `for<>` on old closure lifetimes
Tom Jakubowski [Tue, 16 Dec 2014 14:32:52 +0000 (06:32 -0800)]
rustdoc: render `for<>` on old closure lifetimes

9 years agoauto merge of #20060 : Aatch/rust/enum-repr, r=alexcrichton
bors [Wed, 24 Dec 2014 16:21:23 +0000 (16:21 +0000)]
auto merge of #20060 : Aatch/rust/enum-repr, r=alexcrichton

The previous behaviour of using the smallest type possible caused LLVM
to treat padding too conservatively, causing poor codegen. This commit
changes the behaviour to use an alignment-sized integer as the
discriminant. This keeps types the same size, but helps LLVM understand
the data structure a little better, resulting in better codegen.

9 years agoAddress code review nits
Jared Roesch [Wed, 24 Dec 2014 08:58:21 +0000 (00:58 -0800)]
Address code review nits

9 years agoauto merge of #19858 : nick29581/rust/ranges, r=aturon
bors [Wed, 24 Dec 2014 06:31:13 +0000 (06:31 +0000)]
auto merge of #19858 : nick29581/rust/ranges, r=aturon

Closes #19794

r? @aturon for the first patch
r? @nikomatsakis for the rest

9 years agoauto merge of #19758 : tbu-/rust/pr_fp_name, r=alexcrichton
bors [Tue, 23 Dec 2014 22:21:10 +0000 (22:21 +0000)]
auto merge of #19758 : tbu-/rust/pr_fp_name, r=alexcrichton

This is a [breaking-change].

9 years agoSupport all variants of WherePredicate
Jared Roesch [Tue, 23 Dec 2014 09:08:00 +0000 (01:08 -0800)]
Support all variants of WherePredicate

Adds support for all variants of ast::WherePredicate in clean/mod.rs. Fixes #20048, but will need modification when EqualityPredicates are fully implemented in #20041.

9 years agoReview changes
Nick Cameron [Tue, 16 Dec 2014 03:25:33 +0000 (16:25 +1300)]
Review changes

9 years agoTests
Nick Cameron [Mon, 15 Dec 2014 01:23:00 +0000 (14:23 +1300)]
Tests

9 years agoType checking and trans for ranges
Nick Cameron [Mon, 15 Dec 2014 00:17:11 +0000 (13:17 +1300)]
Type checking and trans for ranges

9 years agoAdd syntax for ranges
Nick Cameron [Sat, 13 Dec 2014 05:41:02 +0000 (18:41 +1300)]
Add syntax for ranges

9 years agoAdd lang items for ranges.
Nick Cameron [Sat, 13 Dec 2014 04:19:54 +0000 (17:19 +1300)]
Add lang items for ranges.

9 years agoAdd structs for ranges to core::ops.
Nick Cameron [Sat, 13 Dec 2014 03:58:48 +0000 (16:58 +1300)]
Add structs for ranges to core::ops.

9 years agoauto merge of #20083 : eddyb/rust/fix-expectation, r=nikomatsakis
bors [Tue, 23 Dec 2014 18:01:22 +0000 (18:01 +0000)]
auto merge of #20083 : eddyb/rust/fix-expectation, r=nikomatsakis

This fixes a few corner cases with expected type propagation, e.g.:
```rust
fn take_int_slice(_: &[int]) {}
take_int_slice(&if 1 < 0 { [ 0, 1 ] } else { [ 0, 1 ] });
```
```rust
<anon>:2:28: 2:36 error: mismatched types: expected `[int]`, found `[int, ..2]`
<anon>:2 take_int_slice(&if 1 < 0 { [ 0, 1 ] } else { [ 0, 1 ] });
                                    ^~~~~~~~
<anon>:2:46: 2:54 error: mismatched types: expected `[int]`, found `[int, ..2]`
<anon>:2 take_int_slice(&if 1 < 0 { [ 0, 1 ] } else { [ 0, 1 ] });
                                                      ^~~~~~~~
```
Right now we unpack the expected `&[int]` and pass down `[int]`, forcing
rvalue expressions to take unsized types, which causes mismatch errors.
Instead, I replaced that expectation with a weaker hint, for the unsized
cases - a hint is still required to infer the integer literals' types, above.

Fixes #20169.

9 years agoRename and namespace `FPCategory`
Tobias Bucher [Mon, 22 Dec 2014 21:50:57 +0000 (22:50 +0100)]
Rename and namespace `FPCategory`

Rename `FPCategory` to `FpCategory` and `Fp* to `*` in order to adhere to the
naming convention

This is a [breaking-change].

Existing code like this:
```
use std::num::{FPCategory, FPNaN};
```
should be adjusted to this:
```
use std::num::FpCategory as Fp
```

In the following code you can use the constants `Fp::Nan`, `Fp::Normal`, etc.

9 years agorustc_typeck: don't expect rvalues to have unsized types.
Eduard Burtescu [Tue, 23 Dec 2014 11:30:36 +0000 (13:30 +0200)]
rustc_typeck: don't expect rvalues to have unsized types.

9 years agodebuginfo: Add test case for destructured for-loop variable.
Michael Woerister [Fri, 19 Dec 2014 11:46:04 +0000 (12:46 +0100)]
debuginfo: Add test case for destructured for-loop variable.

9 years agodebuginfo: Clean the debuginfo module up a bit.
Michael Woerister [Fri, 19 Dec 2014 10:37:49 +0000 (11:37 +0100)]
debuginfo: Clean the debuginfo module up a bit.

9 years agodebuginfo: Create debuginfo for for-loop variables again.
Michael Woerister [Fri, 19 Dec 2014 08:48:28 +0000 (09:48 +0100)]
debuginfo: Create debuginfo for for-loop variables again.

9 years agoMerge pull request #20155 from tbu-/pr_vecmap_fiximpls
bors [Tue, 23 Dec 2014 09:31:26 +0000 (09:31 +0000)]
Merge pull request #20155 from tbu-/pr_vecmap_fiximpls

Fix `collections::VecMap`'s `PartialEq` implementation

Reviewed-by: Gankro
9 years agoMerge pull request #20153 from brianloveswords/patch-1
bors [Tue, 23 Dec 2014 09:31:26 +0000 (09:31 +0000)]
Merge pull request #20153 from brianloveswords/patch-1

Update complement-bugreport.md

Reviewed-by: alexcrichton
9 years agoMerge pull request #20001 from huonw/speeling2
bors [Tue, 23 Dec 2014 09:31:25 +0000 (09:31 +0000)]
Merge pull request #20001 from huonw/speeling2

Fix some spelling errors.

Reviewed-by: nick29581
9 years agoMerge pull request #19886 from brson/rustup
bors [Tue, 23 Dec 2014 09:31:25 +0000 (09:31 +0000)]
Merge pull request #19886 from brson/rustup

rustup: Don't do verbose tarball extraction

Reviewed-by: alexcrichton
9 years agoRename include_bin! to include_bytes!
Chris Wong [Sun, 21 Dec 2014 21:57:09 +0000 (10:57 +1300)]
Rename include_bin! to include_bytes!

According to [RFC 344][], methods that return `&[u8]` should have names
ending in `bytes`. Though `include_bin!` is a macro not a method, it
seems reasonable to follow the convention anyway.

We keep the old name around for now, but trigger a deprecation warning
when it is used.

[RFC 344]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md

[breaking-change]

9 years agoMake alignment-forcing case work the same on 64 and 32-bit platforms
James Miller [Tue, 23 Dec 2014 07:40:11 +0000 (20:40 +1300)]
Make alignment-forcing case work the same on 64 and 32-bit platforms

9 years agoFix some spelling errors.
Huon Wilson [Thu, 18 Dec 2014 23:10:37 +0000 (15:10 -0800)]
Fix some spelling errors.

9 years agoauto merge of #20145 : alexcrichton/rust/rollup, r=alexcrichton
bors [Tue, 23 Dec 2014 02:41:48 +0000 (02:41 +0000)]
auto merge of #20145 : alexcrichton/rust/rollup, r=alexcrichton

9 years agoFix `collections::VecMap`'s `PartialEq` implementation
Tobias Bucher [Tue, 23 Dec 2014 00:49:33 +0000 (01:49 +0100)]
Fix `collections::VecMap`'s `PartialEq` implementation

Previously it took capacity into account.

Additionally remove the `ne` implementation of `RingBuf` which is the default
one anyway.

9 years agoUpdate complement-bugreport.md
Brian J Brennan [Tue, 23 Dec 2014 00:43:57 +0000 (19:43 -0500)]
Update complement-bugreport.md

`--version=verbose` doesn't exist anymore, `--version --verbose` is the way to do that now.

9 years agoAdd enum size cases to type-sizes test
James Miller [Sat, 20 Dec 2014 10:00:50 +0000 (23:00 +1300)]
Add enum size cases to type-sizes test

9 years agoUse type-alignment-sized integer for discriminant types
James Miller [Sat, 20 Dec 2014 05:53:37 +0000 (18:53 +1300)]
Use type-alignment-sized integer for discriminant types

The previous behaviour of using the smallest type possible caused LLVM
to treat padding too conservatively, causing poor codegen. This commit
changes the behaviour to use an type-alignment-sized integer as the
discriminant. This keeps types the same size, but helps LLVM understand
the data structure a little better, resulting in better codegen.

9 years agoTest fixes and rebase conflicts
Alex Crichton [Mon, 22 Dec 2014 20:56:18 +0000 (12:56 -0800)]
Test fixes and rebase conflicts

9 years agorollup merge of #20089: rolftimmermans/json-control-chars-escape
Alex Crichton [Mon, 22 Dec 2014 20:54:32 +0000 (12:54 -0800)]
rollup merge of #20089: rolftimmermans/json-control-chars-escape

Conflicts:
src/libserialize/json.rs

9 years agorollup merge of #19964: pnkfelix/everybody-loops-pprint
Alex Crichton [Mon, 22 Dec 2014 20:53:23 +0000 (12:53 -0800)]
rollup merge of #19964: pnkfelix/everybody-loops-pprint

Conflicts:
src/librustc/session/config.rs
src/librustc_driver/lib.rs
src/librustc_driver/pretty.rs

9 years agorollup merge of #19891: nikomatsakis/unique-fn-types-3
Alex Crichton [Mon, 22 Dec 2014 20:51:23 +0000 (12:51 -0800)]
rollup merge of #19891: nikomatsakis/unique-fn-types-3

Conflicts:
src/libcore/str.rs
src/librustc_trans/trans/closure.rs
src/librustc_typeck/collect.rs
src/libstd/path/posix.rs
src/libstd/path/windows.rs

9 years agorollup merge of #20056: MrFloya/iter_rename
Alex Crichton [Mon, 22 Dec 2014 20:49:57 +0000 (12:49 -0800)]
rollup merge of #20056: MrFloya/iter_rename

Conflicts:
src/libcollections/bit.rs
src/libcore/str.rs

9 years agorollup merge of #20141: frewsxcv/rfc438
Alex Crichton [Mon, 22 Dec 2014 20:48:19 +0000 (12:48 -0800)]
rollup merge of #20141: frewsxcv/rfc438

RFC 248? I think you meant RFC 438.

There ain’t an RFC 248, while 438 looks to be what is being referred to:
https://github.com/rust-lang/rfcs/blob/master/text/0438-precedence-of-plus.md

--------------

Chis Morgan has a pretty important documentation fix in #19385 and he hasn't responded in a while to that pull request so I rebased it for him

Closes #19385

9 years agorollup merge of #20140: frewsxcv/rm-reexports
Alex Crichton [Mon, 22 Dec 2014 20:48:16 +0000 (12:48 -0800)]
rollup merge of #20140: frewsxcv/rm-reexports

Part of #19253

I would have removed this public reexport in #19842, but #19812 hadn't merged (and snapshotted) at the time

In #19407, I changed the codebase to stop utilizing this reexport

[breaking-change]

9 years agorollup merge of #20135: selaine/less-asm
Alex Crichton [Mon, 22 Dec 2014 20:48:13 +0000 (12:48 -0800)]
rollup merge of #20135: selaine/less-asm

r? @alexcrichton

9 years agorollup merge of #20134: jbranchaud/add-doctest-for-btreemap-entry
Alex Crichton [Mon, 22 Dec 2014 20:48:12 +0000 (12:48 -0800)]
rollup merge of #20134: jbranchaud/add-doctest-for-btreemap-entry

This is an updated version of #19711. The merge and subsequent rebase on that branch were more trouble than they were worth, so I am just resubmitting the relevant change here.

If this PR is accepted, then #19711 can be closed.

/cc @Gankro

9 years agorollup merge of #20129: nagisa/man-fixes
Alex Crichton [Mon, 22 Dec 2014 20:48:10 +0000 (12:48 -0800)]
rollup merge of #20129: nagisa/man-fixes

This pull request updates the rustc manual page to represent current state of rustc option handling better. Moved the apparently deprecated options (#19900) to their own section and added all the new codegen options.

A bit unrelatedly, I also updated description of `-O` and `-g` flags to point to the new codegen options rather than old, deprecated ones.

Fixes #20111.

9 years agorollup merge of #20125: csouth3/hashset-bitops
Alex Crichton [Mon, 22 Dec 2014 20:48:09 +0000 (12:48 -0800)]
rollup merge of #20125: csouth3/hashset-bitops

Now that #19448 has landed in a snapshot, we can add proper by-value operator overloads for `HashSet`.  The behavior of these operator overloads is consistent with rust-lang/rfcs#235.

9 years agorollup merge of #20124: klutzy/pprust-asm
Alex Crichton [Mon, 22 Dec 2014 20:48:07 +0000 (12:48 -0800)]
rollup merge of #20124: klutzy/pprust-asm

9 years agorollup merge of #20102: tshepang/patch-4
Alex Crichton [Mon, 22 Dec 2014 20:47:52 +0000 (12:47 -0800)]
rollup merge of #20102: tshepang/patch-4

That sentence made it look like there was no option for using 'mut'

9 years agorollup merge of #20084: barosl/struct-variant-field-err
Alex Crichton [Mon, 22 Dec 2014 20:47:34 +0000 (12:47 -0800)]
rollup merge of #20084: barosl/struct-variant-field-err

Fixes #19922.

9 years agorollup merge of #20075: skade/remove-notrust
Alex Crichton [Mon, 22 Dec 2014 20:47:31 +0000 (12:47 -0800)]
rollup merge of #20075: skade/remove-notrust

Internally refactor all mentions of `notrust` to the
positive statement `rust`.

[breaking-change] Change remaining `notrust` markers to
the thing they actually represent, e.g. `sh` or `plain`.

This supersedes #19693 .

9 years agorollup merge of #20053: csouth3/misc-stab
Alex Crichton [Mon, 22 Dec 2014 20:47:11 +0000 (12:47 -0800)]
rollup merge of #20053: csouth3/misc-stab

This pull request:

*Renames `BinaryHeap::top` to `BinaryHeap::peek`
*Stabilizes `front/back/front_mut/back_mut` in `DList` and `RingBuf`
*Stabilizes `swap` in `RingBuf`

in accordance with rust-lang/rfcs#509.

Note that this PR does not address `Bitv::{get,set}` or HashMap's iterators, nor does it move `std::vec` to `std::collections::vec`, all of which still need to be done.

Because of the method renaming, this is a [breaking-change].

9 years agorollup merge of #20033: alexcrichton/deprecate-serialise
Alex Crichton [Mon, 22 Dec 2014 20:46:31 +0000 (12:46 -0800)]
rollup merge of #20033: alexcrichton/deprecate-serialise

This commit completes the deprecation story for the in-tree serialization
library. The compiler will now emit a warning whenever it encounters
`deriving(Encodable)` or `deriving(Decodable)`, and the library itself is now
marked `#[unstable]` for when feature staging is enabled.

All users of serialization can migrate to the `rustc-serialize` crate on
crates.io which provides the exact same interface as the libserialize library
in-tree. The new deriving modes are named `RustcEncodable` and `RustcDecodable`
and require `extern crate "rustc-serialize" as rustc_serialize` at the crate
root in order to expand correctly.

To migrate all crates, add the following to your `Cargo.toml`:

    [dependencies]
    rustc-serialize = "0.1.1"

And then add the following to your crate root:

    extern crate "rustc-serialize" as rustc_serialize;

Finally, rename `Encodable` and `Decodable` deriving modes to `RustcEncodable`
and `RustcDecodable`.

[breaking-change]

9 years agorollup merge of #19741: alexcrichton/stabilize-str
Alex Crichton [Mon, 22 Dec 2014 20:45:54 +0000 (12:45 -0800)]
rollup merge of #19741: alexcrichton/stabilize-str

This commit starts out by consolidating all `str` extension traits into one
`StrExt` trait to be included in the prelude. This means that
`UnicodeStrPrelude`, `StrPrelude`, and `StrAllocating` have all been merged into
one `StrExt` exported by the standard library. Some functionality is currently
duplicated with the `StrExt` present in libcore.

This commit also currently avoids any methods which require any form of pattern
to operate. These functions will be stabilized via a separate RFC.

Next, stability of methods and structures are as follows:

Stable

* from_utf8_unchecked
* CowString - after moving to std::string
* StrExt::as_bytes
* StrExt::as_ptr
* StrExt::bytes/Bytes - also made a struct instead of a typedef
* StrExt::char_indices/CharIndices - CharOffsets was renamed
* StrExt::chars/Chars
* StrExt::is_empty
* StrExt::len
* StrExt::lines/Lines
* StrExt::lines_any/LinesAny
* StrExt::slice_unchecked
* StrExt::trim
* StrExt::trim_left
* StrExt::trim_right
* StrExt::words/Words - also made a struct instead of a typedef

Unstable

* from_utf8 - the error type was changed to a `Result`, but the error type has
              yet to prove itself
* from_c_str - this function will be handled by the c_str RFC
* FromStr - this trait will have an associated error type eventually
* StrExt::escape_default - needs iterators at least, unsure if it should make
                           the cut
* StrExt::escape_unicode - needs iterators at least, unsure if it should make
                           the cut
* StrExt::slice_chars - this function has yet to prove itself
* StrExt::slice_shift_char - awaiting conventions about slicing and shifting
* StrExt::graphemes/Graphemes - this functionality may only be in libunicode
* StrExt::grapheme_indices/GraphemeIndices - this functionality may only be in
                                             libunicode
* StrExt::width - this functionality may only be in libunicode
* StrExt::utf16_units - this functionality may only be in libunicode
* StrExt::nfd_chars - this functionality may only be in libunicode
* StrExt::nfkd_chars - this functionality may only be in libunicode
* StrExt::nfc_chars - this functionality may only be in libunicode
* StrExt::nfkc_chars - this functionality may only be in libunicode
* StrExt::is_char_boundary - naming is uncertain with container conventions
* StrExt::char_range_at - naming is uncertain with container conventions
* StrExt::char_range_at_reverse - naming is uncertain with container conventions
* StrExt::char_at - naming is uncertain with container conventions
* StrExt::char_at_reverse - naming is uncertain with container conventions
* StrVector::concat - this functionality may be replaced with iterators, but
                      it's not certain at this time
* StrVector::connect - as with concat, may be deprecated in favor of iterators

Deprecated

* StrAllocating and UnicodeStrPrelude have been merged into StrExit
* eq_slice - compiler implementation detail
* from_str - use the inherent parse() method
* is_utf8 - call from_utf8 instead
* replace - call the method instead
* truncate_utf16_at_nul - this is an implementation detail of windows and does
                          not need to be exposed.
* utf8_char_width - moved to libunicode
* utf16_items - moved to libunicode
* is_utf16 - moved to libunicode
* Utf16Items - moved to libunicode
* Utf16Item - moved to libunicode
* Utf16Encoder - moved to libunicode
* AnyLines - renamed to LinesAny and made a struct
* SendStr - use CowString<'static> instead
* str::raw - all functionality is deprecated
* StrExt::into_string - call to_string() instead
* StrExt::repeat - use iterators instead
* StrExt::char_len - use .chars().count() instead
* StrExt::is_alphanumeric - use .chars().all(..)
* StrExt::is_whitespace - use .chars().all(..)

Pending deprecation -- while slicing syntax is being worked out, these methods
are all #[unstable]

* Str - while currently used for generic programming, this trait will be
        replaced with one of [], deref coercions, or a generic conversion trait.
* StrExt::slice - use slicing syntax instead
* StrExt::slice_to - use slicing syntax instead
* StrExt::slice_from - use slicing syntax instead
* StrExt::lev_distance - deprecated with no replacement

Awaiting stabilization due to patterns and/or matching

* StrExt::contains
* StrExt::contains_char
* StrExt::split
* StrExt::splitn
* StrExt::split_terminator
* StrExt::rsplitn
* StrExt::match_indices
* StrExt::split_str
* StrExt::starts_with
* StrExt::ends_with
* StrExt::trim_chars
* StrExt::trim_left_chars
* StrExt::trim_right_chars
* StrExt::find
* StrExt::rfind
* StrExt::find_str
* StrExt::subslice_offset

9 years agorollup merge of #19216: Gankro/bitv
Alex Crichton [Mon, 22 Dec 2014 20:45:52 +0000 (12:45 -0800)]
rollup merge of #19216: Gankro/bitv

Part of #18424

This commit changes the semantics of `reserve` and `capacity` for Bitv and BitvSet to match conventions. It also introduces the notion of `reserve_index` and `reserve_index_exact` for collections with maximum-index-based capacity semantics.

Deprecates free function constructors in favour of functions on Bitv itself.

Changes `Bitv::pop` to return an Option rather than panicking.

Deprecates and renames several methods in favour of conventions.

Marks several blessed methods as unstable.

This commit also substantially refactors Bitv and BitvSet's implementations. The new implementation is simpler, cleaner, better documented, and more robust against overflows. It also reduces coupling between Bitv and BitvSet. Tests have been seperated into seperate submodules.

Fixes #16958

[breaking-change]

9 years agoRFC 248? I think you meant RFC 438.
Chris Morgan [Fri, 28 Nov 2014 23:20:22 +0000 (10:20 +1100)]
RFC 248? I think you meant RFC 438.

There ain’t an RFC 248, while 438 looks to be what is being referred to:
https://github.com/rust-lang/rfcs/blob/master/text/0438-precedence-of-plus.md

9 years agoRemove cmp::Ordering::* public reexport
Corey Farwell [Mon, 22 Dec 2014 19:09:55 +0000 (11:09 -0800)]
Remove cmp::Ordering::* public reexport

Part of #19253

I would have removed this public reexport in #19842, but #19812 hadn't merged (and snapshotted) at the time

In #19407, I changed the codebase to stop utilizing this reexport

[breaking-change]

9 years agoMake bitv's APIs match RFC + fixup
Alexis Beingessner [Mon, 15 Dec 2014 16:54:35 +0000 (11:54 -0500)]
Make bitv's APIs match RFC + fixup

9 years agofix run-make/ tests now flowgraph printing has moved to the unstable `--xpretty`...
Felix S. Klock II [Mon, 22 Dec 2014 18:41:19 +0000 (19:41 +0100)]
fix run-make/ tests now flowgraph printing has moved to the unstable `--xpretty` option.

9 years agoAdd a doctest for the btreemap's entry method.
jbranchaud [Mon, 22 Dec 2014 17:29:31 +0000 (11:29 -0600)]
Add a doctest for the btreemap's entry method.

Make some updates to the entry doctest.

9 years agoUpdate man page with the new options
Simonas Kazlauskas [Mon, 22 Dec 2014 10:32:29 +0000 (12:32 +0200)]
Update man page with the new options

This pull request updates the rustc manual page to represent post-#19900
state of rustc options better.

A bit unrelatedly, --help output is changed to fix some issues too:
  * -g and -O descriptions were changed from deprected flags to the new
    codegen flags.
  * dep-info value was moved from crate-type to emit flag.

Fixes #20111
Fixes #20131

9 years agoTweak region-related error messages that changed slightly due to coercion
Niko Matsakis [Sun, 21 Dec 2014 19:20:15 +0000 (14:20 -0500)]
Tweak region-related error messages that changed slightly due to coercion
changes, and also stop printing semi-useless inference by-products.

9 years agoCorrect merge failure around imports in `str.rs`.
Niko Matsakis [Fri, 19 Dec 2014 18:36:27 +0000 (13:36 -0500)]
Correct merge failure around imports in `str.rs`.

9 years agoAddress nit.
Niko Matsakis [Tue, 16 Dec 2014 23:15:33 +0000 (18:15 -0500)]
Address nit.

9 years agoChange print out to include the path to the fn, a bit ad-hoc for now .
Niko Matsakis [Wed, 3 Dec 2014 17:56:03 +0000 (12:56 -0500)]
Change print out to include the path to the fn, a bit ad-hoc for now .

9 years agoVarious simple tests for fn item type vs fn pointer type and for coercions between...
Niko Matsakis [Wed, 26 Nov 2014 11:47:14 +0000 (06:47 -0500)]
Various simple tests for fn item type vs fn pointer type and for coercions between them.

9 years agoInsert coercions to fn pointer types required for the new types
Niko Matsakis [Mon, 15 Dec 2014 20:41:30 +0000 (15:41 -0500)]
Insert coercions to fn pointer types required for the new types
post-unboxed-closure-conversion. This requires a fair amount of
annoying coercions because all the `map` etc types are defined
generically over the `F`, so the automatic coercions don't propagate;
this is compounded by the need to use `let` and not `as` due to
stage0. That said, this pattern is to a large extent temporary and
unusual.

9 years agoFix fallout from changes. In cases where stage0 compiler is needed, we
Niko Matsakis [Wed, 26 Nov 2014 10:52:16 +0000 (05:52 -0500)]
Fix fallout from changes. In cases where stage0 compiler is needed, we
cannot use an `as` expression to coerce, so I used a one-off function
instead (this is a no-op in stage0, but in stage1+ it triggers
coercion from the fn pointer to the fn item type).

9 years agoPerform coercions on LHS assignments.
Niko Matsakis [Wed, 3 Dec 2014 18:51:07 +0000 (13:51 -0500)]
Perform coercions on LHS assignments.

9 years agoInsert FIXME links to issue #19925: fn item types should be zero-sized.
Niko Matsakis [Wed, 26 Nov 2014 11:01:45 +0000 (06:01 -0500)]
Insert FIXME links to issue #19925: fn item types should be zero-sized.

9 years agoAdjust metadata for new fields and enum variants. Yawn.
Niko Matsakis [Wed, 26 Nov 2014 10:53:15 +0000 (05:53 -0500)]
Adjust metadata for new fields and enum variants. Yawn.

9 years agoRote changes that don't care to distinguish between a fn pointer and a fn item.
Niko Matsakis [Wed, 26 Nov 2014 11:01:28 +0000 (06:01 -0500)]
Rote changes that don't care to distinguish between a fn pointer and a fn item.

9 years agoMake ty_bare_fn carry an optional def-id indicating whether it is the
Niko Matsakis [Wed, 26 Nov 2014 11:36:09 +0000 (06:36 -0500)]
Make ty_bare_fn carry an optional def-id indicating whether it is the
type of a fn item or a fn pointer, which are now differentiated.
Introduce coercion from fn item to fn pointer.

9 years agoRemoved unused context-switching assembly code.
Maya Nitu [Mon, 22 Dec 2014 16:20:43 +0000 (18:20 +0200)]
Removed unused context-switching assembly code.

9 years agoauto merge of #20132 : alexcrichton/rust/revert-20027, r=sfackler
bors [Mon, 22 Dec 2014 17:11:37 +0000 (17:11 +0000)]
auto merge of #20132 : alexcrichton/rust/revert-20027, r=sfackler

The introduced issue https://github.com/rust-lang/rust/issues/20127 seems serious enough that we may want to enqueue a reversion for now. Feel free to beat me with a fix though @michaelwoerister!

9 years agoAdded missing renames:
Florian Wilkens [Sat, 20 Dec 2014 14:28:20 +0000 (15:28 +0100)]
Added missing renames:

libcollections:
    AbsEntries -> AbsIter, Entries -> Iter, MoveEntries -> IntoIter, MutEntries -> IterMut
    DifferenceItems -> Difference, SymDifferenceItems -> SymmetricDifference, IntersectionItems -> Intersection, UnionItems -> Union

libstd/hash/{table, map}:
    Entries -> Iter, MoveItems -> IntoIter, MutEntries -> IterMut

Also a [breaking-change].

9 years agoRevert "debuginfo: Create debuginfo for for-loop variables again."
Alex Crichton [Mon, 22 Dec 2014 16:25:44 +0000 (08:25 -0800)]
Revert "debuginfo: Create debuginfo for for-loop variables again."

This reverts commit b0481147184a8ee70f066423dc077ffa0bd821b5.

9 years agoRevert "debuginfo: Clean the debuginfo module up a bit."
Alex Crichton [Mon, 22 Dec 2014 16:25:34 +0000 (08:25 -0800)]
Revert "debuginfo: Clean the debuginfo module up a bit."

This reverts commit 34a6fcf19566e5015c1ef4c144a408a2f182cf4d.

9 years agoRevert "debuginfo: Add test case for destructured for-loop variable."
Alex Crichton [Mon, 22 Dec 2014 16:25:11 +0000 (08:25 -0800)]
Revert "debuginfo: Add test case for destructured for-loop variable."

This reverts commit 87c5927b79b8eec8763659da8a3cf4561a4ceabd.

9 years agoIntroduce a tcx() helper method to cleanup this mess.
Niko Matsakis [Wed, 26 Nov 2014 11:36:52 +0000 (06:36 -0500)]
Introduce a tcx() helper method to cleanup this mess.

9 years agoAdd an unstable `--xpretty _` option to `rustc`. Moved `flowgraph`
Felix S. Klock II [Wed, 17 Dec 2014 14:13:38 +0000 (15:13 +0100)]
Add an unstable `--xpretty _` option to `rustc`.  Moved `flowgraph`
and `everybody_loops` options to `--xpretty`.

9 years agoAdd `--pretty everybody_loops` option.
Felix S. Klock II [Wed, 17 Dec 2014 12:37:26 +0000 (13:37 +0100)]
Add `--pretty everybody_loops` option.

This prints out a transformed version of the input source code where
every function body is replaced with `loop { }`.

All such bodies are (1.) trivial and (2.) guaranteed to pass the
type-checker in a valid compiler; therefore they make very nice input
to start with when narrowing down a bug exposed by a large test input
(such as librustc itself).

9 years agoAdd `-Z unstable-options` debugging flag, which can then be used to
Felix S. Klock II [Wed, 17 Dec 2014 13:42:50 +0000 (14:42 +0100)]
Add `-Z unstable-options` debugging flag, which can then be used to
extend the `rustc` command line interface with options that we do not
want to commit to making part of the long-term public interface for
`rustc`.

9 years agoRenaming of the Iter types as in RFC #344
Florian Wilkens [Fri, 19 Dec 2014 20:52:10 +0000 (21:52 +0100)]
Renaming of the Iter types as in RFC #344

libcore: slice::Items -> slice::Iter, slice::MutItems -> slice::IterMut
libcollections: *::Items -> *::Iter, *::MoveItems -> *::IntoIter, *::MutItems -> *::IterMut

This is of course a [breaking-change].

9 years agoAdd myself to authors.
Rolf Timmermans [Sun, 21 Dec 2014 10:51:28 +0000 (11:51 +0100)]
Add myself to authors.

9 years agoRemove unnecessary deref().
Rolf Timmermans [Sat, 20 Dec 2014 23:41:05 +0000 (00:41 +0100)]
Remove unnecessary deref().

9 years agoAvoid allocations.
Rolf Timmermans [Sat, 20 Dec 2014 23:40:15 +0000 (00:40 +0100)]
Avoid allocations.

9 years agoEscape control characters in JSON output.
Rolf Timmermans [Sat, 20 Dec 2014 23:04:39 +0000 (00:04 +0100)]
Escape control characters in JSON output.

9 years agoserialize: Fully deprecate the library
Alex Crichton [Fri, 19 Dec 2014 06:52:48 +0000 (22:52 -0800)]
serialize: Fully deprecate the library

This commit completes the deprecation story for the in-tree serialization
library. The compiler will now emit a warning whenever it encounters
`deriving(Encodable)` or `deriving(Decodable)`, and the library itself is now
marked `#[unstable]` for when feature staging is enabled.

All users of serialization can migrate to the `rustc-serialize` crate on
crates.io which provides the exact same interface as the libserialize library
in-tree. The new deriving modes are named `RustcEncodable` and `RustcDecodable`
and require `extern crate "rustc-serialize" as rustc_serialize` at the crate
root in order to expand correctly.

To migrate all crates, add the following to your `Cargo.toml`:

    [dependencies]
    rustc-serialize = "0.1.1"

And then add the following to your crate root:

    extern crate "rustc-serialize" as rustc_serialize;

Finally, rename `Encodable` and `Decodable` deriving modes to `RustcEncodable`
and `RustcDecodable`.

[breaking-change]

9 years agoFallout of std::str stabilization
Alex Crichton [Thu, 11 Dec 2014 03:46:38 +0000 (19:46 -0800)]
Fallout of std::str stabilization

9 years agoImplement BitOps for HashSet
Chase Southwood [Thu, 18 Dec 2014 01:10:09 +0000 (19:10 -0600)]
Implement BitOps for HashSet

9 years agopprust: Fix asm options
klutzy [Wed, 17 Dec 2014 13:02:50 +0000 (22:02 +0900)]
pprust: Fix asm options

9 years agoMisc Stabilization for collections
Chase Southwood [Fri, 19 Dec 2014 23:53:40 +0000 (17:53 -0600)]
Misc Stabilization for collections

This commit:

*Renames `BinaryHeap::top` to `BinaryHeap::peek`
*Stabilizes `front/back/front_mut/back_mut` in `DList` and `RingBuf`
*Stabilizes `swap` in `RingBuf`

Because of the method renaming, this is a [breaking-change].

9 years agostd: Stabilize the std::str module
Alex Crichton [Wed, 10 Dec 2014 17:02:31 +0000 (09:02 -0800)]
std: Stabilize the std::str module

This commit starts out by consolidating all `str` extension traits into one
`StrExt` trait to be included in the prelude. This means that
`UnicodeStrPrelude`, `StrPrelude`, and `StrAllocating` have all been merged into
one `StrExt` exported by the standard library. Some functionality is currently
duplicated with the `StrExt` present in libcore.

This commit also currently avoids any methods which require any form of pattern
to operate. These functions will be stabilized via a separate RFC.

Next, stability of methods and structures are as follows:

Stable

* from_utf8_unchecked
* CowString - after moving to std::string
* StrExt::as_bytes
* StrExt::as_ptr
* StrExt::bytes/Bytes - also made a struct instead of a typedef
* StrExt::char_indices/CharIndices - CharOffsets was renamed
* StrExt::chars/Chars
* StrExt::is_empty
* StrExt::len
* StrExt::lines/Lines
* StrExt::lines_any/LinesAny
* StrExt::slice_unchecked
* StrExt::trim
* StrExt::trim_left
* StrExt::trim_right
* StrExt::words/Words - also made a struct instead of a typedef

Unstable

* from_utf8 - the error type was changed to a `Result`, but the error type has
              yet to prove itself
* from_c_str - this function will be handled by the c_str RFC
* FromStr - this trait will have an associated error type eventually
* StrExt::escape_default - needs iterators at least, unsure if it should make
                           the cut
* StrExt::escape_unicode - needs iterators at least, unsure if it should make
                           the cut
* StrExt::slice_chars - this function has yet to prove itself
* StrExt::slice_shift_char - awaiting conventions about slicing and shifting
* StrExt::graphemes/Graphemes - this functionality may only be in libunicode
* StrExt::grapheme_indices/GraphemeIndices - this functionality may only be in
                                             libunicode
* StrExt::width - this functionality may only be in libunicode
* StrExt::utf16_units - this functionality may only be in libunicode
* StrExt::nfd_chars - this functionality may only be in libunicode
* StrExt::nfkd_chars - this functionality may only be in libunicode
* StrExt::nfc_chars - this functionality may only be in libunicode
* StrExt::nfkc_chars - this functionality may only be in libunicode
* StrExt::is_char_boundary - naming is uncertain with container conventions
* StrExt::char_range_at - naming is uncertain with container conventions
* StrExt::char_range_at_reverse - naming is uncertain with container conventions
* StrExt::char_at - naming is uncertain with container conventions
* StrExt::char_at_reverse - naming is uncertain with container conventions
* StrVector::concat - this functionality may be replaced with iterators, but
                      it's not certain at this time
* StrVector::connect - as with concat, may be deprecated in favor of iterators

Deprecated

* StrAllocating and UnicodeStrPrelude have been merged into StrExit
* eq_slice - compiler implementation detail
* from_str - use the inherent parse() method
* is_utf8 - call from_utf8 instead
* replace - call the method instead
* truncate_utf16_at_nul - this is an implementation detail of windows and does
                          not need to be exposed.
* utf8_char_width - moved to libunicode
* utf16_items - moved to libunicode
* is_utf16 - moved to libunicode
* Utf16Items - moved to libunicode
* Utf16Item - moved to libunicode
* Utf16Encoder - moved to libunicode
* AnyLines - renamed to LinesAny and made a struct
* SendStr - use CowString<'static> instead
* str::raw - all functionality is deprecated
* StrExt::into_string - call to_string() instead
* StrExt::repeat - use iterators instead
* StrExt::char_len - use .chars().count() instead
* StrExt::is_alphanumeric - use .chars().all(..)
* StrExt::is_whitespace - use .chars().all(..)

Pending deprecation -- while slicing syntax is being worked out, these methods
are all #[unstable]

* Str - while currently used for generic programming, this trait will be
        replaced with one of [], deref coercions, or a generic conversion trait.
* StrExt::slice - use slicing syntax instead
* StrExt::slice_to - use slicing syntax instead
* StrExt::slice_from - use slicing syntax instead
* StrExt::lev_distance - deprecated with no replacement

Awaiting stabilization due to patterns and/or matching

* StrExt::contains
* StrExt::contains_char
* StrExt::split
* StrExt::splitn
* StrExt::split_terminator
* StrExt::rsplitn
* StrExt::match_indices
* StrExt::split_str
* StrExt::starts_with
* StrExt::ends_with
* StrExt::trim_chars
* StrExt::trim_left_chars
* StrExt::trim_right_chars
* StrExt::find
* StrExt::rfind
* StrExt::find_str
* StrExt::subslice_offset

9 years agoauto merge of #20104 : alexcrichton/rust/rollup, r=alexcrichton
bors [Mon, 22 Dec 2014 00:12:47 +0000 (00:12 +0000)]
auto merge of #20104 : alexcrichton/rust/rollup, r=alexcrichton