]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoAuto merge of #24695 - bluss:arc-default, r=alexcrichton
bors [Thu, 23 Apr 2015 21:42:32 +0000 (21:42 +0000)]
Auto merge of #24695 - bluss:arc-default, r=alexcrichton

Relax bounds on Default implementation for Arc.

Send + Sync are overly restrictive, follow other traits for Arc.

9 years agoAuto merge of #24615 - arielb1:rapid-reject, r=nikomatsakis
bors [Thu, 23 Apr 2015 19:39:40 +0000 (19:39 +0000)]
Auto merge of #24615 - arielb1:rapid-reject, r=nikomatsakis

skolemize_late_bound_regions essentially copies the entire type (most of the times it shouldn't, but it does), and match_impl runs millions of times.

Times compiling rustc, tested with
$ make -j4 rustc-stage1
$ ( time RUSTFLAGS=-Z time-passes make -j4 rustc-stage2 ) # need LLVM time for calibration

Before:
real 21m44.960s
user 29m38.812s
sys 0m14.944s

After:
real 19m31.445s
user 26m47.260s
sys 0m14.952s

Making this is a 10% performance improvement.

LLVM passes took 867 seconds before, 862 seconds after.

9 years agoAuto merge of #24537 - rprichard:fix-parallel-check, r=alexcrichton
bors [Thu, 23 Apr 2015 17:32:16 +0000 (17:32 +0000)]
Auto merge of #24537 - rprichard:fix-parallel-check, r=alexcrichton

This required fixing the `pretty-rpass-full` tests to have the same `$$(CSREQ$(1)_T_$(2)_H_$(3))`  dependencies as the `rpass-full` and `cfail-full` tests.  It also required fixing the `run-make/simd-ffi` test to use unique names for its output files.

9 years agoAuto merge of #24694 - liigo:toggle-all-docs-using-one-link, r=alexcrichton
bors [Thu, 23 Apr 2015 14:09:10 +0000 (14:09 +0000)]
Auto merge of #24694 - liigo:toggle-all-docs-using-one-link, r=alexcrichton

Combine the two links, [-] and [+], at top-right corner of the page, to use a single and the same one, so that:

- one less link to be created/displayed
- be consistent with other [-]/[+] links in the same page
- people can easily toggle docs without moving their mouse pointer

I also added tooltips/titles to these links.

9 years agoAuto merge of #24664 - steveklabnik:doc_ufcs, r=alexcrichton
bors [Thu, 23 Apr 2015 12:04:01 +0000 (12:04 +0000)]
Auto merge of #24664 - steveklabnik:doc_ufcs, r=alexcrichton

AKA, two four-letter acronyms :wink:

This feels a bit light, if there's other things I should add, let me know.

9 years agoAuto merge of #24714 - frewsxcv:patch-15, r=alexcrichton
bors [Thu, 23 Apr 2015 09:58:12 +0000 (09:58 +0000)]
Auto merge of #24714 - frewsxcv:patch-15, r=alexcrichton

9 years agoAuto merge of #24704 - brson:installer, r=alexcrichton
bors [Thu, 23 Apr 2015 07:56:17 +0000 (07:56 +0000)]
Auto merge of #24704 - brson:installer, r=alexcrichton

r? @alexcrichton

9 years agoIndicate trait names in doc-comment are code-like
Corey Farwell [Thu, 23 Apr 2015 05:27:11 +0000 (01:27 -0400)]
Indicate trait names in doc-comment are code-like

9 years agoAuto merge of #24693 - brson:beta, r=alexcrichton
bors [Thu, 23 Apr 2015 04:50:39 +0000 (04:50 +0000)]
Auto merge of #24693 - brson:beta, r=alexcrichton

Instead of rustc-1.0.0-beta-$triple.tar.gz, betas will be named
rustc-beta-$triple.tar.gz. This will give betas a stable download
URL, prevent old artifacts from accumulating in the dist server's
root directory, and not require the website to be updated every
beta.

As a tradeoff, it will be harder to download previous betas because
they will need to be located in the archives.

I'm still unsure about whether this is the right choice.

cc @alexcrichton @steveklabnik

9 years agoInclude the mode in compiletest's aux-build directory.
Ryan Prichard [Thu, 23 Apr 2015 02:01:42 +0000 (19:01 -0700)]
Include the mode in compiletest's aux-build directory.

The run-pass and pretty run-pass tests could run concurrently, and if they
do, they need to keep their output segregated.

This change might be overkill. We need the suffix for the `pretty` mode,
but we might not need it otherwise. The `debuginfo-lldb` and
`debuginfo-gdb` modes look like they could also need it, but the current
`tests.mk` file happens not to enable both lldb and gdb at the same time,
for incidental reasons.

9 years agoReplace ignore-android with ignore-cross-compile in rustdoc tests
Ryan Prichard [Wed, 22 Apr 2015 22:22:36 +0000 (15:22 -0700)]
Replace ignore-android with ignore-cross-compile in rustdoc tests

The problem is that rustdoc searches for external crates using the host
triple, not the target triple. It's actually unclear to me whether this is
correct behavior or not, but it is necessary to get cross-compiled tests
working.

9 years agoIgnore cross-compilation in some fulldeps tests.
Ryan Prichard [Wed, 22 Apr 2015 22:20:57 +0000 (15:20 -0700)]
Ignore cross-compilation in some fulldeps tests.

These tests fail, in general, for cross-compilation, because they require
the rustc crates to exist for the target, and they don't. We can't compile
them for the target unless we also compile LLVM for the target (we don't).

Android is a subset of cross-compilation.

The other fulldeps tests, on the other hand, work fine for
cross-compilation, and in fact, are verifying that rustc correctly searches
for a host plugin crate, not a target plugin crate.

9 years agoFix run-make/simd-ffi to work with parallel make check.
Ryan Prichard [Fri, 17 Apr 2015 11:58:47 +0000 (04:58 -0700)]
Fix run-make/simd-ffi to work with parallel make check.

9 years agoFix the dependency for the pretty-rpass-full tests
Ryan Prichard [Fri, 17 Apr 2015 12:05:22 +0000 (05:05 -0700)]
Fix the dependency for the pretty-rpass-full tests

The current code attempts to define the
PRETTY_DEPS$(1)_H_$(3)_pretty-rpass-full variable, which does not work,
because $(1) and $(3) are not inside a function. Moreover, there is a test
(run-pass-fulldeps/compiler-calls.rs) that uses rustc_driver, which is not
an indirect dependency of librustc or libsyntax. Listing all the
dependencies will be hard to maintain, but there's a better way to do
this...

As with the rpass-full and cfail-full tests, add dependencies using the
$$(CSREQ$(1)_T_$(3)_H_$(3)) variable, which includes the complete set of
host and target crates, built for a particular stage and host. We use
T_$(3), not T_$(2), because we only build LLVM for host triples (not
target triples), so we can only build rustc_llvm for host triples. The
fulldeps tests that use plugins need host rustc crates, whereas fulldeps
tests that link against rustc and run should be skipped for
cross-compilation (such as Android).

Fixes #22021

9 years agoAuto merge of #24683 - P1start:help-suggestions, r=nrc
bors [Thu, 23 Apr 2015 02:45:06 +0000 (02:45 +0000)]
Auto merge of #24683 - P1start:help-suggestions, r=nrc

This PR uses the inline error suggestions introduced in #24242 to modify a few existing `help` messages. The new errors look like this:

    foobar.rs:5:12: 5:25 error: expected a path on the left-hand side of `+`,
                                not `&'static Copy` [E0178]
    foobar.rs:5     let x: &'static Copy + 'static;
                           ^~~~~~~~~~~~~
    foobar.rs:5:12: 5:35 help: try adding parentheses (per RFC 438):
    foobar.rs:      let x: &'static (Copy + 'static);

    foobar.rs:2:13: 2:23 error: cast to unsized type: `&_` as `core::marker::Copy`
    foobar.rs:2     let x = &1 as Copy;
                            ^~~~~~~~~~
    foobar.rs:2:19: 2:23 help: try casting to a reference instead:
    foobar.rs:      let x = &1 as &Copy;

    foobar.rs:7:24: 7:25 error: expected expression, found `;`
    foobar.rs:7     let x = box (1 + 1);
                                       ^
    foobar.rs:7:13: 7:16 help: try using `box()` instead:
    foobar.rs:      let x = box() (1 + 1);

This also modifies compiletest to give the ability to directly test suggestions given by error messages.

9 years agoAuto merge of #24703 - Manishearth:rollup, r=Manishearth
bors [Wed, 22 Apr 2015 23:25:32 +0000 (23:25 +0000)]
Auto merge of #24703 - Manishearth:rollup, r=Manishearth

r? @Manishearth

9 years agofix doctest
Manish Goregaokar [Wed, 22 Apr 2015 23:26:00 +0000 (04:56 +0530)]
fix doctest

9 years agoTRPL: UFCS
Steve Klabnik [Tue, 21 Apr 2015 16:07:00 +0000 (12:07 -0400)]
TRPL: UFCS

AKA, two four-letter acronyms :wink:

9 years agoconfigure: Fix CDPATH bug
Brian Anderson [Wed, 22 Apr 2015 21:52:35 +0000 (14:52 -0700)]
configure: Fix CDPATH bug

9 years agoRollup merge of #24688 - SimonSapin:fmt-write-char, r=alexcrichton
Manish Goregaokar [Wed, 22 Apr 2015 21:51:02 +0000 (03:21 +0530)]
Rollup merge of #24688 - SimonSapin:fmt-write-char, r=alexcrichton

… added in #24661.

9 years agoRollup merge of #24675 - steveklabnik:two_more_chapters, r=alexcrichton
Manish Goregaokar [Wed, 22 Apr 2015 21:51:02 +0000 (03:21 +0530)]
Rollup merge of #24675 - steveklabnik:two_more_chapters, r=alexcrichton

Two more chapters of TRPL. The `type` one is pretty straightforward, but I wasn't really sure what to put for unsized types. I just explained the very basics, and the special bounds syntax. Thoughts on what else should go here?

r? @alexcrichton

9 years agoRollup merge of #24673 - steveklabnik:doc_attributes, r=alexcrichton
Manish Goregaokar [Wed, 22 Apr 2015 21:51:02 +0000 (03:21 +0530)]
Rollup merge of #24673 - steveklabnik:doc_attributes, r=alexcrichton

r? @alexcrichton

9 years agoUpdate rust-installer. Fixes problems with CDPATH
Brian Anderson [Wed, 22 Apr 2015 21:49:01 +0000 (14:49 -0700)]
Update rust-installer. Fixes problems with CDPATH

9 years agoAuto merge of #24447 - alexcrichton:audit-thread, r=aturon
bors [Wed, 22 Apr 2015 18:48:31 +0000 (18:48 +0000)]
Auto merge of #24447 - alexcrichton:audit-thread, r=aturon

Much of this code hasn't been updated in quite some time and this commit does a
small audit of the functionality:

* Implementation functions now centralize all functionality on a locally defined
  `Thread` type.
* The `detach` method has been removed in favor of a `Drop` implementation. This
  notably fixes leaking thread handles on Windows.
* The `Thread` structure is now appropriately annotated with `Send` and `Sync`
  automatically on Windows and in a custom fashion on Unix.
* The unsafety of creating a thread has been pushed out to the right boundaries
  now.

Closes #24442

9 years agostd: Audit std::thread implementations
Alex Crichton [Wed, 15 Apr 2015 05:13:57 +0000 (22:13 -0700)]
std: Audit std::thread implementations

Much of this code hasn't been updated in quite some time and this commit does a
small audit of the functionality:

* Implementation functions now centralize all functionality on a locally defined
  `Thread` type.
* The `detach` method has been removed in favor of a `Drop` implementation. This
  notably fixes leaking thread handles on Windows.
* The `Thread` structure is now appropriately annotated with `Send` and `Sync`
  automatically on Windows and in a custom fashion on Unix.
* The unsafety of creating a thread has been pushed out to the right boundaries
  now.

Closes #24442

9 years agorustdoc: toggle collapse/expand all docs using the same link
Liigo Zhuang [Wed, 22 Apr 2015 16:50:19 +0000 (00:50 +0800)]
rustdoc: toggle collapse/expand all docs using the same link

9 years agoTRPL: type aliases and unsized types
Steve Klabnik [Tue, 21 Apr 2015 23:44:54 +0000 (19:44 -0400)]
TRPL: type aliases and unsized types

9 years agoRelax bounds on Default implementation for Arc.
Ulrik Sverdrup [Wed, 22 Apr 2015 17:05:51 +0000 (19:05 +0200)]
Relax bounds on Default implementation for Arc.

Send + Sync are overly restrictive, follow other traits for Arc.

9 years agomk: Remove version numbers from beta artifacts
Brian Anderson [Wed, 22 Apr 2015 15:51:39 +0000 (08:51 -0700)]
mk: Remove version numbers from beta artifacts

Instead of rustc-1.0.0-beta-$triple.tar.gz, betas will be named
rustc-beta-$triple.tar.gz. This will give betas a stable download
URL, prevent old artifacts from accumulating in the dist server's
root directory, and not require the website to be updated every
beta.

As a tradeoff, it will be harder to download previous betas because
they will need to be located in the archives.

9 years agoTRPL: attributes & conditional compilation
Steve Klabnik [Tue, 21 Apr 2015 22:52:01 +0000 (18:52 -0400)]
TRPL: attributes & conditional compilation

9 years agoAuto merge of #24692 - frewsxcv:rm-default-imports, r=alexcrichton
bors [Wed, 22 Apr 2015 14:41:25 +0000 (14:41 +0000)]
Auto merge of #24692 - frewsxcv:rm-default-imports, r=alexcrichton

In 8f5b5f94dcdb9884737dfbc8efd893d1d70f0b14, `default::Default` was
added to the prelude, so these imports are no longer necessary.

9 years agoRemove doc-comment default::Default imports
Corey Farwell [Wed, 22 Apr 2015 13:42:36 +0000 (09:42 -0400)]
Remove doc-comment default::Default imports

In 8f5b5f94dcdb9884737dfbc8efd893d1d70f0b14, `default::Default` was
added to the prelude, so these imports are no longer necessary.

9 years agoAuto merge of #24685 - nrc:span-pred, r=huonw
bors [Wed, 22 Apr 2015 08:47:09 +0000 (08:47 +0000)]
Auto merge of #24685 - nrc:span-pred, r=huonw

9 years agoAdd a test for std::fmt::Write::write_char
Simon Sapin [Wed, 22 Apr 2015 06:52:18 +0000 (08:52 +0200)]
Add a test for std::fmt::Write::write_char

9 years agoAuto merge of #24671 - steveklabnik:doc_const_static, r=alexcrichton
bors [Wed, 22 Apr 2015 06:37:57 +0000 (06:37 +0000)]
Auto merge of #24671 - steveklabnik:doc_const_static, r=alexcrichton

r? @alexcrichton

9 years agoFix spans for predicates in where clauses
Nick Cameron [Wed, 22 Apr 2015 06:29:54 +0000 (18:29 +1200)]
Fix spans for predicates in where clauses

9 years agoAuto merge of #24674 - alexcrichton:rollup, r=alexcrichton
bors [Wed, 22 Apr 2015 03:38:20 +0000 (03:38 +0000)]
Auto merge of #24674 - alexcrichton:rollup, r=alexcrichton

9 years agoTRPL: const and static
Steve Klabnik [Tue, 21 Apr 2015 18:59:42 +0000 (14:59 -0400)]
TRPL: const and static

9 years agoMerge remote-tracking branch 'origin/master' into rollup
Alex Crichton [Tue, 21 Apr 2015 23:27:26 +0000 (16:27 -0700)]
Merge remote-tracking branch 'origin/master' into rollup

9 years agoTest fixes and rebase conflicts, round 1
Alex Crichton [Tue, 21 Apr 2015 22:59:14 +0000 (15:59 -0700)]
Test fixes and rebase conflicts, round 1

9 years agorollup merge of #24636: alexcrichton/remove-deprecated
Alex Crichton [Tue, 21 Apr 2015 22:28:53 +0000 (15:28 -0700)]
rollup merge of #24636: alexcrichton/remove-deprecated

Conflicts:
src/libcore/result.rs

9 years agorollup merge of #24541: alexcrichton/issue-24538
Alex Crichton [Tue, 21 Apr 2015 22:28:06 +0000 (15:28 -0700)]
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

9 years agostd: Bring back f32::from_str_radix as an unstable API
Alex Crichton [Sat, 18 Apr 2015 06:45:55 +0000 (23:45 -0700)]
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.

9 years agorollup merge of #24672: steveklabnik/edit_tuple_structs
Alex Crichton [Tue, 21 Apr 2015 22:23:18 +0000 (15:23 -0700)]
rollup merge of #24672: steveklabnik/edit_tuple_structs

I thought I edited all the last little chapters, but I missed this one.

r? @alexcrichton

9 years agorollup merge of #24670: brson/1.1
Alex Crichton [Tue, 21 Apr 2015 22:23:17 +0000 (15:23 -0700)]
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"

9 years agorollup merge of #24669: steveklabnik/fix
Alex Crichton [Tue, 21 Apr 2015 22:23:17 +0000 (15:23 -0700)]
rollup merge of #24669: steveklabnik/fix

This section was added but the list wasn't updated.

9 years agorollup merge of #24667: steveklabnik/more_editing
Alex Crichton [Tue, 21 Apr 2015 22:23:16 +0000 (15:23 -0700)]
rollup merge of #24667: steveklabnik/more_editing

r? @alexcrichton

9 years agorollup merge of #24665: sw17ch/document-complete-slice-syntax
Alex Crichton [Tue, 21 Apr 2015 22:23:15 +0000 (15:23 -0700)]
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

9 years agorollup merge of #24663: steveklabnik/gh24639
Alex Crichton [Tue, 21 Apr 2015 22:23:14 +0000 (15:23 -0700)]
rollup merge of #24663: steveklabnik/gh24639

Fixes #24639

9 years agorollup merge of #24661: SimonSapin/fmt-write-char
Alex Crichton [Tue, 21 Apr 2015 22:23:13 +0000 (15:23 -0700)]
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

9 years agorollup merge of #24654: mdinger/patch-2
Alex Crichton [Tue, 21 Apr 2015 22:23:12 +0000 (15:23 -0700)]
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.

9 years agorollup merge of #24651: tamird/old-references
Alex Crichton [Tue, 21 Apr 2015 22:23:11 +0000 (15:23 -0700)]
rollup merge of #24651: tamird/old-references

r? @alexcrichton

9 years agorollup merge of #24640: steveklabnik/new_unsafe_guide
Alex Crichton [Tue, 21 Apr 2015 22:23:10 +0000 (15:23 -0700)]
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.

9 years agorollup merge of #24635: tamird/llvm-3.5
Alex Crichton [Tue, 21 Apr 2015 22:23:10 +0000 (15:23 -0700)]
rollup merge of #24635: tamird/llvm-3.5

r? @alexcrichton

9 years agorollup merge of #24611: doomsplayer/doomsplayer-patch-1
Alex Crichton [Tue, 21 Apr 2015 22:23:09 +0000 (15:23 -0700)]
rollup merge of #24611: doomsplayer/doomsplayer-patch-1

as dependency for #24594

9 years agorollup merge of #24563: kwantam/rfc_1054
Alex Crichton [Tue, 21 Apr 2015 22:23:08 +0000 (15:23 -0700)]
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

9 years agorollup merge of #24487: erickt/syntax
Alex Crichton [Tue, 21 Apr 2015 22:23:07 +0000 (15:23 -0700)]
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.

9 years agorollup merge of #24439: alexcrichton/fix-archive-assembler
Alex Crichton [Tue, 21 Apr 2015 22:23:06 +0000 (15:23 -0700)]
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.

9 years agorollup merge of #24222: lambda/rename-soft-link-to-symlink
Alex Crichton [Tue, 21 Apr 2015 22:23:06 +0000 (15:23 -0700)]
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

9 years agorollup merge of #24162: pnkfelix/fsk-detect-duplicate-loop-labels
Alex Crichton [Tue, 21 Apr 2015 22:23:05 +0000 (15:23 -0700)]
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

9 years agoAuto merge of #24162 - pnkfelix:fsk-detect-duplicate-loop-labels, r=nikomatsakis
bors [Tue, 21 Apr 2015 21:18:30 +0000 (21:18 +0000)]
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

9 years agoDocument functional update syntax
Steve Klabnik [Tue, 21 Apr 2015 15:18:33 +0000 (11:18 -0400)]
Document functional update syntax

Fixes #24639

9 years agoimplement rfc 1054: split_whitespace() fn, deprecate words()
kwantam [Sat, 18 Apr 2015 17:49:51 +0000 (13:49 -0400)]
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

9 years agounstabilize Words struct
kwantam [Tue, 21 Apr 2015 19:24:50 +0000 (15:24 -0400)]
unstabilize Words struct

Words struct was stabilied by mistake. Unstabilize.

9 years agoTRPL editing: tuple structs
Steve Klabnik [Tue, 21 Apr 2015 19:25:43 +0000 (15:25 -0400)]
TRPL editing: tuple structs

9 years agotest: Fix fallout in tests
Alex Crichton [Sat, 18 Apr 2015 05:12:20 +0000 (22:12 -0700)]
test: Fix fallout in tests

9 years agostd: Remove deprecated/unstable num functionality
Alex Crichton [Fri, 17 Apr 2015 22:32:42 +0000 (15:32 -0700)]
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]

9 years agostd: Remove deprecated AsPath trait
Alex Crichton [Fri, 17 Apr 2015 21:50:42 +0000 (14:50 -0700)]
std: Remove deprecated AsPath trait

9 years agostd: Remove deprecated AsOsStr/Str/AsSlice traits
Alex Crichton [Fri, 17 Apr 2015 21:49:49 +0000 (14:49 -0700)]
std: Remove deprecated AsOsStr/Str/AsSlice traits

Cleaning out more deprecated items

9 years agorustc: Handle duplicate names merging archives
Alex Crichton [Tue, 14 Apr 2015 23:28:50 +0000 (16:28 -0700)]
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.

9 years agoBump version to 1.1.0
Brian Anderson [Tue, 21 Apr 2015 17:51:53 +0000 (10:51 -0700)]
Bump version to 1.1.0

Also reset the prerelease number to ".1"

9 years agoAdd research to README of TRPL
Steve Klabnik [Tue, 21 Apr 2015 17:49:23 +0000 (13:49 -0400)]
Add research to README of TRPL

This section was added but the list wasn't updated.

9 years agosyntax: Copy unstable str::char_at into libsyntax
Erick Tryzelaar [Tue, 21 Apr 2015 17:19:53 +0000 (10:19 -0700)]
syntax: Copy unstable str::char_at into libsyntax

9 years agosmall edits for recently written book chapters
Steve Klabnik [Tue, 21 Apr 2015 17:17:43 +0000 (13:17 -0400)]
small edits for recently written book chapters

9 years agosyntax: Change ExpnId::{from,to}_llvm_cookie to {from,to}_u32
Erick Tryzelaar [Tue, 21 Apr 2015 00:51:10 +0000 (17:51 -0700)]
syntax: Change ExpnId::{from,to}_llvm_cookie to {from,to}_u32

9 years agosyntax: Remove #[feature(path_ext)]
Erick Tryzelaar [Sun, 19 Apr 2015 22:41:50 +0000 (15:41 -0700)]
syntax: Remove #[feature(path_ext)]

Replace Path::exists with stable metadata call.

9 years agosyntax: replace Vec::push_all with stable Vec::extend
Erick Tryzelaar [Fri, 17 Apr 2015 04:57:38 +0000 (21:57 -0700)]
syntax: replace Vec::push_all with stable Vec::extend

9 years agosyntax: Replace Vec::map_in_place with stable mut iterator
Erick Tryzelaar [Fri, 17 Apr 2015 04:38:24 +0000 (21:38 -0700)]
syntax: Replace Vec::map_in_place with stable mut iterator

9 years agosyntax: Replace [].tail with the stable [1..] syntax
Erick Tryzelaar [Fri, 17 Apr 2015 04:21:26 +0000 (21:21 -0700)]
syntax: Replace [].tail with the stable [1..] syntax

9 years agosyntax: Replace String::from_str with the stable String::from
Erick Tryzelaar [Fri, 17 Apr 2015 04:19:50 +0000 (21:19 -0700)]
syntax: Replace String::from_str with the stable String::from

9 years agosyntax: remove #[feature(quote, unsafe_destructor)]
Erick Tryzelaar [Fri, 17 Apr 2015 03:38:00 +0000 (20:38 -0700)]
syntax: remove #[feature(quote, unsafe_destructor)]

9 years agosyntax: Don't use unstable fn to convert single element to a slice
Erick Tryzelaar [Fri, 17 Apr 2015 02:56:37 +0000 (19:56 -0700)]
syntax: Don't use unstable fn to convert single element to a slice

9 years agosyntax: Remove use of TraitObject in pretty printer
Erick Tryzelaar [Fri, 17 Apr 2015 02:54:05 +0000 (19:54 -0700)]
syntax: Remove use of TraitObject in pretty printer

9 years agosyntax: remove uses of `.into_cow()`
Erick Tryzelaar [Thu, 16 Apr 2015 05:15:50 +0000 (22:15 -0700)]
syntax: remove uses of `.into_cow()`

9 years agosyntax: Remove uses of #[feature(slice_patterns)]
Erick Tryzelaar [Thu, 16 Apr 2015 05:12:12 +0000 (22:12 -0700)]
syntax: Remove uses of #[feature(slice_patterns)]

9 years agosyntax: remove #![feature(box_syntax, box_patterns)]
Erick Tryzelaar [Thu, 16 Apr 2015 03:56:16 +0000 (20:56 -0700)]
syntax: remove #![feature(box_syntax, box_patterns)]

9 years agoAdd an example of completely slicing an object.
John Van Enk [Tue, 21 Apr 2015 16:21:52 +0000 (09:21 -0700)]
Add an example of completely slicing an object.

9 years agoPick a feature name for write_char
Simon Sapin [Tue, 21 Apr 2015 16:16:08 +0000 (18:16 +0200)]
Pick a feature name for write_char

9 years agoDeprecate std::fs::soft_link in favor of platform-specific versions
Brian Campbell [Thu, 9 Apr 2015 07:22:44 +0000 (03:22 -0400)]
Deprecate std::fs::soft_link in favor of platform-specific versions

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`.

9 years agoadd notes clarifying introduction of warnings for a pair of run-pass tests.
Felix S. Klock II [Tue, 21 Apr 2015 07:58:06 +0000 (09:58 +0200)]
add notes clarifying introduction of warnings for a pair of run-pass tests.

9 years agoTests for shadowing between lifetimes and loop labels within function bodies.
Felix S. Klock II [Wed, 8 Apr 2015 16:37:47 +0000 (18:37 +0200)]
Tests for shadowing between lifetimes and loop labels within function bodies.

9 years agoCheck for shadowing between lifetimes and loop labels in function bodies.
Felix S. Klock II [Fri, 3 Apr 2015 00:51:38 +0000 (02:51 +0200)]
Check for shadowing between lifetimes and loop labels in function bodies.

Note: this Warns rather than error on shadowing problems involving labels.
We took this more conservative option mostly due to issues with
hygiene being broken for labels and/or lifetimes.

Add FIXME regarding non-hygienic comparison.

9 years agowrite_char is unlikely to make it for 1.0, it’ll be 1.1
Simon Sapin [Tue, 21 Apr 2015 16:06:00 +0000 (18:06 +0200)]
write_char is unlikely to make it for 1.0, it’ll be 1.1

9 years agoRemove references to `old_{path,io}`
Tamir Duberstein [Tue, 21 Apr 2015 02:01:20 +0000 (19:01 -0700)]
Remove references to `old_{path,io}`

9 years agoRemove dead test
Tamir Duberstein [Tue, 21 Apr 2015 01:52:28 +0000 (18:52 -0700)]
Remove dead test

This was moved to https://github.com/rust-lang/term/issues/12

9 years agoRemove unused files
Tamir Duberstein [Tue, 21 Apr 2015 01:50:20 +0000 (18:50 -0700)]
Remove unused files

Looks like these were missed in bf4e77d.

9 years agoadd TCP_* consts for linux
Young Wu [Tue, 21 Apr 2015 14:35:02 +0000 (22:35 +0800)]
add TCP_* consts for linux

9 years agoAuto merge of #24620 - pczarn:model-lexer-issues, r=cmr
bors [Tue, 21 Apr 2015 14:37:53 +0000 (14:37 +0000)]
Auto merge of #24620 - pczarn:model-lexer-issues, r=cmr

Fixes #15679
Fixes #15878
Fixes #15882
Closes #15883

9 years agoLLVM < 3.5 is unsupported since bb18a3c
Tamir Duberstein [Mon, 20 Apr 2015 17:19:02 +0000 (10:19 -0700)]
LLVM < 3.5 is unsupported since bb18a3c

9 years agoAdd a `write_char` method to `std::fmt::Write`
Simon Sapin [Tue, 21 Apr 2015 12:51:28 +0000 (14:51 +0200)]
Add a `write_char` method to `std::fmt::Write`

as accepted in [RFC 526](https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md).