Commit Graph

38420 Commits

Author SHA1 Message Date
Manish Goregaokar
cb0900193b Rollup merge of #22307 - steveklabnik:gh14849, r=huonw
Fixes #14849
2015-02-15 18:42:45 +05:30
Manish Goregaokar
70647ec7c5 Rollup merge of #22305 - steveklabnik:gh20948, r=alexcrichton
Fixes #20948
2015-02-15 18:42:45 +05:30
Manish Goregaokar
1da4e53330 Rollup merge of #22302 - japaric:gh21909, r=brson
closes #21909
2015-02-15 18:42:45 +05:30
Manish Goregaokar
1b86ebe257 Rollup merge of #22299 - bluss:range-64-is-not-exact-size, r=alexcrichton
Fixes #22047

`Range<u64>` and `Range<i64>` may be longer than usize::MAX on 32-bit
platforms, and thus they cannot fulfill the protocol for
ExactSizeIterator. We don't want a nonobvious platform dependency in
basic iterator traits, so the trait impl is removed.

The logic of this change assumes that usize is at least 32-bit.

This is technically a breaking change; note that `Range<usize>` and
`Range<isize>` are always ExactSizeIterators.

[breaking-change]
2015-02-15 18:42:44 +05:30
Manish Goregaokar
0f66e314db Rollup merge of #22295 - steveklabnik:gh9980, r=alexcrichton
Fixes #9980
2015-02-15 18:42:44 +05:30
Manish Goregaokar
db4a1678d7 Rollup merge of #22288 - steveklabnik:add_option_link, r=nikomatsakis 2015-02-15 18:42:44 +05:30
Manish Goregaokar
1718e6b19e Rollup merge of #22284 - steveklabnik:fix_another_lie, r=nikomatsakis
This isn't something we want to guarantee.

r? @nikomatsakis
2015-02-15 18:42:44 +05:30
Manish Goregaokar
1ee09f918d Rollup merge of #22280 - Unode:patch-1, r=steveklabnik 2015-02-15 18:42:44 +05:30
Manish Goregaokar
a2840f3560 Rollup merge of #22278 - nikomatsakis:rustc-error, r=nikomatsakis
Add `#[rustc_error]` annotation, which causes trans to signal an error
if found on the `main()` function. This lets you write tests that live
in `compile-fail` but are expected to compile successfully. This is
handy when you have many small variations on a theme that you want to
keep together, and you are just testing the type checker, not the
runtime semantics.

r? @pnkfelix
2015-02-15 18:42:43 +05:30
Manish Goregaokar
2935d67e08 Rollup merge of #22277 - pnkfelix:reference-update-feature-gate-list, r=steveklabnik
Added all active features to the list in reference.md.

Added a second note about keeping the reference.md list up-to-date to the bottom of the list, since not everyone (including me) reads the big comment at the top of it.  :)

Ensured that the feature gate list in reference.md is kept in alphabetical order.
2015-02-15 18:42:43 +05:30
Manish Goregaokar
f96fb8ecb8 Rollup merge of #22275 - steveklabnik:gh7538, r=huonw
We use them in some places, but never actually talk about the syntax.
2015-02-15 18:28:36 +05:30
Manish Goregaokar
33371bfc41 Rollup merge of #22274 - pnkfelix:retag-slicing-syntax-as-accepted, r=nikomatsakis
Re-tag `slicing_syntax` as `Accepted`.

Rollup merge (373cbab5b0) of PR #20723
accidentally reverted a portion of commit
8327bcc167 which shifted
`slicing_syntax` from Active to Accepted.
2015-02-15 18:28:14 +05:30
Manish Goregaokar
828a8644c7 Rollup merge of #22272 - steveklabnik:gh22064, r=alexcrichton
Fixes #22064.
2015-02-15 18:27:47 +05:30
Manish Goregaokar
ed9ffced22 Rollup merge of #22271 - steveklabnik:gh22035, r=nikomatsakis
Fixes #22035. (mostly by making it irrelevant)
2015-02-15 18:27:33 +05:30
Manish Goregaokar
3fe2715053 Rollup merge of #22269 - steveklabnik:gh22136, r=alexcrichton
Fixes #22136
2015-02-15 18:27:14 +05:30
Manish Goregaokar
a2bc3a252c Rollup merge of #22268 - steveklabnik:improve_wait, r=nikomatsakis
Remove incorrect claim, add example, reformat and re-word.

Fixes #22266
2015-02-15 18:26:58 +05:30
Manish Goregaokar
cff0b78ce7 Rollup merge of #22264 - fhahn:tiny-doc-fix2, r=Gankro
While having a look at the Rust book I found this tiny error. In my opinion this if should be all lowercase, because it follows a colon, but I am no native speaker, so I am probably wrong. Also it is a very tiny change, so feel free to include it in any bigger documentation patch.
2015-02-15 18:26:47 +05:30
Manish Goregaokar
f6fa27acd6 Rollup merge of #22263 - iKevinY:no-mailing-list, r=nikomatsakis
Removes the link to the rust-dev mailing list in the bug report submission page and also adds the address of the IRC server (`irc.mozilla.org`). Addresses #22249.
2015-02-15 18:26:29 +05:30
Manish Goregaokar
8ebbf584a0 Rollup merge of #22262 - lfairy:unsafe-cell-lang-item, r=alexcrichton
`Unsafe` was renamed to `UnsafeCell` a while ago, but the corresponding lang item kept the old name. This patch fixes the inconsistency.

r? @eddyb
2015-02-15 18:26:05 +05:30
Manish Goregaokar
da1a1f515f Rollup merge of #22254 - huonw:float-value--, r=aturon
In `std::f32` and `std::f64`:

- `MIN_VALUE` → `MIN`
- `MAX_VALUE` → `MAX`
- `MIN_POS_VALUE` → `MIN_POSITIVE`

This matches the corresponding integer constants.

[breaking-change]
2015-02-15 18:25:40 +05:30
Manish Goregaokar
d014548d5a Rollup merge of #22248 - duaneedwards:patch-1, r=Gankro 2015-02-15 18:22:32 +05:30
Manish Goregaokar
e6ad3848c6 Rollup merge of #22238 - dotdash:llvmup_20150212, r=alexcrichton
Fixes #22233 

r? @alexcrichton
2015-02-15 18:22:32 +05:30
Manish Goregaokar
8623fe70eb Rollup merge of #22229 - vhbit:ios-default-cpus, r=alexcrichton
According to @dotdash it enables more aggressive optimizations from LLVM
2015-02-15 18:22:32 +05:30
Manish Goregaokar
132b56cefc Rollup merge of #22224 - sanxiyn:must-use, r=cmr
Fix #20109.
2015-02-15 18:22:31 +05:30
Manish Goregaokar
8cc3fbd41d Rollup merge of #22218 - huonw:raw-docs, r=steveklabnik,huonw
This overhauls the very meager docs that currently exist to clarify
various understandable confusions that I've noticed, e.g. people look in
`std::raw` for the "real" types of slices like `&[T]`, or think that
`Slice<T>` refers to `[T]` (fixes #22214).

This patch takes the liberty of offering some "style" guidance around
`raw::Slice`, since there's more restricted ways to duplicate all
functionality connected to it: `std::slice::from_raw_parts{,_mut}` for
construction and `.as_{,mut_}ptr` & `.len` for deconstruction.

It also deprecates the `std::raw::Closure` type which is now useless for
non-type-erased closures, and replaced by `TraitObject` for `&Fn`, `&mut
FnMut` etc, so I guess it should be called a:

[breaking-change]
2015-02-15 18:22:31 +05:30
Manish Goregaokar
63091efa3b Rollup merge of #22201 - brson:version, r=nick29581
rustc --version says

```
rustc 1.0.0-dev (d0e82a68a 2015-02-05 14:38:56 -0800) (built 2015-02-11)
```
2015-02-15 18:22:31 +05:30
Manish Goregaokar
b13fddda20 Rollup merge of #22132 - steveklabnik:gh16645, r=alexcrichton
Fixes #16645

Fixing this in any deeper way will require an RFC, so let's just document the current behavior.
2015-02-15 18:22:31 +05:30
bors
b6d91a2bda Auto merge of #22126 - steveklabnik:gh21281, r=nikomatsakis
This is super black magic internals at the moment, but having it
somewhere semi-public seems good. The current versions weren't being
rendered, and they'll be useful for some people.

Fixes #21281

r? @nikomatsakis @kmcallister
2015-02-15 07:53:07 +00:00
bors
5be210c418 Auto merge of #22058 - Gankro:all-the-impls, r=huonw
Working on just knocking these out for all the collections so that there's something there.
2015-02-15 03:07:59 +00:00
Alexis
3c18bc4272 naive RingBuf::append impl 2015-02-14 19:30:33 -05:00
Steve Klabnik
bdc730e403 remove extra mod doc;s 2015-02-14 12:07:09 -05:00
bors
b63cee4a11 Auto merge of #22158 - Kimundi:the_lonely_uppercase_keyword, r=pnkfelix
It is only allowed in paths now, where it will either work inside a `trait`
or `impl` item, or not resolve outside of it.

[breaking-change]

Closes #22137
2015-02-14 17:01:11 +00:00
bors
3d1c1added Auto merge of #22114 - alexcrichton:issue-22084, r=steveklabnik
This ended up just being a forgotten attribute on the `char` module in
libunicode.

Closes #22084
2015-02-14 13:08:33 +00:00
bors
df54632601 Auto merge of #22119 - aturon:new-process, r=alexcrichton
Per [RFC 579](https://github.com/rust-lang/rfcs/pull/579), this commit
adds a new `std::process` module. This module is largely based on the
existing `std::old_io::process` module, but refactors the API to use
`OsStr` and other new standards set out by IO reform.

The existing module is not yet deprecated, to allow for the new API to
get a bit of testing before a mass migration to it.
2015-02-14 10:03:01 +00:00
Aaron Turon
4175f1ce2f Add std::process
Per [RFC 579](https://github.com/rust-lang/rfcs/pull/579), this commit
adds a new `std::process` module. This module is largely based on the
existing `std::old_io::process` module, but refactors the API to use
`OsStr` and other new standards set out by IO reform.

The existing module is not yet deprecated, to allow for the new API to
get a bit of testing before a mass migration to it.
2015-02-13 23:21:08 -08:00
bors
95b228ab95 Auto merge of #22041 - semarie:configure-compat, r=alexcrichton
the sed option `--in-place` (or `-i`) is a GNU extension, and it is not
portable to BSD system (openbsd and freebsd checked).

use an alternate construction in order to keep the semantic.
2015-02-14 07:10:52 +00:00
bors
f174bcabcb Auto merge of #21834 - genbattle:doc-range-notation, r=steveklabnik
Replaced outdated use of the `range(start, end)` function where appropriate with `start..end`, and tweaked the examples to compile and run with the latest rust. I also fixed two periphery compile issues in reference.md which were occluding whether there were any new errors created by these changes.
2015-02-14 03:10:40 +00:00
Ulrik Sverdrup
7a52932f4c Make std::raw::Repr an unsafe trait
The default implementation of .repr() will call conveniently call
transmute_copy which should be appropriate for all implementors, but is
memory unsafe if used wrong.

Fixes #22260

You need to use `unsafe impl` to implement the Repr trait now.

[breaking-change]
2015-02-14 11:32:42 +11:00
Huon Wilson
5e3ae102db Dramatically expand the docs of std::raw.
This overhauls the very meager docs that currently exist to clarify
various understandable confusions that I've noticed, e.g. people look in
`std::raw` for the "real" types of slices like `&[T]`, or think that
`Slice<T>` refers to `[T]` (fixes #22214).

This patch takes the liberty of offering some "style" guidance around
`raw::Slice`, since there's more restricted ways to duplicate all
functionality connected to it: `std::slice::from_raw_parts{,_mut}` for
construction and `.as_{,mut_}ptr` & `.len` for deconstruction.

It also deprecates the `std::raw::Closure` type which is now useless for
non-type-erased closures, and replaced by `TraitObject` for `&Fn`, `&mut
FnMut` etc, so I guess it should be called a:

[breaking-change]
2015-02-14 11:32:08 +11:00
bors
b8c112fc72 Auto merge of #21376 - fhahn:issue-15881-model-lexer-dotdotdot, r=cmr
This PR adds a dedicated regression test for #15881 as @cmr suggested.
2015-02-13 23:56:40 +00:00
Steve Klabnik
6d2e3d4bc0 Note that Vec<T> is heap allocated.
Fixes #20948
2015-02-13 18:49:21 -05:00
Steve Klabnik
148d90be99 clarfiy reference with regards to the value of block expressions
Fixes #14849
2015-02-13 17:56:06 -05:00
Jorge Aparicio
3df82450aa add test for #21909
closes #21909
2015-02-13 17:41:28 -05:00
Brian Anderson
effad62bc5 Add the build date to the reported version. #21957
rustc --version says

```
rustc 1.0.0-dev (d0e82a68a 2015-02-05) (built 2015-02-11)
```
2015-02-13 14:30:04 -08:00
bors
b9ba643b72 Auto merge of #22200 - alexcrichton:opt-vec-collect, r=huonw
This PR is an optimization of the `FromIterator` implementation of `Vec`

Benchmark: https://gist.github.com/alexcrichton/03d666159a28a80e7c70

Before:

    test macro_repeat1     ... bench:        57 ns/iter (+/- 1)
    test macro_repeat2     ... bench:        56 ns/iter (+/- 1)
    test map_clone1        ... bench:       828 ns/iter (+/- 13)
    test map_clone2        ... bench:       828 ns/iter (+/- 8)
    test repeat1           ... bench:      1104 ns/iter (+/- 10)
    test repeat2           ... bench:      1106 ns/iter (+/- 11)

After:

    test macro_repeat1     ... bench:        75 ns/iter (+/- 21)
    test macro_repeat2     ... bench:        59 ns/iter (+/- 31)
    test map_clone1        ... bench:        34 ns/iter (+/- 22)
    test map_clone2        ... bench:        52 ns/iter (+/- 21)
    test repeat1           ... bench:        34 ns/iter (+/- 11)
    test repeat2           ... bench:        33 ns/iter (+/- 12)

The idea behind this optimization is to avoid all bounds checks for space
already allocated into the vector. This may involve running the iterator twice,
but the first run of the iterator should be optimizable to a memcpy or memset if
possible.

The same treatment can in theory be applied to `Vec::extend` but the benchmarks
for that currently get *worse* if the change is applied. This appears to be some
LLVM optimizations going awry but it's seems prudent to land at least the
`collect` portion beforehand.
2015-02-13 21:15:39 +00:00
Ulrik Sverdrup
b19fda0ceb Remove ExactSizeIterator from 64-bit ranges.
Fixes #22047

Range<u64> and Range<i64> may be longer than usize::MAX on 32-bit
platforms, and thus they cannot fulfill the protocol for
ExactSizeIterator. We don't want a nonobvious platform dependency in
basic iterator traits, so the trait impl is removed.

The logic of this change assumes that usize is at least 32-bit.

This is technically a breaking change; note that Range<usize> and
Range<isize> are always ExactSizeIterators.

[breaking-change]
2015-02-13 21:26:50 +01:00
Steve Klabnik
ece19bfc70 Enhance static mut example in FFI chapter.
Fixes #9980
2015-02-13 14:57:55 -05:00
Steve Klabnik
9eb4436188 Add link to module-level Option documentation. 2015-02-13 13:47:09 -05:00
Steve Klabnik
e478f660d8 Don't specify tuple layout.
This isn't something we want to guarantee.
2015-02-13 12:53:54 -05:00
Steve Klabnik
ad2efdc67d Instead of putting them in the book, make them READMEs. 2015-02-13 12:32:37 -05:00