]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agorollup merge of #21354: eddyb/vec-ufcs
Alex Crichton [Wed, 21 Jan 2015 17:13:55 +0000 (09:13 -0800)]
rollup merge of #21354: eddyb/vec-ufcs

There are two limitations to the macro that this addresses:
1. the expected type is not propagated, coercions don't trigger
2. references inside element expressions don't outlive the `Vec`

Both of these limitations are caused by the block in the
macro expansion, previously needed to trigger a coercion
from `Box<[T; N]>` to `Box<[T]>`, now possible with UFCS.

9 years agorollup merge of #21342: Diggsey/issue-21310
Alex Crichton [Wed, 21 Jan 2015 17:13:53 +0000 (09:13 -0800)]
rollup merge of #21342: Diggsey/issue-21310

Fixes #21310

9 years agorollup merge of #21340: pshc/libsyntax-no-more-ints
Alex Crichton [Wed, 21 Jan 2015 17:13:51 +0000 (09:13 -0800)]
rollup merge of #21340: pshc/libsyntax-no-more-ints

Collaboration with @rylev!

I didn't change `int` in the [quasi-quoter](https://github.com/pshc/rust/blob/99ae1a30f3ca28c0f7e431620560d30e44627124/src/libsyntax/ext/quote.rs#L328), because I'm not sure if there will be adverse effects.

Addresses #21095.

9 years agorollup merge of #21333: stepancheg/trans-write-diag
Alex Crichton [Wed, 21 Jan 2015 17:13:49 +0000 (09:13 -0800)]
rollup merge of #21333: stepancheg/trans-write-diag

File cannot be written, for example, if directory does not exist.

Before this commit:

```
% rustc -o nonexistent/program program.rs
error: could not write output: No such file or directory
```

With this commit:

```
% rustc -o nonexistent/program program.rs
error: could not write output to nonexistent/program.0.o: No such file or directory
```

This is useful when full rust command is not displayed, or when last error is followed by thousands of warnings.

9 years agorollup merge of #21289: brson/errorcodes
Alex Crichton [Wed, 21 Jan 2015 17:13:46 +0000 (09:13 -0800)]
rollup merge of #21289: brson/errorcodes

This does the bare minimum to make registration of error codes work again. After this patch, every call to `span_err!` with an error code gets that error code validated against a list in that crate and a new tidy script `errorck.py` validates that no error codes are duplicated globally.

There are further improvements to be made yet, detailed in #19624.

r? @nikomatsakis

9 years agorollup merge of #21274: estsauver/21270
Alex Crichton [Wed, 21 Jan 2015 17:13:43 +0000 (09:13 -0800)]
rollup merge of #21274: estsauver/21270

The timezone of the server that builds rustc nightlies
appears to be in UTC. From what I can tell, it builds
the nightlies at 0300 UTC, which takes about ~15 minutes.
So, there were a couple options here for which offset to use.

UTC+3 would ensure that you always got the latest rust, but it
would mean the script is broken ~15/20 minutes a day. UTC+4
means users get a stale nightly for 45 minutes, but that feels
okay to me.

Ideally, buildbot would publish the "current" nightly, but
that seems unneeded relative to fixing it for all Timezones
quickly.

Fixes #21270

9 years agorollup merge of #21157: steveklabnik/deprecation
Alex Crichton [Wed, 21 Jan 2015 17:13:42 +0000 (09:13 -0800)]
rollup merge of #21157: steveklabnik/deprecation

9 years agorollup merge of #21138: mkpankov/master
Alex Crichton [Wed, 21 Jan 2015 17:13:40 +0000 (09:13 -0800)]
rollup merge of #21138: mkpankov/master

When combined with '--save' and '--date', it uses previously saved
tarball, making possible to re-install in offline mode.
r?

9 years agorollup merge of #21053: apasel422/exact
Alex Crichton [Wed, 21 Jan 2015 17:13:38 +0000 (09:13 -0800)]
rollup merge of #21053: apasel422/exact

9 years agorollup merge of #19913: KOMON/rust-mode-emacs-indentation
Alex Crichton [Wed, 21 Jan 2015 17:13:36 +0000 (09:13 -0800)]
rollup merge of #19913: KOMON/rust-mode-emacs-indentation

I added an option to auto-indent method chains to line up along their '.' operators. Like so:

```
let input = io::stdin().readline()
                       .ok()
                       .expect("Failed to read line");
```

The old default would indent like so:
```
let input = io::stdin().readme()
    .ok()
    .expect("Failed to read line");
```

The Rust guide explicitly condones the former, so I thought it would be nice for the emacs mode to support it. It's off by default, you have to set ```rust-indent-method-chain``` to ```t``` via your .emacs or the customize menu

9 years agoImprove quality of String#to_slice() deprecation message
Steve Klabnik [Wed, 14 Jan 2015 21:05:32 +0000 (16:05 -0500)]
Improve quality of String#to_slice() deprecation message

9 years agoAuto merge of #21242 - richo:no-perl, r=brson
bors [Wed, 21 Jan 2015 11:07:31 +0000 (11:07 +0000)]
Auto merge of #21242 - richo:no-perl, r=brson

There's only one build-critical path in which perl is used, and it was to do a text replacement trivially achievable with sed(1).

I ported the indenter script because it [appears to be used][indenter], but removed check links because it appears to be entirely out of date.

[indenter]: https://github.com/rust-lang/rust/blob/master/src/librustc/util/common.rs#L60-70

9 years agoAuto merge of #21227 - sellibitze:core-ops-for-references, r=aturon
bors [Wed, 21 Jan 2015 09:02:44 +0000 (09:02 +0000)]
Auto merge of #21227 - sellibitze:core-ops-for-references, r=aturon

As discussed with @aturon I added implementations of various op traits for references to built-in types which was already suggested by the ops reform RFC.

The 2nd commit updates the module documentation of core::ops to fully reflect the recent change from pass-by-reference to pass-by-value and expands on the implications for generic code.

9 years agoAuto merge of #21395 - sfackler:fix-cvar-test, r=alexcrichton
bors [Wed, 21 Jan 2015 05:55:02 +0000 (05:55 +0000)]
Auto merge of #21395 - sfackler:fix-cvar-test, r=alexcrichton

r? @alexcrichton

9 years agoDisplay negative trait implementations correctly in rustdoc
Diggory Blake [Wed, 21 Jan 2015 04:35:57 +0000 (04:35 +0000)]
Display negative trait implementations correctly in rustdoc

Added doc test

9 years agoAuto merge of #21065 - ColonelJ:master, r=brson
bors [Wed, 21 Jan 2015 03:54:21 +0000 (03:54 +0000)]
Auto merge of #21065 - ColonelJ:master, r=brson

Removed use of unused LDPATH variable on Windows as is done for other platforms, and added GCC flag to ensure MINGW's ANSI compatible STDIO functions are used wherever available (required by jemalloc).

Without these changes it ends up setting the PATH twice, and the second time the PATH begins with `:` which is invalid.  Also the regular msvcrt printf-like functions would be used which don't understand stuff like %hhd and %z which jemalloc uses.

This change ought not to make any difference to the output but it fixes the build process for me since at least my build environment couldn't handle that broken path caused by LDPATH being empty.

9 years agoimplement `ExactSizeIterator` for `slice::{Chunks,ChunksMut}`
Andrew Paseltiner [Mon, 12 Jan 2015 22:08:53 +0000 (17:08 -0500)]
implement `ExactSizeIterator` for `slice::{Chunks,ChunksMut}`

9 years agoAuto merge of #21439 - alexcrichton:rollup, r=alexcrichton
bors [Tue, 20 Jan 2015 23:03:09 +0000 (23:03 +0000)]
Auto merge of #21439 - alexcrichton:rollup, r=alexcrichton

Continuation of https://github.com/rust-lang/rust/pull/21428

9 years agoMake multiline errors work with codes
Brian Anderson [Tue, 20 Jan 2015 22:18:35 +0000 (14:18 -0800)]
Make multiline errors work with codes

9 years agoChanged rust-mode code for tabs -> spaces
Daniel Raloff [Tue, 20 Jan 2015 22:07:10 +0000 (14:07 -0800)]
Changed rust-mode code for tabs -> spaces

9 years agoadd stability text like suggested in discussion
Sebastian Gesemann [Tue, 20 Jan 2015 21:35:42 +0000 (22:35 +0100)]
add stability text like suggested in discussion

9 years agoTest fixes and rebase conflicts
Alex Crichton [Tue, 20 Jan 2015 20:35:51 +0000 (12:35 -0800)]
Test fixes and rebase conflicts

9 years agoAuto merge of #20919 - fay-jai:update, r=brson
bors [Tue, 20 Jan 2015 19:56:43 +0000 (19:56 +0000)]
Auto merge of #20919 - fay-jai:update, r=brson

Only made 2 changes:
1) Update the year to 2015 in LICENSE-MIT
2) Update the year in COPYRIGHT

No other changes were made.

9 years agoAdd some extended errors.
Michael Sproul [Sun, 18 Jan 2015 01:20:24 +0000 (17:20 -0800)]
Add some extended errors.

9 years agoAdd error codes to rustc
Brian Anderson [Mon, 19 Jan 2015 00:58:25 +0000 (16:58 -0800)]
Add error codes to rustc

9 years agoAdd error codes to resolve
Brian Anderson [Sun, 18 Jan 2015 21:46:57 +0000 (13:46 -0800)]
Add error codes to resolve

9 years agoMake fatal errors work with codes, add to typeck
Brian Anderson [Sun, 18 Jan 2015 21:39:18 +0000 (13:39 -0800)]
Make fatal errors work with codes, add to typeck

9 years agoAdd error codes to rustc_typeck
Brian Anderson [Sat, 17 Jan 2015 21:36:59 +0000 (13:36 -0800)]
Add error codes to rustc_typeck

9 years agoMake error code registration work again. #19624
Brian Anderson [Fri, 16 Jan 2015 23:54:58 +0000 (15:54 -0800)]
Make error code registration work again. #19624

9 years agoRollup merge of #20991 - mneumann:llvm-dragonfly-take2, r=alexcrichton
Barosl LEE [Tue, 20 Jan 2015 17:16:53 +0000 (02:16 +0900)]
Rollup merge of #20991 - mneumann:llvm-dragonfly-take2, r=alexcrichton

It got accidentially reverted in 44440e5.

9 years agoRollup merge of #21179 - nodakai:reference-mod-to-self, r=huonw
Barosl LEE [Tue, 20 Jan 2015 17:16:53 +0000 (02:16 +0900)]
Rollup merge of #21179 - nodakai:reference-mod-to-self, r=huonw

This should have been done together with 56dcbd17fdad5d39b7b02e22a7490d2468718d08 for rust-lang/rust#20361

9 years agoRollup merge of #21427 - steveklabnik:generics_fix, r=alexcrichton
Barosl LEE [Tue, 20 Jan 2015 17:16:52 +0000 (02:16 +0900)]
Rollup merge of #21427 - steveklabnik:generics_fix, r=alexcrichton

Multiple people have asked me if this is a reference to Hacker News, and
I _certainly_ don't want to give them that impression.

9 years agoRollup merge of #21424 - sanxiyn:coerce-mut, r=nikomatsakis
Barosl LEE [Tue, 20 Jan 2015 17:16:52 +0000 (02:16 +0900)]
Rollup merge of #21424 - sanxiyn:coerce-mut, r=nikomatsakis

This is caught in borrowck now, but catching in typeck is faster and improves diagnostics.

CC #17561.

r? @nikomatsakis

9 years agoRollup merge of #21404 - japaric:hash, r=alexcrichton
Barosl LEE [Tue, 20 Jan 2015 17:16:52 +0000 (02:16 +0900)]
Rollup merge of #21404 - japaric:hash, r=alexcrichton

closes #21402
cc #15294

r? @alexcrichton or @aturon
cc @ExpHP (btw, this only covers arrays with arity up to 32)

9 years agoRollup merge of #21399 - kballard:fix-PLEASE_BENCH, r=Gankro
Barosl LEE [Tue, 20 Jan 2015 17:16:52 +0000 (02:16 +0900)]
Rollup merge of #21399 - kballard:fix-PLEASE_BENCH, r=Gankro

611ef49f2fa573edf9cff4442eddb8ee7e48878d removed all the metrics stuff
from tests.mk, but this meant that `PLEASE_BENCH=1` no longer did
anything.

Fixes #21324.

9 years agoRollup merge of #21388 - aochagavia:collections, r=Gankro
Barosl LEE [Tue, 20 Jan 2015 17:16:51 +0000 (02:16 +0900)]
Rollup merge of #21388 - aochagavia:collections, r=Gankro

**Breaking change**: `VecMap::into_iter` now consumes the `VecMap`. To fix it you should pass the VecMap by value instead of by reference.

[breaking-change]

r? @Gankro

9 years agoRollup merge of #21387 - retep998:hmodule, r=alexcrichton
Barosl LEE [Tue, 20 Jan 2015 17:16:51 +0000 (02:16 +0900)]
Rollup merge of #21387 - retep998:hmodule, r=alexcrichton

r? @alexcrichton

9 years agoRollup merge of #21386 - Diggsey:issue-21384, r=alexcrichton
Barosl LEE [Tue, 20 Jan 2015 17:16:51 +0000 (02:16 +0900)]
Rollup merge of #21386 - Diggsey:issue-21384, r=alexcrichton

Fixes #21384

9 years agoRollup merge of #21380 - tshepang:patch-3, r=steveklabnik
Barosl LEE [Tue, 20 Jan 2015 17:16:51 +0000 (02:16 +0900)]
Rollup merge of #21380 - tshepang:patch-3, r=steveklabnik

9 years agoRollup merge of #21123 - visualfc:master, r=alexcrichton
Barosl LEE [Tue, 20 Jan 2015 17:16:51 +0000 (02:16 +0900)]
Rollup merge of #21123 - visualfc:master, r=alexcrichton

example:
let m = "hello \
           world";

9 years agoRollup merge of #21377 - iKevinY:speedy-tidy, r=huonw
Barosl LEE [Tue, 20 Jan 2015 17:16:50 +0000 (02:16 +0900)]
Rollup merge of #21377 - iKevinY:speedy-tidy, r=huonw

`x in y` is more Pythonic than `y.find(x) != -1`. I believe it runs quite a bit faster as well (though it's probably not a bottleneck of the Travis builds):

```bash
$ python -m timeit '"abc".find("a") != -1'
1000000 loops, best of 3: 0.218 usec per loop
$ python -m timeit '"a" in "abc"'
10000000 loops, best of 3: 0.0343 usec per loop
```

9 years agoRollup merge of #21375 - petrochenkov:ssbsl, r=alexcrichton
Barosl LEE [Tue, 20 Jan 2015 17:16:50 +0000 (02:16 +0900)]
Rollup merge of #21375 - petrochenkov:ssbsl, r=alexcrichton

After PR #19766 added implicit coersions `*mut T -> *const T`, the explicit casts can be removed.
(The number of such casts turned out to be relatively small).

9 years agoRollup merge of #21369 - iKevinY:no-travis-notes, r=sanxiyn
Barosl LEE [Tue, 20 Jan 2015 17:16:49 +0000 (02:16 +0900)]
Rollup merge of #21369 - iKevinY:no-travis-notes, r=sanxiyn

Updated `tidy.py` to skip printing NOTEs if the [`TRAVIS`](http://docs.travis-ci.com/user/ci-environment/#Environment-variables) environment variable is set.

9 years agoRollup merge of #21359 - WiSaGaN:bugfix/fix_marker, r=alexcrichton
Barosl LEE [Tue, 20 Jan 2015 17:16:49 +0000 (02:16 +0900)]
Rollup merge of #21359 - WiSaGaN:bugfix/fix_marker, r=alexcrichton

From std::markers to std::marker.

9 years agoRollup merge of #21358 - glacjay:patch-2, r=alexcrichton
Barosl LEE [Tue, 20 Jan 2015 17:16:49 +0000 (02:16 +0900)]
Rollup merge of #21358 - glacjay:patch-2, r=alexcrichton

9 years agoRollup merge of #21357 - kimroen:patch-1, r=sanxiyn
Barosl LEE [Tue, 20 Jan 2015 17:16:49 +0000 (02:16 +0900)]
Rollup merge of #21357 - kimroen:patch-1, r=sanxiyn

Having both "Right now" and "at the moment" in the same statement is redundant.

9 years agoRollup merge of #21100 - tstorch:small_readability_update, r=alexcrichton
Barosl LEE [Tue, 20 Jan 2015 17:16:48 +0000 (02:16 +0900)]
Rollup merge of #21100 - tstorch:small_readability_update, r=alexcrichton

Why not use what is there?

9 years agoRollup merge of #21345 - glacjay:patch-1, r=alexcrichton
Barosl LEE [Tue, 20 Jan 2015 17:16:48 +0000 (02:16 +0900)]
Rollup merge of #21345 - glacjay:patch-1, r=alexcrichton

The reference should be `x`, not `FOO` itself.

9 years agoRollup merge of #21339 - thorncp:api-docs-search, r=alexcrichton
Barosl LEE [Tue, 20 Jan 2015 17:16:48 +0000 (02:16 +0900)]
Rollup merge of #21339 - thorncp:api-docs-search, r=alexcrichton

Increases the delay of the search box to 500ms after key up. I tried
adding a three character minimum for setting the delay, but didn't find
it very useful.

Should close #20095

@Jurily, your input is welcome!

9 years agoRollup merge of #21336 - rylev:better-nofile-error, r=brson
Barosl LEE [Tue, 20 Jan 2015 17:16:48 +0000 (02:16 +0900)]
Rollup merge of #21336 - rylev:better-nofile-error, r=brson

Contribution from @look!

Addresses https://github.com/rust-lang/rust/issues/21329

9 years agoRollup merge of #21331 - michaelsproul:sync-error-impls, r=alexcrichton
Barosl LEE [Tue, 20 Jan 2015 17:16:47 +0000 (02:16 +0900)]
Rollup merge of #21331 - michaelsproul:sync-error-impls, r=alexcrichton

Two errors in `std::sync` are currently missing implementations of the standard error trait because they contain types which aren't `Send`.

This PR therefore requires #21312.

9 years agoRollup merge of #21048 - aroben:patch-1, r=steveklabnik
Barosl LEE [Tue, 20 Jan 2015 17:16:47 +0000 (02:16 +0900)]
Rollup merge of #21048 - aroben:patch-1, r=steveklabnik

Now both the enum values and the prose describing them mention the values in the same order.

9 years agoRollup merge of #21326 - look:nano-syntax-highlighting, r=kmcallister
Barosl LEE [Tue, 20 Jan 2015 17:16:47 +0000 (02:16 +0900)]
Rollup merge of #21326 - look:nano-syntax-highlighting, r=kmcallister

rust.nanorc provides syntax highlighting for Rust. An attempt has been made to make the syntax highlighting look good on both dark and light terminals. Issue #21286.

This PR is dedicated to @substars and nano-lovers everywhere.

9 years agoRollup merge of #21314 - fenhl:patch-1, r=steveklbanik
Barosl LEE [Tue, 20 Jan 2015 17:16:47 +0000 (02:16 +0900)]
Rollup merge of #21314 - fenhl:patch-1, r=steveklbanik

See [this document](https://gist.github.com/0xabad1dea/8870b192fd1758743f66) by @0xabad1dea for the rationale.

9 years agoRollup merge of #21312 - michaelsproul:remove-error-send-bound, r=aturon
Barosl LEE [Tue, 20 Jan 2015 17:16:47 +0000 (02:16 +0900)]
Rollup merge of #21312 - michaelsproul:remove-error-send-bound, r=aturon

As discussed with @aturon, this PR removes the `Send` bound from `std::error::Error`, allowing us to implement `Error` for error types containing non-`Send` types. Current examples include `PoisonError` and `TryLockError` from `std::sync` which contain a Guard that we don't want sent between tasks.

[breaking-change]

9 years agoRollup merge of #21309 - thorncp:rustdoc-man-page, r=kmcallister
Barosl LEE [Tue, 20 Jan 2015 17:16:46 +0000 (02:16 +0900)]
Rollup merge of #21309 - thorncp:rustdoc-man-page, r=kmcallister

Brings the rustdoc man page in sync with the options specified in
src/librustdoc/lib.rs. The text was taken verbatim, but I tweaked the
order to be (what I think is) somewhat logical.

This should close #13622.

9 years agoRollup merge of #21302 - gutworth:rm-find-equiv-test, r=brson
Barosl LEE [Tue, 20 Jan 2015 17:16:46 +0000 (02:16 +0900)]
Rollup merge of #21302 - gutworth:rm-find-equiv-test, r=brson

9 years agoRollup merge of #21294 - alfie:typo, r=steveklabnik
Barosl LEE [Tue, 20 Jan 2015 17:16:46 +0000 (02:16 +0900)]
Rollup merge of #21294 - alfie:typo, r=steveklabnik

Wrong verb.

9 years agoRollup merge of #21355 - alfie:suffix, r=steveklabnik
Barosl LEE [Tue, 20 Jan 2015 17:16:46 +0000 (02:16 +0900)]
Rollup merge of #21355 - alfie:suffix, r=steveklabnik

More [u]int => [i|u]size and [i|u] => [i|u]s changes

9 years agoRollup merge of #21280 - timparenti:old-guide-stub-grammar, r=alexcrichton
Barosl LEE [Tue, 20 Jan 2015 17:16:45 +0000 (02:16 +0900)]
Rollup merge of #21280 - timparenti:old-guide-stub-grammar, r=alexcrichton

This removes the extra "the" from the phrase "the the Rust Programming Language book", which isn't particularly grammatical, in stub documents introduced in #20802 to direct users from the old guides to the corresponding sections of the book.

9 years agoRollup merge of #20998 - estsauver:20984, r=steveklabnik
Barosl LEE [Tue, 20 Jan 2015 17:16:45 +0000 (02:16 +0900)]
Rollup merge of #20998 - estsauver:20984, r=steveklabnik

There are a large number of places that incorrectly refer
to deriving in comments, instead of derives.

If someone could look at src/etc/generate-deriving-span-tests.py,
I'm not sure how those tests were passing before/if they were.

9 years agoSmall fix in TRPL 3.9
Steve Klabnik [Tue, 20 Jan 2015 16:36:27 +0000 (11:36 -0500)]
Small fix in TRPL 3.9

Multiple people have asked me if this is a reference to Hacker News, and
I _certainly_ don't want to give them that impression.

9 years agoAuto merge of #19353 - icorderi:docs/grammar, r=steveklabnik
bors [Tue, 20 Jan 2015 16:05:33 +0000 (16:05 +0000)]
Auto merge of #19353 - icorderi:docs/grammar, r=steveklabnik

Original [issue](https://github.com/rust-lang/rust/issues/19278) that inspired this patch.

The [reference.md] has evolved past simple grammatical constructs, and it serves a different purpose.
The intent for the proposed _grammar.md_ is to hold **only** the official reference for the language grammar. This document would keep track of grammatical changes to the language over time, facilitate discussions over proposed changes to the existing grammar, and serve as basis for building parsers by third-parties (IDE's, GitHub linguist, CodeMirror, etc.).

The current state of the PR contains all the grammars that were available in [reference.md] and nothing else.
There are still a lot of missing pieces that weren't available. The following are just a few of the definitions missing:
- [Functions](https://github.com/icorderi/rust/blob/docs/grammar/src/doc/grammar.md#functions)
- [Structures](https://github.com/icorderi/rust/blob/docs/grammar/src/doc/grammar.md#structures)
- [Traits](https://github.com/icorderi/rust/blob/docs/grammar/src/doc/grammar.md#traits)
- [Implementations](https://github.com/icorderi/rust/blob/docs/grammar/src/doc/grammar.md#implementations)
- [Operators](https://github.com/icorderi/rust/blob/docs/grammar/src/doc/grammar.md#unary-operator-expressions)
- [Statements](https://github.com/icorderi/rust/blob/docs/grammar/src/doc/grammar.md#statements)
- [Expressions](https://github.com/icorderi/rust/blob/docs/grammar/src/doc/grammar.md#expressions)

[reference.md]: https://github.com/rust-lang/rust/blob/master/src/doc/reference.md

We need help from people familiar with those grammatical constructs to fill in the missing pieces.

9 years agoForbid coercing &T to &mut T
Seo Sanghyeon [Tue, 20 Jan 2015 13:56:53 +0000 (22:56 +0900)]
Forbid coercing &T to &mut T

9 years agoAuto merge of #21364 - cmr:fix-ttseq-ice, r=alexcrichton
bors [Tue, 20 Jan 2015 13:36:03 +0000 (13:36 +0000)]
Auto merge of #21364 - cmr:fix-ttseq-ice, r=alexcrichton

Closes #21350

9 years agoAuto merge of #21304 - lifthrasiir:htmldocck, r=alexcrichton
bors [Tue, 20 Jan 2015 06:45:02 +0000 (06:45 +0000)]
Auto merge of #21304 - lifthrasiir:htmldocck, r=alexcrichton

The script is intended as a tool for doing every sort of verifications amenable to Rustdoc's HTML output. For example, link checkers would go to this script. It already parses HTML into a document tree form (with a slight caveat), so future tests can make use of it.

As an example, relevant `rustdoc-*` run-make tests have been updated to use `htmldocck.py` and got their `verify.sh` removed. In the future they may go to a dedicated directory with htmldocck running by default. The detailed explanation of test scripts is provided as a docstring of htmldocck.

cc #19723

9 years agoAuto merge of #21287 - alexcrichton:issue-19872, r=huonw
bors [Tue, 20 Jan 2015 04:23:28 +0000 (04:23 +0000)]
Auto merge of #21287 - alexcrichton:issue-19872, r=huonw

cc #19872, this may help give some insight

9 years agoAuto merge of #21257 - alexcrichton:issue-20064, r=pnkfelix
bors [Tue, 20 Jan 2015 02:23:49 +0000 (02:23 +0000)]
Auto merge of #21257 - alexcrichton:issue-20064, r=pnkfelix

These two attributes are used to change the entry point into a Rust program, but
for now they're being put behind feature gates until we have a chance to think
about them a little more. The #[start] attribute specifically may have its
signature changed.

This is a breaking change to due the usage of these attributes generating errors
by default now. If your crate is using these attributes, add this to your crate
root:

    #![feature(start)] // if you're using the #[start] attribute
    #![feature(main)]  // if you're using the #[main] attribute

cc #20064

9 years agoAuto merge of #21165 - alexcrichton:second-pass-type-id, r=aturon
bors [Mon, 19 Jan 2015 23:35:12 +0000 (23:35 +0000)]
Auto merge of #21165 - alexcrichton:second-pass-type-id, r=aturon

This commit aims to stabilize the `TypeId` abstraction by moving it out of the
`intrinsics` module into the `any` module of the standard library. Specifically,

* `TypeId` is now defined at `std::any::TypeId`
* `TypeId::hash` has been removed in favor of an implementation of `Hash`.

This commit also performs a final pass over the `any` module, confirming the
following:

* `Any::get_type_id` remains unstable as *usage* of the `Any` trait will likely
  never require this, and the `Any` trait does not need to be implemented for
  any other types. As a result, this implementation detail can remain unstable
  until associated statics are implemented.
* `Any::downcast_ref` is now stable
* `Any::downcast_mut` is now stable
* `BoxAny` remains unstable. While a direct impl on `Box<Any>` is allowed today
  it does not allow downcasting of trait objects like `Box<Any + Send>` (those
  returned from `Thread::join`). This is covered by #18737.
* `BoxAny::downcast` is now stable.

9 years agoAuto merge of #19490 - oli-obk:json_non_string_key_maps, r=alexcrichton
bors [Mon, 19 Jan 2015 21:37:52 +0000 (21:37 +0000)]
Auto merge of #19490 - oli-obk:json_non_string_key_maps, r=alexcrichton

importing object type string key maps is still supported
writing them should be explicit, and can be done as follows

```rust
let some_tree_map : TreeMap<String, Json> = ...;
Json::Object(some_tree_map).to_writer(&mut writer);
```

related to #8335, #9028, #9142

9 years agoimpl Hash for arrays
Jorge Aparicio [Mon, 19 Jan 2015 20:16:48 +0000 (15:16 -0500)]
impl Hash for arrays

closes #21402
cc #15294

9 years agoAuto merge of #21278 - thchittenden:issue-21033-struct-var-pattern-fix, r=alexcrichton
bors [Mon, 19 Jan 2015 19:40:51 +0000 (19:40 +0000)]
Auto merge of #21278 - thchittenden:issue-21033-struct-var-pattern-fix, r=alexcrichton

Closes #21033. The new strategy for parsing a field pattern is to look 1 token ahead and if it's a colon, parse as "fieldname: pat", otherwise parse the shorthand form "(box) (ref) (mut) fieldname)". The previous strategy was to parse "(ref) (mut) fieldname" then if we encounter a colon, throw an error if either "ref" or "mut" were encountered.

9 years agoFix `make check PLEASE_BENCH=1`
Kevin Ballard [Mon, 19 Jan 2015 18:59:57 +0000 (10:59 -0800)]
Fix `make check PLEASE_BENCH=1`

611ef49f2fa573edf9cff4442eddb8ee7e48878d removed all the metrics stuff
from tests.mk, but this meant that `PLEASE_BENCH=1` no longer did
anything.

Fixes #21324.

9 years agoAuto merge of #20082 - pczarn:btree-bounded-iter, r=Gankro
bors [Mon, 19 Jan 2015 17:43:47 +0000 (17:43 +0000)]
Auto merge of #20082 - pczarn:btree-bounded-iter, r=Gankro

Part of collections reform v1, #18424
Also, iteration is simplified:
```
before
test btree::map::bench::iter_1000                          ... bench:     17177 ns/iter (+/- 6302)
test btree::map::bench::iter_100000                        ... bench:   1735731 ns/iter (+/- 23908)
test btree::map::bench::iter_20                            ... bench:       386 ns/iter (+/- 148)
after
test btree::map::bench::iter_1000                          ... bench:     15777 ns/iter (+/- 346)
test btree::map::bench::iter_100000                        ... bench:   1602604 ns/iter (+/- 73629)
test btree::map::bench::iter_20                            ... bench:       339 ns/iter (+/- 91)
```
cc @gereeter @cgaebel
r? @Gankro

9 years agoFix flaky condvar test
Steven Fackler [Mon, 19 Jan 2015 17:11:06 +0000 (09:11 -0800)]
Fix flaky condvar test

9 years agoFixes #21033 with accompanying test.
Tom Chittenden [Mon, 19 Jan 2015 16:58:01 +0000 (11:58 -0500)]
Fixes #21033 with accompanying test.

9 years agoImplement range and range_mut for BTree
Piotr Czarnecki [Tue, 13 Jan 2015 20:55:44 +0000 (21:55 +0100)]
Implement range and range_mut for BTree

Simplify BTree's iterators, too.

9 years agoAdd test for #21328
Adolfo Ochagavía [Mon, 19 Jan 2015 14:36:07 +0000 (15:36 +0100)]
Add test for #21328

9 years agoAuto merge of #21269 - alexcrichton:issue-6936, r=pnkfelix
bors [Mon, 19 Jan 2015 15:44:41 +0000 (15:44 +0000)]
Auto merge of #21269 - alexcrichton:issue-6936, r=pnkfelix

This commit modifies resolve to prevent conflicts with typedef names in the same
method that conflits are prevented with enum names. This is a breaking change
due to the differing semantics in resolve, and any errors generated on behalf of
this change require that a conflicting typedef, module, or structure to be
renamed so they do not conflict.

[breaking-change]
Closes #6936

9 years agoAdd a Drain iterator to VecMap
Adolfo Ochagavía [Mon, 19 Jan 2015 10:06:15 +0000 (11:06 +0100)]
Add a Drain iterator to VecMap

9 years agougly hack to convert BadHashMapKey error to general fmt::Error
Oliver 'ker' Schneider [Sat, 10 Jan 2015 09:13:11 +0000 (10:13 +0100)]
ugly hack to convert BadHashMapKey error to general fmt::Error

9 years agoadd unit test for non string/numeric map keys
Oliver 'ker' Schneider [Sat, 10 Jan 2015 09:14:38 +0000 (10:14 +0100)]
add unit test for non string/numeric map keys

9 years agolower FnMut to FnOnce since json-hack is no longer required
Oliver 'ker' Schneider [Sat, 10 Jan 2015 09:14:32 +0000 (10:14 +0100)]
lower FnMut to FnOnce since json-hack is no longer required

Conflicts:
src/libserialize/serialize.rs

9 years agojson-encoder: report error when hash map key is not string or numeric
Oliver 'ker' Schneider [Sat, 10 Jan 2015 09:14:19 +0000 (10:14 +0100)]
json-encoder: report error when hash map key is not string or numeric

9 years agoAuto merge of #21282 - Aatch:init-memzero, r=alexcrichton
bors [Mon, 19 Jan 2015 12:17:07 +0000 (12:17 +0000)]
Auto merge of #21282 - Aatch:init-memzero, r=alexcrichton

LLVM gets overwhelmed when presented with a zeroinitializer for a large
type. In unoptimised builds, it generates a long sequence of stores to
memory. In optmised builds, it manages to generate a standard memset of
zero values, but takes a long time doing so.

Call out to the `llvm.memset` function to zero out the memory instead.

Fixes #21264

9 years agoAuto merge of #20874 - klutzy:windows-dynamic-lib, r=alexcrichton
bors [Mon, 19 Jan 2015 10:19:23 +0000 (10:19 +0000)]
Auto merge of #20874 - klutzy:windows-dynamic-lib, r=alexcrichton

This is a [breaking-change] since `std::dynamic_lib::dl` is now
private.

When `LoadLibraryW()` fails, original code called `errno()` to get error
code.  However, there was local allocation of `Vec` before
`LoadLibraryW()`, and it drops before `errno()`, and the drop
(deallocation) changed `errno`! Therefore `dynamic_lib::open()` thought
it always succeeded.
This commit fixes the issue.

This commit also sets Windows error mode during `LoadLibrary()` to
prevent "dll load failed" dialog.

9 years agoMake VecMap::into_iter consume the VecMap
Adolfo Ochagavía [Mon, 19 Jan 2015 09:48:01 +0000 (10:48 +0100)]
Make VecMap::into_iter consume the VecMap

This is a breaking change. To fix it you should pass the VecMap by value
instead of by reference.

[breaking-change]

9 years agoFix HMODULE
Peter Atashian [Mon, 19 Jan 2015 08:43:44 +0000 (03:43 -0500)]
Fix HMODULE

Signed-off-by: Peter Atashian <retep998@gmail.com>
9 years agoAuto merge of #21099 - sanxiyn:opt-return-ty, r=alexcrichton
bors [Mon, 19 Jan 2015 08:22:58 +0000 (08:22 +0000)]
Auto merge of #21099 - sanxiyn:opt-return-ty, r=alexcrichton

This avoids having ast::Ty nodes which have no counterpart in the source.

9 years agoRanges implement Clone where possible
Diggory Blake [Mon, 19 Jan 2015 05:43:15 +0000 (05:43 +0000)]
Ranges implement Clone where possible

9 years agolibsyntax: 0u -> 0us, 0i -> 0is
Paul Collier [Sun, 18 Jan 2015 00:41:56 +0000 (00:41 +0000)]
libsyntax: 0u -> 0us, 0i -> 0is

9 years agolibsyntax: int types -> isize
Paul Collier [Sun, 18 Jan 2015 00:18:19 +0000 (00:18 +0000)]
libsyntax: int types -> isize

9 years agolibsyntax: int => i32 in appropriate places
Paul Collier [Sat, 17 Jan 2015 23:55:21 +0000 (23:55 +0000)]
libsyntax: int => i32 in appropriate places

9 years agostd: Stabilize TypeId and tweak BoxAny
Alex Crichton [Thu, 15 Jan 2015 00:08:07 +0000 (16:08 -0800)]
std: Stabilize TypeId and tweak BoxAny

This commit aims to stabilize the `TypeId` abstraction by moving it out of the
`intrinsics` module into the `any` module of the standard library. Specifically,

* `TypeId` is now defined at `std::any::TypeId`
* `TypeId::hash` has been removed in favor of an implementation of `Hash`.

This commit also performs a final pass over the `any` module, confirming the
following:

* `Any::get_type_id` remains unstable as *usage* of the `Any` trait will likely
  never require this, and the `Any` trait does not need to be implemented for
  any other types. As a result, this implementation detail can remain unstable
  until associated statics are implemented.
* `Any::downcast_ref` is now stable
* `Any::downcast_mut` is now stable
* `BoxAny` remains unstable. While a direct impl on `Box<Any>` is allowed today
  it does not allow downcasting of trait objects like `Box<Any + Send>` (those
  returned from `Thread::join`). This is covered by #18737.
* `BoxAny::downcast` is now stable.

9 years agoFix typedef/module name conflicts in the compiler
Alex Crichton [Fri, 16 Jan 2015 22:27:43 +0000 (14:27 -0800)]
Fix typedef/module name conflicts in the compiler

9 years agorustc_resolve: Do not allow mods to shadow types
Alex Crichton [Fri, 16 Jan 2015 22:25:45 +0000 (14:25 -0800)]
rustc_resolve: Do not allow mods to shadow types

This commit modifies resolve to prevent conflicts with typedef names in the same
method that conflits are prevented with enum names. This is a breaking change
due to the differing semantics in resolve, and any errors generated on behalf of
this change require that a conflicting typedef, module, or structure to be
renamed so they do not conflict.

[breaking-change]
Closes #6936

9 years agorustc_resolve: De-indent by breaking out of match
Alex Crichton [Fri, 16 Jan 2015 20:57:20 +0000 (12:57 -0800)]
rustc_resolve: De-indent by breaking out of match

Helps reduce some rightward drift

9 years agoMake date of nightly in rustup match server TZ
Earl St Sauver [Sat, 17 Jan 2015 00:54:11 +0000 (16:54 -0800)]
Make date of nightly in rustup match server TZ

9 years agoAuto merge of #21267 - danslapman:master, r=alexcrichton
bors [Mon, 19 Jan 2015 01:45:36 +0000 (01:45 +0000)]
Auto merge of #21267 - danslapman:master, r=alexcrichton

This patch fixes IP_ADD_MEMBERSHIP problem described here: https://github.com/rust-lang/rust/issues/20381

I've tested on my ProbeR project, everything seems ok.

9 years agodoc: typo fix
Tshepang Lekhonkhobe [Mon, 19 Jan 2015 01:14:36 +0000 (03:14 +0200)]
doc: typo fix