Commit Graph

41536 Commits

Author SHA1 Message Date
Steven Allen
50c6c6ca90 Address comments.
1. Use next_back for last.
2. Use slices for computing nth. It might be possible to use the same
code for both the mut/const case but I don't know how that will play
with compiler optimizations.
2015-04-22 19:19:54 -04:00
Steven Allen
de8c79a535 Implement O(1) slice::Iter methods.
Instead of using the O(n) defaults, define O(1) shortcuts.
2015-04-22 17:17:24 -04:00
bors
e9e9279d87 Auto merge of #24685 - nrc:span-pred, r=huonw 2015-04-22 08:47:09 +00:00
bors
50cd2e84d5 Auto merge of #24671 - steveklabnik:doc_const_static, r=alexcrichton
r? @alexcrichton
2015-04-22 06:37:57 +00:00
Nick Cameron
8456dba4e6 Fix spans for predicates in where clauses 2015-04-22 18:29:54 +12:00
bors
c0eb9384af Auto merge of #24674 - alexcrichton:rollup, r=alexcrichton 2015-04-22 03:38:20 +00:00
Steve Klabnik
a04f6c5293 TRPL: const and static 2015-04-21 19:47:07 -04:00
Alex Crichton
5815064025 Merge remote-tracking branch 'origin/master' into rollup 2015-04-21 16:27:26 -07:00
Alex Crichton
224fc1085b Test fixes and rebase conflicts, round 1 2015-04-21 16:17:24 -07:00
Alex Crichton
a1dd5ac787 rollup merge of #24636: alexcrichton/remove-deprecated
Conflicts:
	src/libcore/result.rs
2015-04-21 15:28:53 -07:00
Alex Crichton
98e9765d97 rollup merge of #24541: alexcrichton/issue-24538
This is an implementation of [RFC 1030][rfc] which adds these traits to the
prelude and additionally removes all inherent `into_iter` methods on collections
in favor of the trait implementation (which is now accessible by default).

[rfc]: https://github.com/rust-lang/rfcs/pull/1030

This is technically a breaking change due to the prelude additions and removal
of inherent methods, but it is expected that essentially no code breaks in
practice.

[breaking-change]
Closes #24538
2015-04-21 15:28:06 -07:00
Alex Crichton
a568a7f9f2 std: Bring back f32::from_str_radix as an unstable API
This API was exercised in a few tests and mirrors the `from_str_radix`
functionality of the integer types.
2015-04-21 15:23:54 -07:00
Alex Crichton
44338cb944 rollup merge of #24672: steveklabnik/edit_tuple_structs
I thought I edited all the last little chapters, but I missed this one.

r? @alexcrichton
2015-04-21 15:23:18 -07:00
Alex Crichton
cfbc5bebae rollup merge of #24670: brson/1.1
We're not going to do another merge into beta, so what's on master is now destined for 1.1.

Also reset the prerelease number to ".1"
2015-04-21 15:23:17 -07:00
Alex Crichton
0feaf6154c rollup merge of #24669: steveklabnik/fix
This section was added but the list wasn't updated.
2015-04-21 15:23:17 -07:00
Alex Crichton
83008b2e9b rollup merge of #24667: steveklabnik/more_editing
r? @alexcrichton
2015-04-21 15:23:16 -07:00
Alex Crichton
1a6c18d660 rollup merge of #24665: sw17ch/document-complete-slice-syntax
The documentation doesn't appear to describe the `&foo[..]` syntax.

I tried looking in `primitive-types.html#slices` and `std/primitive.slice.html`.

There's an example of partially slicing an array in trpl and a mention of `&foo[..]` in [the standard library documentation](https://doc.rust-lang.org/std/primitive.slice.html), but neither place, from what I can see, actually describes the behavior of `&foo[..]`.

+r? @steveklabnik
2015-04-21 15:23:15 -07:00
Alex Crichton
ee9d4eefba rollup merge of #24663: steveklabnik/gh24639
Fixes #24639
2015-04-21 15:23:14 -07:00
Alex Crichton
c7017b3b3e rollup merge of #24661: SimonSapin/fmt-write-char
as accepted in [RFC 526](https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md).

Note that this brand new method is marked as **stable**. I judged this safe enough: it’s simple enough that it’s very unlikely to change. Still, I can mark it unstable instead if you prefer.

r? @alexcrichton
2015-04-21 15:23:13 -07:00
Alex Crichton
251f8d3fbd rollup merge of #24654: mdinger/patch-2
This just fixes some comments made on https://github.com/rust-lang/rust/pull/24632 . The second I think is better unless @steveklabnik actually meant something else.
2015-04-21 15:23:12 -07:00
Alex Crichton
59171f8ec8 rollup merge of #24651: tamird/old-references
r? @alexcrichton
2015-04-21 15:23:11 -07:00
Alex Crichton
1ec7ccb53c rollup merge of #24640: steveklabnik/new_unsafe_guide
https://github.com/rust-lang/rust/pull/24631 is related, as it will delete this from the TOC, but I want to keep it here.
2015-04-21 15:23:10 -07:00
Alex Crichton
d14fb2f0d6 rollup merge of #24635: tamird/llvm-3.5
r? @alexcrichton
2015-04-21 15:23:10 -07:00
Alex Crichton
6b1ce49574 rollup merge of #24611: doomsplayer/doomsplayer-patch-1
as dependency for #24594
2015-04-21 15:23:09 -07:00
Alex Crichton
a63df9218e rollup merge of #24563: kwantam/rfc_1054
For now, words() is left in (but deprecated), and Words is a type alias for
struct SplitWhitespace.

Also cleaned up references to str.words() throughout codebase.

Closes #15628
2015-04-21 15:23:08 -07:00
Alex Crichton
37a1f2e3ac rollup merge of #24487: erickt/syntax
This removes the usage of `#[feature(into_cow, slice_patterns, box_syntax, box_patterns, quote, unsafe_destructor)]` from being used in libsyntax. My main desire for this is that it brings me one step closer to letting [syntex](https://github.com/erickt/rust-syntex) compile with stable rust. Hopefully this doesn't inconvenience rust development.
2015-04-21 15:23:07 -07:00
Alex Crichton
957cb422a9 rollup merge of #24439: alexcrichton/fix-archive-assembler
When linking an archive statically to an rlib, the compiler will extract all
contents of the archive and add them all to the rlib being generated. The
current method of extraction is to run `ar x`, dumping all files into a
temporary directory. Object archives, however, are allowed to have multiple
entries with the same file name, so there is no method for them to extract their
contents into a directory in a lossless fashion.

This commit adds iterator support to the `ArchiveRO` structure which hooks into
LLVM's support for reading object archives. This iterator is then used to
inspect each object in turn and extract it to a unique location for later
assembly.
2015-04-21 15:23:06 -07:00
Alex Crichton
2fc2e12687 rollup merge of #24222: lambda/rename-soft-link-to-symlink
Implement [RFC #1048][rfc].

On Windows, when you create a symbolic link you must specify whether it
points to a directory or a file, even if it is created dangling, while
on Unix, the same symbolic link could point to a directory, a file, or
nothing at all.  Furthermore, on Windows special privilege is necessary
to use a symbolic link, while on Unix, you can generally create a
symbolic link in any directory you have write privileges to.

This means that it is unlikely to be able to use symbolic links purely
portably; anyone who uses them will need to think about the cross
platform implications.  This means that using platform-specific APIs
will make it easier to see where code will need to differ between the
platforms, rather than trying to provide some kind of compatibility
wrapper.

Furthermore, `soft_link` has no precedence in any other API, so to avoid
confusion, move back to the more standard `symlink` terminology.

Create a `std::os::unix::symlink` for the Unix version that is
destination type agnostic, as well as `std::os::windows::{symlink_file,
symlink_dir}` for Windows.

Because this is a stable API, leave a compatibility wrapper in
`std::fs::soft_link`, which calls `symlink` on Unix and `symlink_file`
on Windows, preserving the existing behavior of `soft_link`.

[rfc]: https://github.com/rust-lang/rfcs/pull/1048
2015-04-21 15:23:06 -07:00
Alex Crichton
75f35657b3 rollup merge of #24162: pnkfelix/fsk-detect-duplicate-loop-labels
Check for duplicate loop labels in function bodies.

See also: http://internals.rust-lang.org/t/psa-rejecting-duplicate-loop-labels/1833

The change, which we are putting in as future-proofing in preparation for future potential additions to the language (namely labeling arbitrary blocks and using those labels in borrow expressions), means that code like this will start emitting warnings:

```rust
fn main() {
    { 'a: loop { break; } }
    { 'a: loop { break; } }
}
```

To make the above code compile without warnings, write this instead:

```rust
fn main() {
    { 'a: loop { break; } }
    { 'b: loop { break; } }
}
```

Since this change is only introducing a new warnings, this change is non-breaking.

Fix #21633
2015-04-21 15:23:05 -07:00
bors
2baf348253 Auto merge of #24162 - pnkfelix:fsk-detect-duplicate-loop-labels, r=nikomatsakis
Check for duplicate loop labels in function bodies.

See also: http://internals.rust-lang.org/t/psa-rejecting-duplicate-loop-labels/1833

The change, which we are putting in as future-proofing in preparation for future potential additions to the language (namely labeling arbitrary blocks and using those labels in borrow expressions), means that code like this will start emitting warnings:

```rust
fn main() {
    { 'a: loop { break; } }
    { 'a: loop { break; } }
}
```

To make the above code compile without warnings, write this instead:

```rust
fn main() {
    { 'a: loop { break; } }
    { 'b: loop { break; } }
}
```

Since this change is only introducing a new warnings, this change is non-breaking.

Fix #21633
2015-04-21 21:18:30 +00:00
Steve Klabnik
f78ee1aff1 Document functional update syntax
Fixes #24639
2015-04-21 16:18:51 -04:00
kwantam
c361e13d71 implement rfc 1054: split_whitespace() fn, deprecate words()
For now, words() is left in (but deprecated), and Words is a type alias for
struct SplitWhitespace.

Also cleaned up references to s.words() throughout codebase.

Closes #15628
2015-04-21 15:31:51 -04:00
kwantam
f43c86cda4 unstabilize Words struct
Words struct was stabilied by mistake. Unstabilize.
2015-04-21 15:31:45 -04:00
Steve Klabnik
b0105b5a59 TRPL editing: tuple structs 2015-04-21 15:25:43 -04:00
Alex Crichton
0791f9f406 test: Fix fallout in tests 2015-04-21 11:37:43 -07:00
Alex Crichton
eeb94886ad std: Remove deprecated/unstable num functionality
This commit removes all the old casting/generic traits from `std::num` that are
no longer in use by the standard library. This additionally removes the old
`strconv` module which has not seen much use in quite a long time. All generic
functionality has been supplanted with traits in the `num` crate and the
`strconv` module is supplanted with the [rust-strconv crate][rust-strconv].

[rust-strconv]: https://github.com/lifthrasiir/rust-strconv

This is a breaking change due to the removal of these deprecated crates, and the
alternative crates are listed above.

[breaking-change]
2015-04-21 11:37:43 -07:00
Alex Crichton
e091ba3f3e std: Remove deprecated AsPath trait 2015-04-21 11:37:35 -07:00
Alex Crichton
69ded69d63 std: Remove deprecated AsOsStr/Str/AsSlice traits
Cleaning out more deprecated items
2015-04-21 11:37:34 -07:00
Alex Crichton
9ab0475d94 rustc: Handle duplicate names merging archives
When linking an archive statically to an rlib, the compiler will extract all
contents of the archive and add them all to the rlib being generated. The
current method of extraction is to run `ar x`, dumping all files into a
temporary directory. Object archives, however, are allowed to have multiple
entries with the same file name, so there is no method for them to extract their
contents into a directory in a lossless fashion.

This commit adds iterator support to the `ArchiveRO` structure which hooks into
LLVM's support for reading object archives. This iterator is then used to
inspect each object in turn and extract it to a unique location for later
assembly.
2015-04-21 11:08:19 -07:00
Brian Anderson
5c70ff09da Bump version to 1.1.0
Also reset the prerelease number to ".1"
2015-04-21 10:51:53 -07:00
Steve Klabnik
f0a3b6c509 Add research to README of TRPL
This section was added but the list wasn't updated.
2015-04-21 13:49:23 -04:00
Erick Tryzelaar
19c8d70174 syntax: Copy unstable str::char_at into libsyntax 2015-04-21 10:23:53 -07:00
Steve Klabnik
0070625495 small edits for recently written book chapters 2015-04-21 13:17:43 -04:00
Erick Tryzelaar
7f9180fcb9 syntax: Change ExpnId::{from,to}_llvm_cookie to {from,to}_u32 2015-04-21 10:11:05 -07:00
Erick Tryzelaar
83b1d7fd6f syntax: Remove #[feature(path_ext)]
Replace Path::exists with stable metadata call.
2015-04-21 10:09:27 -07:00
Erick Tryzelaar
c3da1a1912 syntax: replace Vec::push_all with stable Vec::extend 2015-04-21 10:09:26 -07:00
Erick Tryzelaar
21143aae94 syntax: Replace Vec::map_in_place with stable mut iterator 2015-04-21 10:08:57 -07:00
Erick Tryzelaar
a2cfe38505 syntax: Replace [].tail with the stable [1..] syntax 2015-04-21 10:08:27 -07:00
Erick Tryzelaar
2937cce70c syntax: Replace String::from_str with the stable String::from 2015-04-21 10:08:27 -07:00
Erick Tryzelaar
8553658952 syntax: remove #[feature(quote, unsafe_destructor)] 2015-04-21 10:08:27 -07:00