]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAuto merge of #60313 - cuviper:thinlto-import, r=alexcrichton
bors [Sat, 27 Apr 2019 19:53:00 +0000 (19:53 +0000)]
Auto merge of #60313 - cuviper:thinlto-import, r=alexcrichton

Limit internalization in LLVM 8 ThinLTO

Fixes #60184.
r? @alexcrichton

5 years agoAuto merge of #60288 - Zoxc:update-rayon, r=nikomatsakis
bors [Sat, 27 Apr 2019 17:08:11 +0000 (17:08 +0000)]
Auto merge of #60288 - Zoxc:update-rayon, r=nikomatsakis

Update rustc-rayon version

r? @nikomatsakis

5 years agoAuto merge of #60329 - Centril:rollup-wv8g1ex, r=Centril
bors [Sat, 27 Apr 2019 14:06:39 +0000 (14:06 +0000)]
Auto merge of #60329 - Centril:rollup-wv8g1ex, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #60292 (Replace the `&'tcx List<Ty<'tcx>>` in `TyKind::Tuple` with `SubstsRef<'tcx>`)
 - #60307 (Make "Implementations on Foreign Types" items in sidebar link to specific impls)
 - #60309 (Add 1.34.1 release notes)
 - #60315 (bootstrap: use correct version numbers for llvm-tools and lldb)
 - #60316 (Use "capacity" as parameter name in with_capacity() methods)

Failed merges:

r? @ghost

5 years agoRollup merge of #60316 - mgeier:rename-capacity-parameter, r=joshtriplett
Mazdak Farrokhzad [Sat, 27 Apr 2019 12:12:42 +0000 (14:12 +0200)]
Rollup merge of #60316 - mgeier:rename-capacity-parameter, r=joshtriplett

Use "capacity" as parameter name in with_capacity() methods

See #60271.

The only place where I didn't change the parameter name is `RawVec`. The problem is that it has a `.cap()` method instead of the usual `.capacity()`:

https://github.com/rust-lang/rust/blob/597f432489f12a3f33419daa039ccef11a12c4fd/src/liballoc/raw_vec.rs#L200-L210

Changing this would be a breaking change, and I guess that's not worth it.

But since I didn't change `.cap()` there, I didn't change the `cap` parameter name to `capacity`, either.

5 years agoRollup merge of #60315 - pietroalbini:fix-tools-version, r=Mark-Simulacrum
Mazdak Farrokhzad [Sat, 27 Apr 2019 12:12:41 +0000 (14:12 +0200)]
Rollup merge of #60315 - pietroalbini:fix-tools-version, r=Mark-Simulacrum

bootstrap: use correct version numbers for llvm-tools and lldb

The current URLs for the `llvm-tools` and `lldb` components are a bit broken right now:

```
https://static.rust-lang.org/dist/2019-04-25/llvm-tools-1.34.1 (fc50f328b 2019-04-24)-aarch64-unknown-linux-gnu.tar.gz
```

This PR uses proper version numbers for those. Tested a dist build locally and everything works.

r? @Mark-Simulacrum

5 years agoRollup merge of #60309 - pietroalbini:relnotes-1.34.1, r=pietroalbini
Mazdak Farrokhzad [Sat, 27 Apr 2019 12:12:40 +0000 (14:12 +0200)]
Rollup merge of #60309 - pietroalbini:relnotes-1.34.1, r=pietroalbini

Add 1.34.1 release notes

This is a backport of the release notes from the 1.34.1 release.

r? @ghost

5 years agoRollup merge of #60307 - dima74:fix/56018, r=GuillaumeGomez
Mazdak Farrokhzad [Sat, 27 Apr 2019 12:12:38 +0000 (14:12 +0200)]
Rollup merge of #60307 - dima74:fix/56018, r=GuillaumeGomez

Make "Implementations on Foreign Types" items in sidebar link to specific impls

This solves #56018 for most cases (though not work for foreign impls with same names)

5 years agoRollup merge of #60292 - varkor:ty-tuple-substs, r=nikomatsakis
Mazdak Farrokhzad [Sat, 27 Apr 2019 12:12:37 +0000 (14:12 +0200)]
Rollup merge of #60292 - varkor:ty-tuple-substs, r=nikomatsakis

Replace the `&'tcx List<Ty<'tcx>>` in `TyKind::Tuple` with `SubstsRef<'tcx>`

Part of the suggested refactoring for https://github.com/rust-lang/rust/issues/42340. As expected, this is a little messy, because there are many places that the components of tuples are expected to be types, rather than arbitrary kinds. However, it should open up the way for a refactoring of `TyS` itself.

r? @nikomatsakis

5 years agoAuto merge of #59887 - eddyb:safer-metadata, r=Zoxc
bors [Sat, 27 Apr 2019 08:13:23 +0000 (08:13 +0000)]
Auto merge of #59887 - eddyb:safer-metadata, r=Zoxc

rustc_metadata: more safely read/write the index positions.

This is a small part of a larger refactor, that I want to benchmark independently.
The final code would be even cleaner than this, so this is sort of an "worst case" test.

5 years agoAuto merge of #59540 - Zoxc:the-arena-2, r=michaelwoerister
bors [Sat, 27 Apr 2019 05:24:11 +0000 (05:24 +0000)]
Auto merge of #59540 - Zoxc:the-arena-2, r=michaelwoerister

Use arenas to avoid Lrc in queries #1

Based on https://github.com/rust-lang/rust/pull/59536.

5 years agoAuto merge of #60306 - RalfJung:xargo, r=alexcrichton
bors [Fri, 26 Apr 2019 21:46:17 +0000 (21:46 +0000)]
Auto merge of #60306 - RalfJung:xargo, r=alexcrichton

include rustc-std-workspace-alloc in rust-src

This is needed to fix https://github.com/japaric/xargo/issues/240

5 years agoUpdate handling of Tuple
varkor [Thu, 25 Apr 2019 23:27:33 +0000 (00:27 +0100)]
Update handling of Tuple

5 years agoReplace `&'tcx List<Ty<'tcx>>` in `Tuple` with `SubstsRef<'tcx>`
varkor [Thu, 25 Apr 2019 23:26:57 +0000 (00:26 +0100)]
Replace `&'tcx List<Ty<'tcx>>` in `Tuple` with `SubstsRef<'tcx>`

5 years agoAdd expect_ty method to Kind
varkor [Thu, 25 Apr 2019 23:26:33 +0000 (00:26 +0100)]
Add expect_ty method to Kind

5 years agoMake "Implementations on Foreign Types" items in sidebar link to specific impls
Dmitry Murzin [Fri, 26 Apr 2019 14:06:20 +0000 (17:06 +0300)]
Make "Implementations on Foreign Types" items in sidebar link to specific impls

5 years agoUpdate rustc-rayon version
John Kåre Alsaker [Thu, 25 Apr 2019 20:50:41 +0000 (22:50 +0200)]
Update rustc-rayon version

5 years agoUse "capacity" as parameter name in with_capacity() methods
Matthias Geier [Fri, 26 Apr 2019 16:43:24 +0000 (18:43 +0200)]
Use "capacity" as parameter name in with_capacity() methods

Closes #60271.

5 years agobootstrap: use correct version numbers for llvm-tools and lldb
Pietro Albini [Fri, 26 Apr 2019 16:25:31 +0000 (18:25 +0200)]
bootstrap: use correct version numbers for llvm-tools and lldb

5 years agoLimit internalization in LLVM 8 ThinLTO
Josh Stone [Fri, 26 Apr 2019 15:58:14 +0000 (08:58 -0700)]
Limit internalization in LLVM 8 ThinLTO

5 years agoupdate release notes for 1.34.1
Pietro Albini [Tue, 23 Apr 2019 14:18:11 +0000 (16:18 +0200)]
update release notes for 1.34.1

5 years agoinclude rustc-std-workspace-alloc in rust-src
Ralf Jung [Fri, 26 Apr 2019 14:19:53 +0000 (16:19 +0200)]
include rustc-std-workspace-alloc in rust-src

5 years agoAuto merge of #60303 - CryZe:patch-6, r=Centril
bors [Fri, 26 Apr 2019 12:49:11 +0000 (12:49 +0000)]
Auto merge of #60303 - CryZe:patch-6, r=Centril

Stabilize pointer::align_offset

Closes #44488

5 years agoRemove feature gates from std and tests
Christopher Serr [Fri, 26 Apr 2019 10:33:42 +0000 (12:33 +0200)]
Remove feature gates from std and tests

5 years agoStabilize pointer::align_offset
Christopher Serr [Fri, 26 Apr 2019 10:15:12 +0000 (12:15 +0200)]
Stabilize pointer::align_offset

Closes #44488

5 years agoAuto merge of #60240 - mati865:musl_toolchain, r=alexcrichton
bors [Fri, 26 Apr 2019 07:32:34 +0000 (07:32 +0000)]
Auto merge of #60240 - mati865:musl_toolchain, r=alexcrichton

 Bootstrap x86_64 musl by itself

It should slightly reduce build time and prepares ground for musl native tests.

NOTE: I haven't tested artifacts yet (only the build).

Can I have double try?

r? @alexcrichton

5 years agoAuto merge of #60167 - varkor:tidy-filelength, r=matthewjasper
bors [Fri, 26 Apr 2019 04:42:10 +0000 (04:42 +0000)]
Auto merge of #60167 - varkor:tidy-filelength, r=matthewjasper

Add a tidy check for files with over 3,000 lines

Files with a large number of lines can cause issues in GitHub (e.g. https://github.com/rust-lang/rust/issues/60015) and also tend to be indicative of opportunities to refactor into less monolithic structures.

This adds a new check to tidy to warn against files that have more than 3,000 lines, as suggested in https://github.com/rust-lang/rust/issues/60015#issuecomment-483868594. (This number was chosen fairly arbitrarily as a reasonable indicator of size.) This check can be ignored with `// ignore-tidy-filelength`.

Existing files with greater than 3,000 lines currently ignore the check, but this helps us spot when files are getting too large. (We might try to split up all files larger than this in the future, as in https://github.com/rust-lang/rust/issues/60015).

5 years agoAuto merge of #60296 - Centril:rollup-qh9la7k, r=Centril
bors [Fri, 26 Apr 2019 01:51:05 +0000 (01:51 +0000)]
Auto merge of #60296 - Centril:rollup-qh9la7k, r=Centril

Rollup of 12 pull requests

Successful merges:

 - #59734 (Prevent failure in case no space left on device in rustdoc)
 - #59940 (Set cfg(test) when rustdoc is running with --test option)
 - #60134 (Fix index-page generation)
 - #60165 (Add Pin::{into_inner,into_inner_unchecked})
 - #60183 (Chalkify: Add builtin Copy/Clone)
 - #60225 (Introduce hir::ExprKind::Use and employ in for loop desugaring.)
 - #60247 (Implement Debug for Place using Place::iterate)
 - #60259 (Derive Default instead of new in applicable lint)
 - #60267 (Add feature-gate for f16c target feature)
 - #60284 (Do not allow const generics to depend on type parameters)
 - #60285 (Do not ICE when checking types against foreign fn)
 - #60289 (Make `-Z allow-features` work for stdlib features)

Failed merges:

r? @ghost

5 years agoRollup merge of #60289 - tmandry:allow-features-include-std, r=cramertj
Mazdak Farrokhzad [Fri, 26 Apr 2019 01:50:26 +0000 (03:50 +0200)]
Rollup merge of #60289 - tmandry:allow-features-include-std, r=cramertj

Make `-Z allow-features` work for stdlib features

r? @cramertj

5 years agoRollup merge of #60285 - estebank:icent, r=varkor
Mazdak Farrokhzad [Fri, 26 Apr 2019 01:50:25 +0000 (03:50 +0200)]
Rollup merge of #60285 - estebank:icent, r=varkor

Do not ICE when checking types against foreign fn

Fix #60275.

5 years agoRollup merge of #60284 - varkor:const-param-of-type-param, r=cramertj
Mazdak Farrokhzad [Fri, 26 Apr 2019 01:50:24 +0000 (03:50 +0200)]
Rollup merge of #60284 - varkor:const-param-of-type-param, r=cramertj

Do not allow const generics to depend on type parameters

Fixes https://github.com/rust-lang/rust/issues/60264. In https://github.com/rust-lang/rust/pull/58191/files/b534cf992d0189032207f395c27ed092c89b40c7#diff-aeb0880081a991f34aef2ab889e1fb7a, it was suggested that there might be a better place for this error, but as this bug already affects stable, it's probably worth merging this now, and refactoring afterwards (I can open an issue for this).

5 years agoRollup merge of #60267 - gnzlbg:f16c_target_feature, r=alexcrichton
Mazdak Farrokhzad [Fri, 26 Apr 2019 01:50:22 +0000 (03:50 +0200)]
Rollup merge of #60267 - gnzlbg:f16c_target_feature, r=alexcrichton

Add feature-gate for f16c target feature

r? @alexcrichton

5 years agoRollup merge of #60259 - sd234678:60181-derive-default-lints, r=Centril
Mazdak Farrokhzad [Fri, 26 Apr 2019 01:50:21 +0000 (03:50 +0200)]
Rollup merge of #60259 - sd234678:60181-derive-default-lints, r=Centril

Derive Default instead of new in applicable lint

Closes #60181

As far as I can see, at least within the `src/librustc_lint` directory this is the only place this is applicable.

5 years agoRollup merge of #60247 - spastorino:place2_3, r=oli-obk
Mazdak Farrokhzad [Fri, 26 Apr 2019 01:50:20 +0000 (03:50 +0200)]
Rollup merge of #60247 - spastorino:place2_3, r=oli-obk

Implement Debug for Place using Place::iterate

r? @oli-obk

5 years agoRollup merge of #60225 - Centril:hir-exprkind-use-in-for-loops, r=oli-obk
Mazdak Farrokhzad [Fri, 26 Apr 2019 01:50:18 +0000 (03:50 +0200)]
Rollup merge of #60225 - Centril:hir-exprkind-use-in-for-loops, r=oli-obk

Introduce hir::ExprKind::Use and employ in for loop desugaring.

In the `for $pat in $expr $block` desugaring we end with a `{ let _result = $match_expr; _result }` construct which makes `for` loops into a terminating scope and affects drop order. The construct was introduced in year 2015 by @pnkfelix in https://github.com/rust-lang/rust/pull/21984.

This PR replaces the construct with `hir::ExprKind::Use(P<hir::Expr>)` which is equivalent semantically but should hopefully be less costly in terms of compile time performance (to be determined).

This is extracted out of https://github.com/rust-lang/rust/pull/59288/commits/91b0abdfb23f980d2e5d5c30bc65ed8e95b04788 from https://github.com/rust-lang/rust/pull/59288 for easier review and so that the perf implications wrt. `for`-loops can be measured.

r? @oli-obk

5 years agoRollup merge of #60183 - tmandry:chalk-builtin-copy-clone, r=scalexm
Mazdak Farrokhzad [Fri, 26 Apr 2019 01:50:17 +0000 (03:50 +0200)]
Rollup merge of #60183 - tmandry:chalk-builtin-copy-clone, r=scalexm

Chalkify: Add builtin Copy/Clone

r? @nikomatsakis

5 years agoRollup merge of #60165 - Nemo157:pin-into-inner, r=cramertj
Mazdak Farrokhzad [Fri, 26 Apr 2019 01:50:16 +0000 (03:50 +0200)]
Rollup merge of #60165 - Nemo157:pin-into-inner, r=cramertj

Add Pin::{into_inner,into_inner_unchecked}

These functions are useful for unsafe code that needs to temporarily pull smart pointers out of the `Pin`, e.g. [the change that inspired them](https://github.com/Nemo157/futures-rs/commit/b4361780faf764c7cb046ed75f863a6fcfd44800#diff-1a4e0ba4d1b539412ca576411ec6c7c2R258) is taking a `Pin<Box<dyn Future>>`, turning it into a `*mut dyn Future` via `Box::into_raw(unsafe { Pin::into_inner_unchecked(pin) })` then later dropping this via `drop(Pin::from(Box::from_raw(ptr)))`. This can be accomplished today via `{ let ptr = unsafe { Pin::get_unchecked_mut(pin.as_mut()) } as *mut dyn Future; mem::forget(pin); ptr }`, but this is far more complicated and loses out on the symmetry of using `Box::into_raw` and `Box::from_raw`.

I'll extend the documentation on what guarantees `into_inner_unchecked` needs to uphold once I get some feedback on whether this API is wanted or not.

r? @withoutboats

5 years agoRollup merge of #60134 - GuillaumeGomez:fix-index-page, r=Manishearth
Mazdak Farrokhzad [Fri, 26 Apr 2019 01:50:14 +0000 (03:50 +0200)]
Rollup merge of #60134 - GuillaumeGomez:fix-index-page, r=Manishearth

Fix index-page generation

Fixes #60096.

The minifier was minifying crates name in `searchIndex` key position, which was a bit problematic for multiple reasons.

r? @rust-lang/rustdoc

5 years agoRollup merge of #59940 - GuillaumeGomez:rustdoc-test, r=ollie27
Mazdak Farrokhzad [Fri, 26 Apr 2019 01:50:13 +0000 (03:50 +0200)]
Rollup merge of #59940 - GuillaumeGomez:rustdoc-test, r=ollie27

Set cfg(test) when rustdoc is running with --test option

Following a [discussion on twitter](https://twitter.com/burntsushi5/status/1117091914199785473), I proposed this change. What do you think about it?

r? @QuietMisdreavus

cc @BurntSushi

5 years agoRollup merge of #59734 - GuillaumeGomez:improve-rustdoc-failure, r=ollie27
Mazdak Farrokhzad [Fri, 26 Apr 2019 01:50:11 +0000 (03:50 +0200)]
Rollup merge of #59734 - GuillaumeGomez:improve-rustdoc-failure, r=ollie27

Prevent failure in case no space left on device in rustdoc

Fixes #59703.

r? @QuietMisdreavus

5 years agoAdd comment explaining restriction
varkor [Thu, 25 Apr 2019 22:29:58 +0000 (23:29 +0100)]
Add comment explaining restriction

5 years agoFix error code description
varkor [Thu, 25 Apr 2019 22:19:36 +0000 (23:19 +0100)]
Fix error code description

5 years agoMake `-Z allow-features` work for stdlib features
Tyler Mandry [Thu, 25 Apr 2019 21:03:45 +0000 (14:03 -0700)]
Make `-Z allow-features` work for stdlib features

5 years agoFix false position on style.rs itself
varkor [Thu, 25 Apr 2019 20:54:09 +0000 (21:54 +0100)]
Fix false position on style.rs itself

5 years agoAdvise the user on how to suppress the file length tidy error
varkor [Mon, 22 Apr 2019 20:05:57 +0000 (21:05 +0100)]
Advise the user on how to suppress the file length tidy error

5 years agoignore-tidy-filelength on all files with greater than 3000 lines
varkor [Mon, 22 Apr 2019 14:29:04 +0000 (15:29 +0100)]
ignore-tidy-filelength on all files with greater than 3000 lines

5 years agoAdd a tidy test for line count
varkor [Mon, 22 Apr 2019 14:28:48 +0000 (15:28 +0100)]
Add a tidy test for line count

5 years agoAuto merge of #59111 - gilescope:generator-better-errors, r=nikomatsakis
bors [Thu, 25 Apr 2019 20:27:16 +0000 (20:27 +0000)]
Auto merge of #59111 - gilescope:generator-better-errors, r=nikomatsakis

Improved error message when type must be bound due to generator.

Fixes #58930.

Keen to get some feedback - is this as minimal as we can get it or is there an existing visitor I could repurpose?

5 years agoDo not ICE when checking types against foreign fn
Esteban Küber [Thu, 25 Apr 2019 20:16:21 +0000 (13:16 -0700)]
Do not ICE when checking types against foreign fn

5 years agoAdd a test for const parameters with type parameters as types
varkor [Thu, 25 Apr 2019 20:12:17 +0000 (21:12 +0100)]
Add a test for const parameters with type parameters as types

5 years agoMake sure const params with type params don't cause errors without a feature gate
varkor [Thu, 25 Apr 2019 20:12:03 +0000 (21:12 +0100)]
Make sure const params with type params don't cause errors without a feature gate

5 years agoPrevent const parameters having type parameters as types
varkor [Thu, 25 Apr 2019 20:11:46 +0000 (21:11 +0100)]
Prevent const parameters having type parameters as types

5 years agoAuto merge of #60192 - t-rapp:tr-saturating-funcs, r=alexcrichton
bors [Thu, 25 Apr 2019 17:26:20 +0000 (17:26 +0000)]
Auto merge of #60192 - t-rapp:tr-saturating-funcs, r=alexcrichton

Implement saturating_abs() and saturating_neg() functions for signed integer types

Similar to wrapping_abs() / wrapping_neg() functions but saturating at the numeric bounds instead of wrapping around. Complements the existing set of functions with saturation mechanics.

cc #59983

5 years agoUpdate trait queries
John Kåre Alsaker [Fri, 30 Nov 2018 22:37:18 +0000 (23:37 +0100)]
Update trait queries

5 years agoUpdate trait_impls_of
John Kåre Alsaker [Fri, 30 Nov 2018 19:34:25 +0000 (20:34 +0100)]
Update trait_impls_of

5 years agoUpdate mir_const_qualif
John Kåre Alsaker [Fri, 30 Nov 2018 18:55:11 +0000 (19:55 +0100)]
Update mir_const_qualif

5 years agoUpdate rvalue_promotable_map
John Kåre Alsaker [Fri, 30 Nov 2018 16:45:33 +0000 (17:45 +0100)]
Update rvalue_promotable_map

5 years agoUpdate region_scope_tree
John Kåre Alsaker [Fri, 30 Nov 2018 16:38:31 +0000 (17:38 +0100)]
Update region_scope_tree

5 years agoImproved error message when type must be bound due to generator.
Giles Cope [Mon, 11 Mar 2019 18:46:20 +0000 (18:46 +0000)]
Improved error message when type must be bound due to generator.

Error now mentions type var name and span is highlighted.

5 years agoAdd tests for saturating_abs() and saturating_neg functions
Tobias Rapp [Wed, 24 Apr 2019 15:18:29 +0000 (17:18 +0200)]
Add tests for saturating_abs() and saturating_neg functions

5 years agoAdd saturating_abs() and saturating_neg() functions to signed integer types
Tobias Rapp [Wed, 17 Apr 2019 13:28:57 +0000 (15:28 +0200)]
Add saturating_abs() and saturating_neg() functions to signed integer types

Similar to wrapping_abs() / wrapping_neg() functions but saturating at
the numeric bounds instead of wrapping around. Complements the existing
set of functions with saturation mechanics.

5 years agoAuto merge of #60257 - matthiaskrgr:submodule_upd, r=oli-obk
bors [Thu, 25 Apr 2019 14:10:19 +0000 (14:10 +0000)]
Auto merge of #60257 - matthiaskrgr:submodule_upd, r=oli-obk

submodules: update clippy from 9897442f to 8c0e038f

Should fix clippy/rls toolstate breakage

Changes:
````
Rustup for https://github.com/rust-lang/rust/pull/59042
Update pulldown_cmark to 0.5
Only run AppVeyor on r+, try and the master branch
Remove approx_constant known problems
Suppress let_and_return if let has attributes
Add test for or_fun_call macro suggestion
UI test cleanup: Extract needless_range_loop tests
Change "if types change" to "if you later change the type"
````

r? @oli-obk

5 years agoAdd feature-gate for f16c target feature
gnzlbg [Thu, 25 Apr 2019 13:44:22 +0000 (15:44 +0200)]
Add feature-gate for f16c target feature

5 years agoImplement Debug for Place using Place::iterate
Santiago Pastorino [Wed, 24 Apr 2019 22:21:10 +0000 (19:21 -0300)]
Implement Debug for Place using Place::iterate

5 years agoImprovement comment explanations
Guillaume Gomez [Thu, 25 Apr 2019 11:20:43 +0000 (13:20 +0200)]
Improvement comment explanations

5 years agosubmodules: update clippy from 9897442f to 8c0e038f
Matthias Krüger [Thu, 25 Apr 2019 11:11:05 +0000 (13:11 +0200)]
submodules: update clippy from 9897442f to 8c0e038f

Changes:
````
Rustup for https://github.com/rust-lang/rust/pull/59042
Update pulldown_cmark to 0.5
Only run AppVeyor on r+, try and the master branch
Remove approx_constant known problems
Suppress let_and_return if let has attributes
Add test for or_fun_call macro suggestion
UI test cleanup: Extract needless_range_loop tests
Change "if types change" to "if you later change the type"
````

5 years agoIntroduce hir::ExprKind::Use and employ in for loop desugaring.
Mazdak Farrokhzad [Wed, 24 Apr 2019 04:39:40 +0000 (06:39 +0200)]
Introduce hir::ExprKind::Use and employ in for loop desugaring.

Here, ExprKind::Use(P<Expr>) tweaks the drop order to act the
same way as '{ let _tmp = expr; _tmp }' does.

5 years agoAuto merge of #60248 - estebank:macro-comma, r=oli-obk
bors [Thu, 25 Apr 2019 09:22:30 +0000 (09:22 +0000)]
Auto merge of #60248 - estebank:macro-comma, r=oli-obk

Add guard for missing comma in macro call suggestion

Fix #60233. Follow up to #58796.

r? @oli-obk

5 years agoAuto merge of #60162 - gnzlbg:uss, r=alexcrichton
bors [Thu, 25 Apr 2019 06:34:07 +0000 (06:34 +0000)]
Auto merge of #60162 - gnzlbg:uss, r=alexcrichton

Breaking update of stdsimd

This commit updates stdsimd and contains two breaking changes:

* https://github.com/rust-lang-nursery/stdsimd/pull/733
* https://github.com/rust-lang-nursery/stdsimd/pull/586

We already did a crater run of 586 but we should do another one here.

r? @alexcrichton

5 years agoAuto merge of #60250 - Centril:rollup-d9tehhr, r=Centril
bors [Thu, 25 Apr 2019 03:44:22 +0000 (03:44 +0000)]
Auto merge of #60250 - Centril:rollup-d9tehhr, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #59560 (MIR generation cleanup)
 - #59697 (tweak unresolved label suggestion)
 - #60038 (Add codegen test for PGO instrumentation.)
 - #60160 (Fix #58270, fix off-by-one error in error diagnostics.)
 - #60185 (Reexport IntErrorKind in std)
 - #60243 (Add regression test for #53249.)

Failed merges:

r? @ghost

5 years agoRollup merge of #60243 - davidtwco:issue-53249, r=cramertj
Mazdak Farrokhzad [Thu, 25 Apr 2019 01:05:26 +0000 (03:05 +0200)]
Rollup merge of #60243 - davidtwco:issue-53249, r=cramertj

Add regression test for #53249.

Fixes #53249.

r? @cramertj

5 years agoRollup merge of #60185 - NieDzejkob:int-error-kind-reexport, r=rkruppe
Mazdak Farrokhzad [Thu, 25 Apr 2019 01:05:25 +0000 (03:05 +0200)]
Rollup merge of #60185 - NieDzejkob:int-error-kind-reexport, r=rkruppe

Reexport IntErrorKind in std

Currently `IntErrorKind` can only be found in `core`. @Centril confirmed on Discord that this is unintentional (should I r? him in this situation?).

Should there be a test for this? As far as this *specific* situation goes, I don't think so, I'll risk it and say that there's no way this regresses. However, it might be a good idea to have some tool detect public items in `core` that are not reexported in `std`. Does this belong in tidy, or should that be a separate tool? Is there some rustc-specific *linter*? Unless that's entirely a dumb idea, this should probably get an issue.

Note: My local build hasn't finished yet, but it's well past the point where I would expect problems.

5 years agoRollup merge of #60160 - xldenis:fix-overlapping-zero-width-annotation, r=estebank
Mazdak Farrokhzad [Thu, 25 Apr 2019 01:05:24 +0000 (03:05 +0200)]
Rollup merge of #60160 - xldenis:fix-overlapping-zero-width-annotation, r=estebank

Fix #58270, fix off-by-one error in error diagnostics.

This fixes #58270 by checking if two diagnostics overlap completely when we're calculating the line offset for each message.

5 years agoRollup merge of #60038 - michaelwoerister:pgo-updates-2, r=alexcrichton
Mazdak Farrokhzad [Thu, 25 Apr 2019 01:05:22 +0000 (03:05 +0200)]
Rollup merge of #60038 - michaelwoerister:pgo-updates-2, r=alexcrichton

Add codegen test for PGO instrumentation.

This PR adds a codegen test that makes sure that LLVM actually generates instrumentation code when we enable PGO instrumentation in `rustc`.

The second commit updates a test case to the new commandline option syntax introduced in #59874. Without the fix the test still works, but it confusingly creates a directory called `test.profraw`, which usually is the name of the _file_ where profiling data is collected.

5 years agoRollup merge of #59697 - euclio:label-fixes, r=zackmdavis
Mazdak Farrokhzad [Thu, 25 Apr 2019 01:05:20 +0000 (03:05 +0200)]
Rollup merge of #59697 - euclio:label-fixes, r=zackmdavis

tweak unresolved label suggestion

Only suggest label names in the same hygiene context, and use a
structured suggestion.

Question for reviewer: Is this the right way to check for label hygiene?

5 years agoRollup merge of #59560 - matthewjasper:mir-generation-cleanup, r=oli-obk
Mazdak Farrokhzad [Thu, 25 Apr 2019 01:05:19 +0000 (03:05 +0200)]
Rollup merge of #59560 - matthewjasper:mir-generation-cleanup, r=oli-obk

MIR generation cleanup

* Handle the case where the body of a constant is a subtype of the type of the constant (see `mir_static_subtype.rs`).
* Move the evaluation of `ExprKind::Use` into `into.rs`, saving an unnecessary copy.

5 years agoAuto merge of #59042 - ljedrz:HirIdification_rework_map, r=Zoxc
bors [Thu, 25 Apr 2019 00:53:28 +0000 (00:53 +0000)]
Auto merge of #59042 - ljedrz:HirIdification_rework_map, r=Zoxc

HirIdification: rework Map

The next iteration of HirIdification (#57578).

- remove `NodeId` from `Entry`
- change `Map::map` to an `FxHashMap<HirId, Entry>`
- base the `NodeId` `Map` methods on `HirId` ones (reverses the current state)
- HirIdify `librustdoc` a little bit (some `NodeId` `Map` methods were converted to work on `HirId`s)

The second change might have performance implications, so I'd do a perf run to be sure it's fine; it simplifies the codebase and shouldn't have an impact as long as the `Map` searches are cached (which is now possible thanks to using `HirId`s).

r? @Zoxc

5 years agoAdd guard for missing comma in macro call suggestion
Esteban Küber [Wed, 24 Apr 2019 23:45:29 +0000 (16:45 -0700)]
Add guard for missing comma in macro call suggestion

5 years agoUpdate inferred_outlives_of
John Kåre Alsaker [Fri, 30 Nov 2018 14:11:51 +0000 (15:11 +0100)]
Update inferred_outlives_of

5 years agoAdd builtin impls for int and float inference vars in chalk
Tyler Mandry [Wed, 24 Apr 2019 22:57:36 +0000 (15:57 -0700)]
Add builtin impls for int and float inference vars in chalk

5 years agochalkify: Add Copy/Clone builtins
Tyler Mandry [Mon, 22 Apr 2019 21:35:37 +0000 (14:35 -0700)]
chalkify: Add Copy/Clone builtins

5 years agoRemove useless code and update index page test
Guillaume Gomez [Wed, 24 Apr 2019 21:45:18 +0000 (23:45 +0200)]
Remove useless code and update index page test

5 years agoPrevent failure in case no space left on device in rustdoc
Guillaume Gomez [Fri, 5 Apr 2019 19:31:11 +0000 (21:31 +0200)]
Prevent failure in case no space left on device in rustdoc

5 years agoAdd test for rustdoc cfg(test) feature
Guillaume Gomez [Wed, 24 Apr 2019 20:26:42 +0000 (22:26 +0200)]
Add test for rustdoc cfg(test) feature

5 years agoAdd regression test for #53249.
David Wood [Wed, 24 Apr 2019 18:11:10 +0000 (19:11 +0100)]
Add regression test for #53249.

5 years agoSet test flag when rustdoc is running with --test option
Guillaume Gomez [Sat, 13 Apr 2019 16:00:40 +0000 (18:00 +0200)]
Set test flag when rustdoc is running with --test option

5 years agoAdd Pin::{into_inner,into_inner_unchecked}
Wim Looman [Sun, 21 Apr 2019 11:27:36 +0000 (13:27 +0200)]
Add Pin::{into_inner,into_inner_unchecked}

5 years agoDerive Default for EllipsisInclusiveRangePatterns
sd234678 [Wed, 24 Apr 2019 18:38:10 +0000 (19:38 +0100)]
Derive Default for EllipsisInclusiveRangePatterns

5 years agoEvaluate hair::ExprKind::Use in into
Matthew Jasper [Sat, 30 Mar 2019 13:05:33 +0000 (13:05 +0000)]
Evaluate hair::ExprKind::Use in into

This avoids some unnecessary moves

5 years agoAllow subtyping of the final expression of a constant
Matthew Jasper [Sat, 30 Mar 2019 13:00:41 +0000 (13:00 +0000)]
Allow subtyping of the final expression of a constant

Fixes an ICE for the following code:

fn foo(_ : &()) {}
static X: fn(&'static ()) = foo;

5 years agoRemove incorrect debug assertion in interpret
Matthew Jasper [Sat, 29 Dec 2018 21:10:00 +0000 (21:10 +0000)]
Remove incorrect debug assertion in interpret

Cast type may be a subtype of the destination type. There is a later
assertion that they have the same layout.

5 years agoDerive Default instead of new in applicable lint
sd234678 [Wed, 24 Apr 2019 12:47:26 +0000 (13:47 +0100)]
Derive Default instead of new in applicable lint

5 years agodoc: some HirIdification
ljedrz [Sat, 9 Mar 2019 08:22:08 +0000 (09:22 +0100)]
doc: some HirIdification

5 years agohir: make NodeId methods depend on HirId ones
ljedrz [Sat, 9 Mar 2019 07:57:35 +0000 (08:57 +0100)]
hir: make NodeId methods depend on HirId ones

5 years agohir: remove NodeId from Entry & simplify Map
ljedrz [Sat, 9 Mar 2019 07:23:35 +0000 (08:23 +0100)]
hir: remove NodeId from Entry & simplify Map

5 years agoBootstrap x86_64 musl by itself
Mateusz Mikuła [Wed, 24 Apr 2019 16:12:49 +0000 (18:12 +0200)]
Bootstrap x86_64 musl by itself

5 years agoAuto merge of #60180 - ehuss:update-cargo-books, r=alexcrichton
bors [Wed, 24 Apr 2019 15:19:57 +0000 (15:19 +0000)]
Auto merge of #60180 - ehuss:update-cargo-books, r=alexcrichton

Update cargo, books

## cargo

5 commits in b6581d383ed596b133e330011658c6f83cf85c2f..6be12653dcefb46ee7b605f063ee75b5e6cba513
2019-04-16 16:02:11 +0000 to 2019-04-19 15:05:03 +0000
- Improved docs for `maintenance` options (rust-lang/cargo#6863)
- publish-lockfile: Various updates (rust-lang/cargo#6840)
- Treat HTTP/2 stream errors as spurious network errors. (rust-lang/cargo#6861)
- Validate registry token before operations that require it. (rust-lang/cargo#6854)
- Cleanups wrt DYLD_FALLBACK_LIBRARY_PATH handling (rust-lang/cargo#6856)

## reference

2 commits in 98f90ff4de8e588f651f0fb493b5c7496551cd59..2a2de9ce095979978ad7b582daecf94e4070b916
2019-04-06 09:29:08 -0700 to 2019-04-22 10:25:52 -0700
- Remove unused link references. (rust-lang-nursery/reference#560)
- Fix attribute redirects. (rust-lang-nursery/reference#562)

## book

22 commits in b93ec30bbc7b1b5c2f44223249ab359bed2ed5a6..db919bc6bb9071566e9c4f05053672133eaac33e
2019-03-26 16:54:10 -0400 to 2019-04-15 20:11:03 -0400
- Link to chapters mentioned in chapter 12
- Split up a long sentence
- Unclear wording 4.3 (rust-lang/book#1907)
- Corrected error for array out of bounds (rust-lang/book#1900)
- Make lifetime explanation clearer (rust-lang/book#1901)
- Replace `T: 'a + Messenger` with `T: Messenger` (rust-lang/book#1831)
- Update range so matches rust-fmt . (rust-lang/book#1890)
- Adding trailing comma (rust-lang/book#1891)
- point 2018 book redirects to existing pages instead of index (rust-lang/book#1919)
- Update ch04-03-slices.md (rust-lang/book#1921)
- Update link for Russian translation. (rust-lang/book#1915)
- Ch7 layout (rust-lang/book#1917)
- Update the version of mdbook we use in-tree to match rust-lang/rust (rust-lang/book#1912)
- Fix spellingz
- Update listings in ch 19-6 for nostarch
- Add a high-level overview of the changes in this version of the book
- Fix Travis CI badge url (rust-lang/book#1893)
- Redo listing numbers in chapter 19 after removals
- Remove Advanced Lifetimes section completely
- Merge branch 'gh1780'
- Merge remote-tracking branch 'origin/master' into gh1567
- remove lifetime subtyping

## rust-by-example

4 commits in f68ef3d0f4959f6a7d92a08d9994b117f0f4d32d..1ff0f8e018838a710ebc0cc1a7bf74ebe73ad9f1
2019-03-12 15:32:12 -0300 to 2019-04-15 08:15:32 -0300
- Fix borrow so it fails in 2018 edition Fixes rust-lang/rust-by-example#1141 (rust-lang/rust-by-example#1152)
- Replace lvalue and rvalue with place and value (rust-lang/rust-by-example#1160)
- Mutate array in iter_mut() example (rust-lang/rust-by-example#1165)
- Fix a typo ("half" -&gt; "halve") (rust-lang/rust-by-example#1172)

## rustc-guide

8 commits in 464cb5b166378dff64619081dd4c42533a1eb989..99e1b1d53656be08654df399fc200584aebb50e4
2019-03-23 18:39:14 -0500 to 2019-04-20 09:57:54 -0500
- Update BodyId description
- Update test-implementation chapter to current code
- update chalk with new organization
- move to subsection
- fix MovePathIndex link
- Update query chapter for the query macro rewrite
- subchapter with information about `--error-format json`
- Update query-evaluation-model-in-detail.md

## edition-guide

1 commits in b56ddb11548450a6df4edd1ed571b2bc304eb9e6..c413d42a207bd082f801ec0137c31b71e4bfed4c
2019-03-10 10:23:16 +0100 to 2019-04-22 01:14:56 +0200
- fix command (rust-lang-nursery/edition-guide#155)

## embedded-book

1 commits in 7989c723607ef5b13b57208022259e6c771e11d0..de3d55f521e657863df45260ebbca1b10527f662
2019-04-04 12:14:37 +0000 to 2019-04-22 12:58:28 +0000
- Minor fixes  (rust-embedded/book#185)

## nomicon

6 commits in c02e0e7754a76886e55b976a3a4fac20100cd35d..fb29b147be4d9a1f8e24aba753a7e1de537abf61
2019-03-25 16:52:56 -0400 to 2019-04-22 19:10:29 -0400
- Fix link to copy_nonoverlapping (rust-lang-nursery/nomicon#134)
- Various unchecked-uninit improvements (rust-lang-nursery/nomicon#130)
- OOM behaviour in `vec-alloc.md` (rust-lang-nursery/nomicon#133)
- Added missing "things". (rust-lang-nursery/nomicon#131)
- Fix number agreement in subtyping chapter (rust-lang-nursery/nomicon#128)
- Minor improvements (rust-lang-nursery/nomicon#129)

5 years agoFix ignore-logic for sanitizer run-make tests.
Michael Woerister [Wed, 24 Apr 2019 09:14:24 +0000 (11:14 +0200)]
Fix ignore-logic for sanitizer run-make tests.

5 years agoAuto merge of #60213 - Manishearth:clippyup, r=oli-obk
bors [Wed, 24 Apr 2019 06:09:05 +0000 (06:09 +0000)]
Auto merge of #60213 - Manishearth:clippyup, r=oli-obk

Update clippy

r? @oli-obk @centril

5 years agoUpdate cargo, books
Eric Huss [Mon, 22 Apr 2019 20:12:52 +0000 (13:12 -0700)]
Update cargo, books

5 years agoAuto merge of #60224 - Centril:rollup-lfuhhsk, r=Centril
bors [Wed, 24 Apr 2019 03:16:47 +0000 (03:16 +0000)]
Auto merge of #60224 - Centril:rollup-lfuhhsk, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #56278 (Future-proof MIR for dedicated debuginfo.)
 - #59739 (Stabilize futures_api)
 - #59822 (Fix dark css rule)
 - #60186 (Temporarily accept [i|u][32|size] suffixes on a tuple index and warn)
 - #60190 (Don't generate unnecessary rmeta files.)

Failed merges:

r? @ghost