]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoupdate mailmap for @pliniker
Steve Klabnik [Tue, 31 Jan 2017 18:19:03 +0000 (13:19 -0500)]
update mailmap for @pliniker

7 years agoAuto merge of #39379 - segevfiner:fix-backtraces-on-i686-pc-windows-gnu, r=alexcrichton
bors [Tue, 31 Jan 2017 11:18:22 +0000 (11:18 +0000)]
Auto merge of #39379 - segevfiner:fix-backtraces-on-i686-pc-windows-gnu, r=alexcrichton

Fix backtraces on i686-pc-windows-gnu by disabling FPO

This might have performance implications. But do note that MSVC
disables FPO by default nowadays and it's use is limited in exception
heavy languages like C++.

See discussion in: #39234
Closes: #28218
7 years agoAuto merge of #39354 - alexcrichton:less-output, r=steveklabnik
bors [Tue, 31 Jan 2017 08:44:07 +0000 (08:44 +0000)]
Auto merge of #39354 - alexcrichton:less-output, r=steveklabnik

rustdoc: Suppress warnings/errors with --test

Threads spawned by the test framework have their output captured by default, so
for `rustdoc --test` threads this propagates that capturing to the spawned
thread that we now have.

Closes #39327

7 years agoAuto merge of #38847 - michaelwoerister:gate-on-incr-comp, r=alexcrichton
bors [Tue, 31 Jan 2017 06:13:05 +0000 (06:13 +0000)]
Auto merge of #38847 - michaelwoerister:gate-on-incr-comp, r=alexcrichton

travis: Gate on some minimal support for incremental compilation.

This commit adds a travis job that

1. builds a stage2 compiler in incremental mode (but with empty incremental compilation cache), and
2. builds and runs the run-pass test suite also in incremental mode.

Building incrementally with an empty cache makes sure that the compiler doesn't crash in dependency tracking during bootstrapping. Executing the incrementally built test suite gives some measure of confidence that we generate valid code.

Note, however, that the above does not give strong guarantees about the validity of incremental compilation, it just provides a basis for being able to rely on from-scratch incr. comp. builds as reference values in further tests (which then do actual incremental compilation).

r? @alexcrichton

7 years agoAuto merge of #39250 - cseale:issue_30924, r=est31
bors [Tue, 31 Jan 2017 03:28:12 +0000 (03:28 +0000)]
Auto merge of #39250 - cseale:issue_30924, r=est31

[Gate Tests] - marking feature tests

Removal of the lang feature gate tests whitelist #39059

r? @est31

7 years ago[Gate Tests] - marking feature tests
Colm Seale [Sun, 22 Jan 2017 23:35:08 +0000 (23:35 +0000)]
[Gate Tests] - marking feature tests

Removal of the lang feature gate tests whitelist #39059

r? @est31

7 years agoAuto merge of #39230 - petrochenkov:nobox, r=eddyb
bors [Tue, 31 Jan 2017 00:02:15 +0000 (00:02 +0000)]
Auto merge of #39230 - petrochenkov:nobox, r=eddyb

Refactoring TyBox -> TyAdt

r? @eddyb
cc @Manishearth

7 years agocompiletest: Clear RUSTFLAGS env-var for run-make tests.
Michael Woerister [Mon, 30 Jan 2017 17:28:31 +0000 (12:28 -0500)]
compiletest: Clear RUSTFLAGS env-var for run-make tests.

7 years agoFix debuginfo scope issue with `Box`
Vadim Petrochenkov [Mon, 30 Jan 2017 20:18:29 +0000 (23:18 +0300)]
Fix debuginfo scope issue with `Box`

7 years agocleanup: Refactor away `DtorKind`
Vadim Petrochenkov [Mon, 30 Jan 2017 20:18:22 +0000 (23:18 +0300)]
cleanup: Refactor away `DtorKind`

7 years agoImplement Drop for Box
Vadim Petrochenkov [Sat, 21 Jan 2017 19:44:44 +0000 (22:44 +0300)]
Implement Drop for Box

7 years agoMerge ty::TyBox into ty::TyAdt
Vadim Petrochenkov [Sat, 21 Jan 2017 14:40:31 +0000 (17:40 +0300)]
Merge ty::TyBox into ty::TyAdt

7 years agoAuto merge of #39368 - alexcrichton:fix-upload-dirs, r=aturon
bors [Mon, 30 Jan 2017 19:43:08 +0000 (19:43 +0000)]
Auto merge of #39368 - alexcrichton:fix-upload-dirs, r=aturon

travis: Tweak artifact uploads

* Don't upload `*.wixpdb` files by accident
* Don't upload `doc` dir by accident
* Fix level of indirection on Travis

7 years agotravis: Tweak artifact uploads
Alex Crichton [Sat, 28 Jan 2017 18:24:42 +0000 (10:24 -0800)]
travis: Tweak artifact uploads

* Don't upload `*.wixpdb` files by accident
* Don't upload `doc` dir by accident
* Fix level of indirection on Travis

7 years agoAuto merge of #39407 - GuillaumeGomez:convert_module, r=frewsxcv
bors [Mon, 30 Jan 2017 13:16:57 +0000 (13:16 +0000)]
Auto merge of #39407 - GuillaumeGomez:convert_module, r=frewsxcv

Add missing url in convert module

r? @frewsxcv

7 years agoAuto merge of #39405 - tshepang:nits, r=sfackler
bors [Mon, 30 Jan 2017 06:45:13 +0000 (06:45 +0000)]
Auto merge of #39405 - tshepang:nits, r=sfackler

doc: minor Option improvements

7 years agodoc: minor Option improvements
Tshepang Lekhonkhobe [Mon, 30 Jan 2017 06:39:03 +0000 (08:39 +0200)]
doc: minor Option improvements

7 years agoAuto merge of #39389 - Wilfred:patch-2, r=apasel422
bors [Mon, 30 Jan 2017 02:47:06 +0000 (02:47 +0000)]
Auto merge of #39389 - Wilfred:patch-2, r=apasel422

Minor grammar fix 'can not' -> 'cannot'

The previous version suggested that the compiler chooses not to check, rather than being unable to check.

7 years agoAuto merge of #39392 - ishitatsuyuki:master, r=alexcrichton
bors [Mon, 30 Jan 2017 00:17:57 +0000 (00:17 +0000)]
Auto merge of #39392 - ishitatsuyuki:master, r=alexcrichton

Bootstrap: append libjemalloc_pic.a

Fix #35349

7 years agoAdd missing url in convert module
Guillaume Gomez [Sun, 29 Jan 2017 22:33:12 +0000 (23:33 +0100)]
Add missing url in convert module

7 years agoAuto merge of #39382 - cuviper:ibm-rewind, r=alexcrichton
bors [Sun, 29 Jan 2017 21:28:28 +0000 (21:28 +0000)]
Auto merge of #39382 - cuviper:ibm-rewind, r=alexcrichton

travis: move IBM backwards in time

Using Ubuntu's cross-toolchains for powerpc* and s390x meant they were
depending on glibc symbols from Ubuntu 16.04. And if that host is ever
updated to a new release, the toolchains would raise the bar too.

This switches powerpc, powerpc64, and s390x to use crosstool-ng
toolchains, configured approximately like RHEL6 with kernel 2.6.32 and
glibc 2.12. This ABI level should also be compatible with Debian 7
(wheezy) and Ubuntu 12.04 (precise).

For powerpc64le, the challenge was that only glibc-2.19 officially added
support, but RHEL7 backported those changes to glibc-2.17. The backport
patches are complex and numerous, so instead of trying to push those
into crosstool-ng, this just uses glibc binaries directly from CentOS 7
and builds the toolchain manually.

This is ported from rust-lang/rust-buildbot#149.

r? @alexcrichton

7 years agoBootstrap: append libjemalloc_pic.a
Tatsuyuki Ishi [Sun, 29 Jan 2017 11:35:11 +0000 (20:35 +0900)]
Bootstrap: append libjemalloc_pic.a

Fix #35349

7 years agoMinor grammar fix 'can not' -> 'cannot'
Wilfred Hughes [Sun, 29 Jan 2017 10:51:26 +0000 (10:51 +0000)]
Minor grammar fix 'can not' -> 'cannot'

The previous version suggested that the compiler chooses not to check, rather than being unable to check.

7 years agoAuto merge of #39378 - jtxx000:master, r=eddyb
bors [Sun, 29 Jan 2017 09:05:53 +0000 (09:05 +0000)]
Auto merge of #39378 - jtxx000:master, r=eddyb

Fix typo in librustc_trans/collector.rs

7 years agoAuto merge of #39380 - est31:remove_dead_peq, r=jseyfried
bors [Sun, 29 Jan 2017 06:20:33 +0000 (06:20 +0000)]
Auto merge of #39380 - est31:remove_dead_peq, r=jseyfried

Remove dead recursive partial eq impl

Its nowhere used (if it had been used used, the rust stack would have overflown
due to the recursion). Its presence was confusing for mrustc.

cc @thepowersgang

7 years agoFix the powerpc64 PATH
Josh Stone [Sun, 29 Jan 2017 06:02:49 +0000 (22:02 -0800)]
Fix the powerpc64 PATH

7 years agoAdd a license to build-powerpc64le-toolchain.sh
Josh Stone [Sun, 29 Jan 2017 05:41:35 +0000 (21:41 -0800)]
Add a license to build-powerpc64le-toolchain.sh

7 years agotravis: move IBM backwards in time
Josh Stone [Sun, 29 Jan 2017 05:25:11 +0000 (21:25 -0800)]
travis: move IBM backwards in time

Using Ubuntu's cross-toolchains for powerpc* and s390x meant they were
depending on glibc symbols from Ubuntu 16.04. And if that host is ever
updated to a new release, the toolchains would raise the bar too.

This switches powerpc, powerpc64, and s390x to use crosstool-ng
toolchains, configured approximately like RHEL6 with kernel 2.6.32 and
glibc 2.12. This ABI level should also be compatible with Debian 7
(wheezy) and Ubuntu 12.04 (precise).

For powerpc64le, the challenge was that only glibc-2.19 officially added
support, but RHEL7 backported those changes to glibc-2.17. The backport
patches are complex and numerous, so instead of trying to push those
into crosstool-ng, this just uses glibc binaries directly from CentOS 7
and builds the toolchain manually.

This is ported from rust-lang/rust-buildbot#149.

r? @alexcrichton

7 years agoRemove dead recursive partial eq impl
est31 [Sun, 29 Jan 2017 05:07:45 +0000 (06:07 +0100)]
Remove dead recursive partial eq impl

Its nowhere used (if it had been used used, the rust stack would have overflown
due to the recursion). Its presence was confusing for mrustc.

7 years agoFix backtraces on i686-pc-windows-gnu by disabling FPO
Segev Finer [Sat, 28 Jan 2017 19:54:59 +0000 (21:54 +0200)]
Fix backtraces on i686-pc-windows-gnu by disabling FPO

This might have performance implications. But do note that MSVC
disables FPO by default nowadays and it's use is limited in exception
heavy languages like C++.

Closes: #28218
7 years agoFix typo in librustc_trans/collector.rs
Caleb Reach [Sun, 29 Jan 2017 04:01:22 +0000 (23:01 -0500)]
Fix typo in librustc_trans/collector.rs

7 years agoAuto merge of #39375 - seeekr:patch-1, r=apasel422
bors [Sat, 28 Jan 2017 23:14:22 +0000 (23:14 +0000)]
Auto merge of #39375 - seeekr:patch-1, r=apasel422

Fix typo in liballoc/lib.rs

7 years agoFix typo in liballoc/lib.rs
Denis Andrejew [Sat, 28 Jan 2017 22:16:16 +0000 (22:16 +0000)]
Fix typo in liballoc/lib.rs

7 years agoAuto merge of #39234 - segevfiner:fix-backtraces-on-windows-gnu, r=petrochenkov
bors [Sat, 28 Jan 2017 20:32:56 +0000 (20:32 +0000)]
Auto merge of #39234 - segevfiner:fix-backtraces-on-windows-gnu, r=petrochenkov

Make backtraces work on Windows GNU targets again.

This is done by adding a function that can return a filename
to pass to backtrace_create_state. The filename is obtained in
a safe way by first getting the filename, locking the file so it can't
be moved, and then getting the filename again and making sure it's the same.

See: https://github.com/rust-lang/rust/pull/37359#issuecomment-260123399
Issue: #33985

Note though that this isn't that pretty...

I had to implement a `WideCharToMultiByte` wrapper function to convert to the ANSI code page. This will work better than only allowing ASCII provided that the ANSI code page is set to the user's local language, which is often the case.

Also, please make sure that I didn't break the Unix build.

7 years agoDisable backtrace tests on i686-pc-windows-gnu since it's broken by FPO
Segev Finer [Sat, 28 Jan 2017 19:52:31 +0000 (21:52 +0200)]
Disable backtrace tests on i686-pc-windows-gnu since it's broken by FPO

7 years agoAuto merge of #39360 - osa1:typos, r=GuillaumeGomez
bors [Sat, 28 Jan 2017 14:13:00 +0000 (14:13 +0000)]
Auto merge of #39360 - osa1:typos, r=GuillaumeGomez

Fix typos in libsyntax/tokenstream.rs

7 years agoFix typos in libsyntax/tokenstream.rs
Ömer Sinan Ağacan [Sat, 28 Jan 2017 14:00:43 +0000 (17:00 +0300)]
Fix typos in libsyntax/tokenstream.rs

7 years agoAuto merge of #39340 - GuillaumeGomez:empty_comment, r=frewsxcv
bors [Sat, 28 Jan 2017 09:41:40 +0000 (09:41 +0000)]
Auto merge of #39340 - GuillaumeGomez:empty_comment, r=frewsxcv

Don't generate doc if doc comments only filled with 'white' characters

Fixes #39339.

r? @steveklabnik

cc @rust-lang/docs

7 years agoAuto merge of #39305 - eddyb:synelide, r=nikomatsakis
bors [Sat, 28 Jan 2017 06:21:23 +0000 (06:21 +0000)]
Auto merge of #39305 - eddyb:synelide, r=nikomatsakis

Perform lifetime elision (more) syntactically, before type-checking.

The *initial* goal of this patch was to remove the (contextual) `&RegionScope` argument passed around `rustc_typeck::astconv` and allow converting arbitrary (syntactic) `hir::Ty` to (semantic) `Ty`.
I've tried to closely match the existing behavior while moving the logic to the earlier `resolve_lifetime` pass, and [the crater report](https://gist.github.com/eddyb/4ac5b8516f87c1bfa2de528ed2b7779a) suggests none of the changes broke real code, but I will try to list everything:

There are few cases in lifetime elision that could trip users up due to "hidden knowledge":
```rust
type StaticStr = &'static str; // hides 'static
trait WithLifetime<'a> {
    type Output; // can hide 'a
}

// This worked because the type of the first argument contains
// 'static, although StaticStr doesn't even have parameters.
fn foo(x: StaticStr) -> &str { x }

// This worked because the compiler resolved the argument type
// to <T as WithLifetime<'a>>::Output which has the hidden 'a.
fn bar<'a, T: WithLifetime<'a>>(_: T::Output) -> &str { "baz" }
```

In the two examples above, elision wasn't using lifetimes that were in the source, not even *needed* by paths in the source, but rather *happened* to be part of the semantic representation of the types.
To me, this suggests they should have never worked through elision (and they don't with this PR).

Next we have an actual rule with a strange result, that is, the return type here elides to `&'x str`:
```rust
impl<'a, 'b> Trait for Foo<'a, 'b> {
    fn method<'x, 'y>(self: &'x Foo<'a, 'b>, _: Bar<'y>) -> &str {
        &self.name
    }
}
```
All 3 of `'a`, `'b` and `'y` are being ignored, because the `&self` elision rule only cares that the first argument is "`self` by reference". Due implementation considerations (elision running before typeck), I've limited it in this PR to a reference to a primitive/`struct`/`enum`/`union`, but not other types, but I am doing another crater run to assess the impact of limiting it to literally `&self` and `self: &Self` (they're identical in HIR).

It's probably ideal to keep an "implicit `Self` for `self`" type around and *only* apply the rule to `&self` itself, but that would result in more bikeshed, and #21400 suggests some people expect otherwise.
Another decent option is treating `self: X, ... -> Y` like `X -> Y` (one unique lifetime in `X` used for `Y`).

The remaining changes have to do with "object lifetime defaults" (see RFCs [599](https://github.com/rust-lang/rfcs/blob/master/text/0599-default-object-bound.md) and [1156](https://github.com/rust-lang/rfcs/blob/master/text/1156-adjust-default-object-bounds.md)):
```rust
trait Trait {}
struct Ref2<'a, 'b, T: 'a+'b>(&'a T, &'b T);

// These apply specifically within a (fn) body,
// which allows type and lifetime inference:
fn main() {
    // Used to be &'a mut (Trait+'a) - where 'a is one
    // inference variable - &'a mut (Trait+'b) in this PR.
    let _: &mut Trait;

    // Used to be an ambiguity error, but in this PR it's
    // Ref2<'a, 'b, Trait+'c> (3 inference variables).
    let _: Ref2<Trait>;
}
```
What's happening here is that inference variables are created on the fly by typeck whenever a lifetime has no resolution attached to it - while it would be possible to alter the implementation to reuse inference variables based on decisions made early by `resolve_lifetime`, not doing that is more flexible and works better - it can compile all testcases from #38624 by not ending up with `&'static mut (Trait+'static)`.

The ambiguity specifically cannot be an early error, because this is only the "default" (typeck can still pick something better based on the definition of `Trait` and whether it has any lifetime bounds), and having an error at all doesn't help anyone, as we can perfectly infer an appropriate lifetime inside the `fn` body.

**TODO**: write tests for the user-visible changes.

cc @nikomatsakis @arielb1

7 years agoAuto merge of #39353 - alexcrichton:rollup, r=alexcrichton
bors [Sat, 28 Jan 2017 02:50:51 +0000 (02:50 +0000)]
Auto merge of #39353 - alexcrichton:rollup, r=alexcrichton

Rollup of 21 pull requests

- Successful merges: #38617, #39284, #39285, #39290, #39302, #39305, #39306, #39307, #39311, #39313, #39314, #39321, #39325, #39332, #39335, #39344, #39345, #39346, #39348, #39350, #39351
- Failed merges:

7 years agotest: add missing lifetime in recently added test.
Eduard-Mihai Burtescu [Fri, 27 Jan 2017 17:03:59 +0000 (19:03 +0200)]
test: add missing lifetime in recently added test.

7 years agorustc: remove unused `bounds` field from `RegionParameterDef`.
Eduard-Mihai Burtescu [Wed, 25 Jan 2017 16:39:21 +0000 (18:39 +0200)]
rustc: remove unused `bounds` field from `RegionParameterDef`.

7 years agorustc: move object default lifetimes to resolve_lifetimes.
Eduard-Mihai Burtescu [Wed, 25 Jan 2017 15:32:44 +0000 (17:32 +0200)]
rustc: move object default lifetimes to resolve_lifetimes.

7 years agorustc: always keep an explicit lifetime in trait objects.
Eduard-Mihai Burtescu [Tue, 24 Jan 2017 15:17:06 +0000 (17:17 +0200)]
rustc: always keep an explicit lifetime in trait objects.

7 years agorustc: lower trait type paths as TyTraitObject.
Eduard-Mihai Burtescu [Tue, 17 Jan 2017 14:46:23 +0000 (16:46 +0200)]
rustc: lower trait type paths as TyTraitObject.

7 years agorustc_typeck: move impl Trait checks out of RegionScope.
Eduard-Mihai Burtescu [Fri, 13 Jan 2017 13:10:37 +0000 (15:10 +0200)]
rustc_typeck: move impl Trait checks out of RegionScope.

7 years agorustc: move most of lifetime elision to resolve_lifetimes.
Eduard-Mihai Burtescu [Fri, 13 Jan 2017 13:09:56 +0000 (15:09 +0200)]
rustc: move most of lifetime elision to resolve_lifetimes.

7 years agorustc: simplify scope-tracking in resolve_lifetime.
Eduard-Mihai Burtescu [Wed, 11 Jan 2017 15:35:54 +0000 (17:35 +0200)]
rustc: simplify scope-tracking in resolve_lifetime.

7 years agorustc: clean up the style of middle::resolve_lifetime.
Eduard-Mihai Burtescu [Sun, 8 Jan 2017 20:40:04 +0000 (22:40 +0200)]
rustc: clean up the style of middle::resolve_lifetime.

7 years agorustc: always include elidable lifetimes in HIR types.
Eduard-Mihai Burtescu [Mon, 9 Jan 2017 15:46:11 +0000 (17:46 +0200)]
rustc: always include elidable lifetimes in HIR types.

7 years agorustc_typeck: pass all lifetimes through AstConv::opt_ast_region_to_region.
Eduard-Mihai Burtescu [Wed, 4 Jan 2017 21:23:11 +0000 (23:23 +0200)]
rustc_typeck: pass all lifetimes through AstConv::opt_ast_region_to_region.

7 years agorustc_typeck: force users of RegionScope to get anon_region's one by one.
Eduard-Mihai Burtescu [Wed, 4 Jan 2017 12:32:44 +0000 (14:32 +0200)]
rustc_typeck: force users of RegionScope to get anon_region's one by one.

7 years agoRollup merge of #39351 - nikomatsakis:incr-comp-skip-typeck-1, r=eddyb
Alex Crichton [Fri, 27 Jan 2017 22:41:31 +0000 (14:41 -0800)]
Rollup merge of #39351 - nikomatsakis:incr-comp-skip-typeck-1, r=eddyb

move `cast_kinds` into `TypeckTables` where it belongs

r? @eddyb

7 years agoRollup merge of #39350 - nagisa:i128-test-helpers-better-def, r=alexcrichton
Alex Crichton [Fri, 27 Jan 2017 22:41:30 +0000 (14:41 -0800)]
Rollup merge of #39350 - nagisa:i128-test-helpers-better-def, r=alexcrichton

Use __SIZEOF_INT128__ to test __int128 presence

Previously we tested whether a handful of preprocessor variables indicating certain 64 bit
platforms, but this does not work for other 64 bit targets which have support for __int128 in C
compiler.

Use the `__SIZEOF__INT128__` preprocessor variable instead. This variable gets set to 16 by gcc and
clang for every target where __int128 is supported.

7 years agoRollup merge of #39348 - steveklabnik:cyryl-mailmap, r=alexcrichton
Alex Crichton [Fri, 27 Jan 2017 22:41:29 +0000 (14:41 -0800)]
Rollup merge of #39348 - steveklabnik:cyryl-mailmap, r=alexcrichton

Fix cyryl's mailmap entry

7 years agoRollup merge of #39346 - steveklabnik:jethro-mailmap, r=brson
Alex Crichton [Fri, 27 Jan 2017 22:41:28 +0000 (14:41 -0800)]
Rollup merge of #39346 - steveklabnik:jethro-mailmap, r=brson

Fix @jethrogb's mailmap entry

cc rust-lang-nursery/thanks#51

7 years agoRollup merge of #39345 - steveklabnik:carol-mailmap, r=alexcrichton
Alex Crichton [Fri, 27 Jan 2017 22:41:27 +0000 (14:41 -0800)]
Rollup merge of #39345 - steveklabnik:carol-mailmap, r=alexcrichton

Fix up @carols10cents' mailmap entry

The previous ways didn't work; this does.

cc rust-lang-nursery/thanks#45

7 years agoRollup merge of #39344 - ollie27:links, r=steveklabnik
Alex Crichton [Fri, 27 Jan 2017 22:41:26 +0000 (14:41 -0800)]
Rollup merge of #39344 - ollie27:links, r=steveklabnik

Fix a few links in the docs

r? @steveklabnik

7 years agoRollup merge of #39335 - cramertj:cramertj/can_begin_expr_fix, r=petrochenkov
Alex Crichton [Fri, 27 Jan 2017 22:41:24 +0000 (14:41 -0800)]
Rollup merge of #39335 - cramertj:cramertj/can_begin_expr_fix, r=petrochenkov

Fix can_begin_expr keyword behavior

Partial fix for #28784.

7 years agoRollup merge of #39332 - nagisa:another-bigendian-128, r=eddyb
Alex Crichton [Fri, 27 Jan 2017 22:41:23 +0000 (14:41 -0800)]
Rollup merge of #39332 - nagisa:another-bigendian-128, r=eddyb

Fix another endianness issue in i128 trans

Apparently LLVMArbitraryPrecisionInteger demands integers to be in low-endian 64-bytes, rather than host-endian 64-bytes. This is weird, and obviously, not documented. And rustc now works a teeny bit more on big endians.

r? @eddyb

7 years agoRollup merge of #39321 - king6cong:master, r=frewsxcv
Alex Crichton [Fri, 27 Jan 2017 22:41:21 +0000 (14:41 -0800)]
Rollup merge of #39321 - king6cong:master, r=frewsxcv

doc comment typo fix

7 years agoRollup merge of #39314 - stjepang:rewrite-sort-header, r=brson
Alex Crichton [Fri, 27 Jan 2017 22:41:20 +0000 (14:41 -0800)]
Rollup merge of #39314 - stjepang:rewrite-sort-header, r=brson

Rewrite the first sentence in slice::sort

For every method, the first sentence should consisely explain what it does,
not how. This sentence usually starts with a verb.

It's really weird for `sort` to be explained in terms of another function,
namely `sort_by`. There's no need for that because it's obvious how `sort`
sorts elements: there is `T: Ord`.

If `sort_by_key` does not have to explicitly state how it's implemented,
then `sort` doesn't either.

r? @steveklabnik

7 years agoRollup merge of #39313 - est31:drop_in_place_is_stable, r=GuillaumeGomez
Alex Crichton [Fri, 27 Jan 2017 22:41:19 +0000 (14:41 -0800)]
Rollup merge of #39313 - est31:drop_in_place_is_stable, r=GuillaumeGomez

drop_in_place is stable now, don't #![feature] it in the nomicon and a test.

It was stable since Rust 1.8.

r? @GuillaumeGomez

7 years agoRollup merge of #39311 - solson:fix-unpretty-mir-non-local, r=eddyb
Alex Crichton [Fri, 27 Jan 2017 22:41:18 +0000 (14:41 -0800)]
Rollup merge of #39311 - solson:fix-unpretty-mir-non-local, r=eddyb

Avoid ICE when pretty-printing non-local MIR item.

This comes up when using `-Zunstable-options --unpretty=mir`. Previously, rustc would ICE due to an unwrap later in this function (after `as_local_node_id`). Instead, we should just ignore items from other crates when pretty-printing MIR.

This was reported in #rust: [this playground code](https://is.gd/PSMBZS) causes an ICE if you click the MIR button. The problem is the mention of the non-local item `std::usize::MAX`, so you can reduce the test case [a lot](https://is.gd/SaLjaa).

r? @eddyb

7 years agoRollup merge of #39307 - alexcrichton:stabilize-1.16, r=brson
Alex Crichton [Fri, 27 Jan 2017 22:41:17 +0000 (14:41 -0800)]
Rollup merge of #39307 - alexcrichton:stabilize-1.16, r=brson

std: Stabilize APIs for the 1.16.0 release

This commit applies the stabilization/deprecations of the 1.16.0 release, as
tracked by the rust-lang/rust issue tracker and the final-comment-period tag.

The following APIs were stabilized:

* `VecDeque::truncate`
* `VecDeque::resize`
* `String::insert_str`
* `Duration::checked_{add,sub,div,mul}`
* `str::replacen`
* `SocketAddr::is_ipv{4,6}`
* `IpAddr::is_ipv{4,6}`
* `str::repeat`
* `Vec::dedup_by`
* `Vec::dedup_by_key`
* `Result::unwrap_or_default`
* `<*const T>::wrapping_offset`
* `<*mut T>::wrapping_offset`
* `CommandExt::creation_flags` (on Windows)
* `File::set_permissions`
* `String::split_off`

The following APIs were deprecated

* `EnumSet` - replaced with other ecosystem abstractions, long since unstable

Closes #27788
Closes #35553
Closes #35774
Closes #36436
Closes #36949
Closes #37079
Closes #37087
Closes #37516
Closes #37827
Closes #37916
Closes #37966
Closes #38080

7 years agoRollup merge of #39306 - GuillaumeGomez:newtype_help, r=eddyb
Alex Crichton [Fri, 27 Jan 2017 22:41:16 +0000 (14:41 -0800)]
Rollup merge of #39306 - GuillaumeGomez:newtype_help, r=eddyb

Add note for E0117

Fixes #39249.

I just applied the suggestion of @durka since I don't see anything else to add.

7 years agoRollup merge of #39302 - alexcrichton:upload-all, r=brson
Alex Crichton [Fri, 27 Jan 2017 22:41:13 +0000 (14:41 -0800)]
Rollup merge of #39302 - alexcrichton:upload-all, r=brson

travis: Upload all artifacts in build/dist

Previously we only uploaded tarballs, but this modifies Travis/AppVeyor to
upload everything. We shouldn't have anything else in there to worry about and
otherwise we need to be sure to pick up pkg/msi/exe installers.

7 years agoRollup merge of #39290 - canndrew:hide-uninhabitedness, r=nikomatsakis
Alex Crichton [Fri, 27 Jan 2017 22:41:12 +0000 (14:41 -0800)]
Rollup merge of #39290 - canndrew:hide-uninhabitedness, r=nikomatsakis

Hide uninhabitedness checks behind feature gate

This reverts the fix to match exhaustiveness checking so that it can be discussed. The new code is now hidden behind the `never_type` feature gate.

7 years agoRollup merge of #39285 - nrc:save-tables, r=@eddyb
Alex Crichton [Fri, 27 Jan 2017 22:41:11 +0000 (14:41 -0800)]
Rollup merge of #39285 - nrc:save-tables, r=@eddyb

save-analysis: get tables directly, accomodating them being missing

Fixes an ICE when running with save-analysis after an error

r? @eddyb

7 years agoRollup merge of #39284 - alexcrichton:manifesting, r=brson
Alex Crichton [Fri, 27 Jan 2017 22:41:10 +0000 (14:41 -0800)]
Rollup merge of #39284 - alexcrichton:manifesting, r=brson

rustbuild: Add manifest generation in-tree

This commit adds a new tool, `build-manifest`, which is used to generate a
distribution manifest of all produced artifacts. This tool is intended to
replace the `build-rust-manifest.py` script that's currently located on the
buildmaster. The intention is that we'll have a builder which periodically:

* Downloads all artifacts for a commit
* Runs `./x.py dist hash-and-sign`. This will generate `sha256` and `asc` files
  as well as TOML manifests.
* Upload all generated hashes and manifests to the directory the artifacts came
  from.
* Upload *all* artifacts (tarballs and hashes and manifests) to an archived
  location.
* If necessary, upload all artifacts to the main location.

This script is intended to just be the second step here where orchestrating
uploads and such will all happen externally from the build system itself.

cc #38531

7 years agoRollup merge of #38617 - pnkfelix:double-reference, r=pnkfelix
Alex Crichton [Fri, 27 Jan 2017 22:41:09 +0000 (14:41 -0800)]
Rollup merge of #38617 - pnkfelix:double-reference, r=pnkfelix

Detect double reference when applying binary op

``` rust
let vr = v.iter().filter(|x| {
    x % 2 == 0
});
```

will now yield the following compiler output:

``` bash
ERROR binary operation `%` cannot be applied to type `&&_`
NOTE this is a reference of a reference to a type that `%` can be applied to,
you need to dereference this variable once for this operation to work
NOTE an implementation of `std::ops::Rem` might be missing for `&&_`
```

The first NOTE is new.

Fix #33877

----

Thanks to @estebank for providing the original PR #34420 (of which this is a tweaked rebase).

7 years agoUse libc::c_char instead of i8 due to platforms with unsigned char
Segev Finer [Fri, 27 Jan 2017 23:01:16 +0000 (01:01 +0200)]
Use libc::c_char instead of i8 due to platforms with unsigned char

7 years agorustdoc: Suppress warnings/errors with --test
Alex Crichton [Fri, 27 Jan 2017 22:51:47 +0000 (14:51 -0800)]
rustdoc: Suppress warnings/errors with --test

Threads spawned by the test framework have their output captured by default, so
for `rustdoc --test` threads this propagates that capturing to the spawned
thread that we now have.

Closes #39327

7 years agoDon't generate doc if doc comments only filled with 'white' characters
Guillaume Gomez [Fri, 27 Jan 2017 15:59:35 +0000 (16:59 +0100)]
Don't generate doc if doc comments only filled with 'white' characters

7 years agoAuto merge of #37057 - brson:nosuggest, r=nikomatsakis
bors [Fri, 27 Jan 2017 22:13:41 +0000 (22:13 +0000)]
Auto merge of #37057 - brson:nosuggest, r=nikomatsakis

rustc: Remove all "consider using an explicit lifetime parameter" suggestions

These give so many incorrect suggestions that having them is
detrimental to the user experience. The compiler should not be
suggesting changes to the code that are wrong - it is infuriating: not
only is the compiler telling you that _you don't understand_ borrowing,
_the compiler itself_ appears to not understand borrowing. It does not
inspire confidence.

r? @nikomatsakis

7 years agoUse __SIZEOF_INT128__ to test __int128 presence
Simonas Kazlauskas [Fri, 27 Jan 2017 21:23:26 +0000 (23:23 +0200)]
Use __SIZEOF_INT128__ to test __int128 presence

Previously we tested whether a handful of preprocessor variables indicating certain 64 bit
platforms, but this does not work for other 64 bit targets which have support for __int128 in C
compiler.

Use the __SIZEOF__INT128__ preprocessor variable instead. This variable gets set to 16 by gcc and
clang for every target where __int128 is supported.

7 years agomove `cast_kinds` into `TypeckTables` where it belongs
Niko Matsakis [Fri, 27 Jan 2017 21:16:43 +0000 (16:16 -0500)]
move `cast_kinds` into `TypeckTables` where it belongs

7 years agoFix cyryl's mailmap entry
Steve Klabnik [Fri, 27 Jan 2017 20:27:26 +0000 (15:27 -0500)]
Fix cyryl's mailmap entry

7 years agoFix @jethrogb's mailmap entry
Steve Klabnik [Fri, 27 Jan 2017 20:19:30 +0000 (15:19 -0500)]
Fix @jethrogb's mailmap entry

cc rust-lang-nursery/thanks#51

7 years agoFix up @carols10cents' mailmap entry
Steve Klabnik [Fri, 27 Jan 2017 19:29:11 +0000 (14:29 -0500)]
Fix up @carols10cents' mailmap entry

The previous ways didn't work; this does.

cc rust-lang-nursery/thanks#45

7 years agoAuto merge of #39320 - alexcrichton:less-backtraces, r=aturon
bors [Fri, 27 Jan 2017 18:12:04 +0000 (18:12 +0000)]
Auto merge of #39320 - alexcrichton:less-backtraces, r=aturon

travis: Turn off core dumps on OSX

I've seen these take up quite a bit of log space and I have the sneaking
suspicion that they're just making our test suite take longer (sometimes timing
out on 32-bit OSX now). In any case the backtraces haven't proven too useful,
unfortunately.

7 years agoFix a few links in the docs
Oliver Middleton [Fri, 27 Jan 2017 18:08:51 +0000 (18:08 +0000)]
Fix a few links in the docs

7 years agoAuto merge of #39282 - petrochenkov:selfstab, r=nikomatsakis
bors [Fri, 27 Jan 2017 12:23:23 +0000 (12:23 +0000)]
Auto merge of #39282 - petrochenkov:selfstab, r=nikomatsakis

Stabilize Self and associated types in struct expressions and patterns

Rebase of https://github.com/rust-lang/rust/pull/37734
Closes https://github.com/rust-lang/rust/issues/37544
r? @nikomatsakis

7 years agoAuto merge of #39252 - alexcrichton:less-exports, r=nrc
bors [Fri, 27 Jan 2017 10:01:45 +0000 (10:01 +0000)]
Auto merge of #39252 - alexcrichton:less-exports, r=nrc

Hide a few more standard library symbols

These commits touch up some of the symbol visibility rules for some crates related to the standard library, notably:

* Symbols that are `pub extern` and `#[no_mangle]` which are internal-to-rust ABI things are no longer at the `C` export level, but the `Rust` export level. This includes allocators, panic runtimes, and compiler builtins.
* The libbacktrace library is now compiled with `-fvisibility=hidden` to ensure that we don't export those symbols.

7 years agoAttempt at fixing dead code lints
Segev Finer [Fri, 27 Jan 2017 09:33:24 +0000 (11:33 +0200)]
Attempt at fixing dead code lints

7 years agostd: Compile libbacktrace with -fvisibility=hidden
Alex Crichton [Sun, 22 Jan 2017 20:58:56 +0000 (12:58 -0800)]
std: Compile libbacktrace with -fvisibility=hidden

We don't want these symbols exported from the standard library, this is
just an internal implementation detail of the standard library
currently.

Closes #34984

7 years agorustc: Don't export builtins/panic/alloc syms
Alex Crichton [Sun, 22 Jan 2017 20:53:35 +0000 (12:53 -0800)]
rustc: Don't export builtins/panic/alloc syms

This hides symbols from various unstable and implementation-detail
crates of the standard library. Although typically transitive exported
`pub extern` functions are exported from cdylibs, these crates aren't
necessary as they're all implementation details.

Closes #34493

7 years agoAuto merge of #39281 - michaelwoerister:make-cc-incr-comp-opt-in, r=nikomatsakis
bors [Fri, 27 Jan 2017 07:36:43 +0000 (07:36 +0000)]
Auto merge of #39281 - michaelwoerister:make-cc-incr-comp-opt-in, r=nikomatsakis

incr.comp.: Make cross-crate tracking for incr. comp. opt-in.

The current implementation of cross-crate dependency tracking can cause quite long compile times and high memory usage for some crates (see #39208 for example). This PR therefore makes that part of dependency tracking optional. Incremental compilation still works, it will only have very coarse dep-tracking for upstream crates.

r? @nikomatsakis

7 years agoFix can_begin_expr keyword behavior
Taylor Cramer [Fri, 27 Jan 2017 05:51:20 +0000 (21:51 -0800)]
Fix can_begin_expr keyword behavior

7 years agoAuto merge of #39139 - estebank:issue-38147, r=nikomatsakis
bors [Fri, 27 Jan 2017 04:57:12 +0000 (04:57 +0000)]
Auto merge of #39139 - estebank:issue-38147, r=nikomatsakis

Point to immutable arg/fields when trying to use as &mut

Present the following output when trying to access an immutable borrow's
field as mutable:

```
error[E0389]: cannot borrow data mutably in a `&` reference
  --> $DIR/issue-38147-1.rs:27:9
   |
26 | fn f(&self) {
   |      -----  use `&mut self` here to make mutable
27 |     f.s.push('x');
   |     ^^^ assignment into an immutable reference
```

And the following when trying to access an immutable struct field as mutable:

```
error: cannot borrow immutable borrowed content `*self.s` as mutable
  --> $DIR/issue-38147-3.rs:17:9
   |
12 |     s: &'a String
   |     ------------- use `&'a mut String` here to make mutable
...|
16 |     fn f(&self) {
   |          -----  use `&mut self` here to make mutable
17 |         self.s.push('x');
   |         ^^^^^^ cannot borrow as mutable
```

Fixes #38147.

7 years agoFix another endian-ness issue in i128 trans
Simonas Kazlauskas [Fri, 27 Jan 2017 02:36:12 +0000 (04:36 +0200)]
Fix another endian-ness issue in i128 trans

Apparently LLVMArbitraryPrecisionInteger demands integers to be in low-endian 64-bytes, rather than
host-endian 64-bytes. This is weird, and obviously, not documented. Also, fixed now. And rustc now
works a teeny bit more on big endians.

7 years agoAuto merge of #39158 - petrochenkov:bounds, r=nikomatsakis
bors [Fri, 27 Jan 2017 01:27:12 +0000 (01:27 +0000)]
Auto merge of #39158 - petrochenkov:bounds, r=nikomatsakis

Bounds parsing refactoring 2

See https://github.com/rust-lang/rust/pull/37511 for previous discussion.
cc @matklad

Relaxed parsing rules:
 - zero bounds after `:` are allowed in all contexts.
 - zero predicates are allowed after `where`.
- trailing separator `,` is allowed after predicates in `where` clauses not followed by `{`.

Other parsing rules:
 - trailing separator `+` is still allowed in all bound lists.

Code is also cleaned up and tests added.

I haven't touched parsing of trait object types yet, I'll do it later.

7 years agorustc: Remove all "consider using an explicit lifetime parameter" suggestions
Brian Anderson [Sun, 9 Oct 2016 17:30:11 +0000 (10:30 -0700)]
rustc: Remove all "consider using an explicit lifetime parameter" suggestions

These give so many incorrect suggestions that having them is
detrimental to the user experience. The compiler should not be
suggesting changes to the code that are wrong - it is infuriating: not
only is the compiler telling you that _you don't understand_ borrowing,
_the compiler itself_ appears to not understand borrowing. It does not
inspire confidence.

7 years agoPoint to immutable arg/fields when trying to use as &mut
Esteban Küber [Tue, 17 Jan 2017 07:42:11 +0000 (23:42 -0800)]
Point to immutable arg/fields when trying to use as &mut

Point to immutable borrow arguments and fields when trying to use them as
mutable borrows. Add label to primary span on "cannot borrow as mutable"
errors.

Present the following output when trying to access an immutable borrow's
field as mutable:

```
error[E0389]: cannot borrow data mutably in a `&` reference
  --> $DIR/issue-38147-1.rs:27:9
   |
26 | fn f(&self) {
   |      -----  use `&mut self` here to make mutable
27 |     f.s.push('x');
   |     ^^^ assignment into an immutable reference
```

And the following when trying to access an immutable struct field as mutable:

```
error: cannot borrow immutable borrowed content `*self.s` as mutable
  --> $DIR/issue-38147-3.rs:17:9
   |
12 |     s: &'a String
   |     ------------- use `&'a mut String` here to make mutable
...|
16 |     fn f(&self) {
   |          -----  use `&mut self` here to make mutable
17 |         self.s.push('x');
   |         ^^^^^^ cannot borrow as mutable
```

7 years agoAvoid ICE when pretty-printing non-local MIR item.
Scott Olson [Thu, 26 Jan 2017 05:16:38 +0000 (21:16 -0800)]
Avoid ICE when pretty-printing non-local MIR item.

This comes up when using `-Zunstable-options --unpretty=mir`.
Previously, rustc would ICE due to an unwrap later in this function
(after `as_local_node_id`). Instead, we should just ignore items from
other crates when pretty-printing MIR.

7 years agosave-analysis: get tables directly, accomodating them being missing
Nick Cameron [Wed, 25 Jan 2017 01:40:47 +0000 (14:40 +1300)]
save-analysis: get tables directly, accomodating them being missing

Fixes an ICE when running with save-analsysis after an error

7 years agodoc comment typo fix
king6cong [Thu, 26 Jan 2017 18:05:33 +0000 (02:05 +0800)]
doc comment typo fix

7 years agoAuto merge of #39066 - arielb1:lifetime-extension-test, r=nikomatsakis
bors [Thu, 26 Jan 2017 17:42:52 +0000 (17:42 +0000)]
Auto merge of #39066 - arielb1:lifetime-extension-test, r=nikomatsakis

End temporary lifetimes being extended by `let X: &_` hints

cc #39283

r? @nikomatsakis

7 years agotravis: Turn off core dumps on OSX
Alex Crichton [Thu, 26 Jan 2017 17:04:07 +0000 (09:04 -0800)]
travis: Turn off core dumps on OSX

I've seen these take up quite a bit of log space and I have the sneaking
suspicion that they're just making our test suite take longer (sometimes timing
out on 32-bit OSX now). In any case the backtraces haven't proven too useful,
unfortunately.

7 years agoAuto merge of #39309 - eddyb:map-shmap, r=nikomatsakis
bors [Thu, 26 Jan 2017 15:02:23 +0000 (15:02 +0000)]
Auto merge of #39309 - eddyb:map-shmap, r=nikomatsakis

Rename tcx.map to the far more descriptive tcx.hir.

Also a bit more renaming because `ast_map` and `'ast` were still used with HIR.
Main motivation is to "free up" `tcx.map`, or rather, `tcx.maps`, to consolidate `ty::maps` there.

r? @nikomatsakis