Commit Graph

38560 Commits

Author SHA1 Message Date
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
Kevin Yap
1e01f7f470 Rename std::failure to std::panicking
Closes #22306.
2015-02-13 20:37:33 -08: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
Alexis
1c494046a5 allow DList to split_at . fixes #22244 2015-02-13 21:20:26 -05: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
Jorge Aparicio
e7273784c7 add an associated Item type to IntoIterator 2015-02-13 19:02:02 -05: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
f64d91211f Generate grammar.html and link to it from the reference.
Fixes #19278
2015-02-13 18:00:00 -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
Keegan McAllister
dcd4cef119 Forbid pub mymacro!();
It's not clear what this means, because a macro in item position can expand to
zero or more items.  For now we disallow it, which is technically a

    [breaking-change]

but is landing without an RFC.  The `pub` keyword previously had no effect,
which seems quite unintended.

Fixes #18317.
Fixes #14660.
2015-02-13 13:48:09 -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
Keegan McAllister
228603d9d2 Parse pub in the expansion of a method macro
Fixes #17436.
2015-02-13 12:54:58 -08: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
Simonas Kazlauskas
220bf41d25 Cleanup getenv from tests and benchmarks 2015-02-13 22:08:05 +02:00
Simonas Kazlauskas
5284c4ea63 Remove a few uses of deprecated getenv 2015-02-13 22:05:12 +02:00
Steve Klabnik
ece19bfc70 Enhance static mut example in FFI chapter.
Fixes #9980
2015-02-13 14:57:55 -05:00
Niko Matsakis
6d6c360ca9 Audit integer type usage in core::option 2015-02-13 14:36:59 -05:00
Steve Klabnik
6647d8306e Mention type placeholders in the book.
Fixes #12891.
2015-02-13 14:36:16 -05:00
Niko Matsakis
84cb71b253 Audit integer type usage in core::ptr 2015-02-13 14:30:31 -05:00
Brian Anderson
be97aab5d3 Update version number for 1.0.0-alpha.2 2015-02-13 11:26:24 -08:00
Alexis
1e75a05a0e more int and cloned cleanup in collections 2015-02-13 14:12:51 -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
Renato Alves
f48eda8dc9 Fix small copy-paste typo 2015-02-13 17:09:46 +00:00
Niko Matsakis
fb05f282d7 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.
2015-02-13 11:10:51 -05:00
Felix S. Klock II
a7d5c3f682 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-13 16:42:22 +01:00
Steve Klabnik
65eab6eb97 Add diverging functions to the book.
We use them in some places, but never actually talk about the syntax.
2015-02-13 10:05:33 -05:00
Felix S. Klock II
d414a39197 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-13 15:48:05 +01:00
Steve Klabnik
114301f4f2 Refer to LLVM rather than GCC wiki for atomic orderings
Fixes #22064.
2015-02-13 09:39:36 -05:00
Steve Klabnik
58a7d58686 Re-word paragraph about enums and equality
Fixes #22035.
2015-02-13 09:37:05 -05:00
Steve Klabnik
4b25d7528b Remove outdated information about copy/move from the reference
Fixes #22136
2015-02-13 09:21:38 -05:00
Steve Klabnik
805a31fb76 Improve documentation for Select::new().
Remove incorrect claim, add example, reformat and re-word.

Fixes #22266
2015-02-13 09:11:41 -05:00
Steve Klabnik
ce22f30b9e Make note of doc duplication with reexports
Fixes #16645
2015-02-13 08:56:44 -05:00
Florian Hahn
f28a33359b Make if after colon lowercase 2015-02-13 10:24:05 +01:00
Kevin Yap
c5dba7275a Remove reference to mailing list
Also add address of IRC server. Addresses #22249.
2015-02-13 00:01:34 -08:00
bors
cf636c233d Auto merge of #22093 - petrochenkov:builtin, r=pnkfelix
Names of structs, enums, traits, type aliases and type parameters (i.e. all identifiers that can be used as full paths in type position) are not allowed to match the names of primitive types.
See #20427 for more information.

This is a minor [breaking-change]
2015-02-13 07:44:41 +00:00
Chris Wong
aef5551751 Rename unsafe_lang_item to unsafe_cell_lang_item 2015-02-13 19:40:22 +13:00
Chris Wong
b4a286144d Rename the "unsafe" lang item to "unsafe_cell" 2015-02-13 19:40:22 +13:00
Brian Anderson
9df38bf658 Remove some irrelevant text from README
The quick start already links to the book. I think its not necessary
to do in the build instructions.
2015-02-12 20:36:21 -08:00
Brian Anderson
8dcc886d68 Change README quick start instructions to defer entirely to the book. 2015-02-12 20:36:21 -08:00
Brian Anderson
b2f70a4159 Update uninstall instructions 2015-02-12 20:36:20 -08:00
Brian Anderson
be440bc8a6 Upgrade rust-installer 2015-02-12 20:36:17 -08:00
Huon Wilson
e4a9eb95ce Remove _VALUE from the float extremes constants.
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-13 14:40:57 +11:00
Huon Wilson
3d9528a8d8 Unstabilise words for now.
It is not totally clear if we should just use whitespace, or if the full
unicode word-breaking algorithm is more correct. If there is demand we
can reconsider this decision (and consider the precise algorithm to use
in detail).

cc #15628.
2015-02-13 14:30:23 +11:00
bors
ba2efe96ae Auto merge of #22219 - pnkfelix:partial-reinit, r=pnkfelix
borrowck: Prevent partial reinitialization of uninitialized structures

This is a pnkfelix-swiped squash of #22079, which was a rebase and revision of #18963

Fixes #18571.
2015-02-13 02:09:15 +00:00