]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAuto merge of #60039 - rasendubi:assert-trailing-junk, r=alexcrichton
bors [Mon, 29 Apr 2019 14:50:17 +0000 (14:50 +0000)]
Auto merge of #60039 - rasendubi:assert-trailing-junk, r=alexcrichton

Make assert! ensure the macro is parsed completely

Fixes https://github.com/rust-lang/rust/issues/60024

5 years agoAuto merge of #60364 - JohnTitor:stabilize-const-needs-drop, r=oli-obk
bors [Mon, 29 Apr 2019 09:48:11 +0000 (09:48 +0000)]
Auto merge of #60364 - JohnTitor:stabilize-const-needs-drop, r=oli-obk

const-stabilize: std::mem::needs_drop

Closes #51929

r? @oli-obk

5 years agoAuto merge of #60338 - petrochenkov:notidy, r=varkor
bors [Mon, 29 Apr 2019 05:18:12 +0000 (05:18 +0000)]
Auto merge of #60338 - petrochenkov:notidy, r=varkor

tidy: Fix some more false positives for long URLs

A URL that's simply longer than 100 characters is ok regardless of context.

r? @varkor

5 years agoconst-stabilize std::mem::needs_drop
Yuki OKUSHI [Mon, 29 Apr 2019 03:41:06 +0000 (12:41 +0900)]
const-stabilize std::mem::needs_drop

5 years agoAuto merge of #60182 - matklad:lexer-cleanup, r=petrochenkov
bors [Mon, 29 Apr 2019 01:22:12 +0000 (01:22 +0000)]
Auto merge of #60182 - matklad:lexer-cleanup, r=petrochenkov

Lexer cleanup

another couple of tiny cleanups

5 years agoAuto merge of #60317 - flip1995:internal_lints, r=oli-obk
bors [Sun, 28 Apr 2019 20:42:09 +0000 (20:42 +0000)]
Auto merge of #60317 - flip1995:internal_lints, r=oli-obk

Internal lints: usage_of_qualified_ty & ty_pass_by_reference

Closes #59952

Implements internal lints:

- `USAGE_OF_QUALIFIED_TY`
- `TY_PASS_BY_REFERENCE`

r? @oli-obk

5 years agoRemove unused TyCtxt argument from allow_two_phase_borrow function
flip1995 [Sun, 28 Apr 2019 19:13:33 +0000 (21:13 +0200)]
Remove unused TyCtxt argument from allow_two_phase_borrow function

5 years agoFix lint findings in librustdoc
flip1995 [Sat, 27 Apr 2019 16:37:18 +0000 (18:37 +0200)]
Fix lint findings in librustdoc

5 years agoFix lint findings in librustc_mir
flip1995 [Fri, 26 Apr 2019 12:26:49 +0000 (14:26 +0200)]
Fix lint findings in librustc_mir

5 years agoFix lint findings in librustc_traits
flip1995 [Fri, 26 Apr 2019 12:10:46 +0000 (14:10 +0200)]
Fix lint findings in librustc_traits

5 years agoFix lint findings in librustc_typeck
flip1995 [Fri, 26 Apr 2019 11:41:10 +0000 (13:41 +0200)]
Fix lint findings in librustc_typeck

5 years agoFix lint findings in librustc_metadata
flip1995 [Fri, 26 Apr 2019 09:44:42 +0000 (11:44 +0200)]
Fix lint findings in librustc_metadata

5 years agoFix lint findings in librustc
flip1995 [Thu, 25 Apr 2019 20:54:19 +0000 (22:54 +0200)]
Fix lint findings in librustc

5 years agoUpdate *.stderr files
flip1995 [Wed, 24 Apr 2019 21:24:00 +0000 (23:24 +0200)]
Update *.stderr files

5 years agoAdd tests
flip1995 [Wed, 24 Apr 2019 21:23:44 +0000 (23:23 +0200)]
Add tests

5 years agoImplement internal lints
flip1995 [Wed, 24 Apr 2019 21:22:54 +0000 (23:22 +0200)]
Implement internal lints

- USAGE_OF_QUALIFIED_TY

- TY_PASS_BY_REFERENCE

5 years agoAuto merge of #60352 - Centril:const-incomplete-features, r=oli-obk
bors [Sun, 28 Apr 2019 15:40:00 +0000 (15:40 +0000)]
Auto merge of #60352 - Centril:const-incomplete-features, r=oli-obk

Float 'incomplete_features' out to a const for visibility

Float `let incomplete_features` out to a `const INCOMPLETE_FEATURES` and colocate near `active` features so that it is easier to find and edit.

r? @oli-obk

(use rollup)

5 years agoFloat 'incomplete_features' out to a const for visibility.
Mazdak Farrokhzad [Sun, 28 Apr 2019 13:13:35 +0000 (15:13 +0200)]
Float 'incomplete_features' out to a const for visibility.

5 years agoAuto merge of #60351 - Centril:rollup-5xv3tka, r=Centril
bors [Sun, 28 Apr 2019 12:50:06 +0000 (12:50 +0000)]
Auto merge of #60351 - Centril:rollup-5xv3tka, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #60022 (Document `Item` type in `std::env::SplitPaths` iterator.)
 - #60270 (rustc: Flag metadata compatible with multiple CGUs)
 - #60325 (Document ast::ExprKind::Type)
 - #60347 (Remove `-Z two-phase-borrows` and `-Z two-phase-beyond-autoref`)

Failed merges:

r? @ghost

5 years agoRollup merge of #60347 - JohnTitor:remove-flags, r=matthewjasper
Mazdak Farrokhzad [Sun, 28 Apr 2019 12:17:12 +0000 (14:17 +0200)]
Rollup merge of #60347 - JohnTitor:remove-flags, r=matthewjasper

Remove `-Z two-phase-borrows` and `-Z two-phase-beyond-autoref`

fixes #60331

5 years agoRollup merge of #60325 - Centril:doc-ast-exprkind-type, r=oli-obk
Mazdak Farrokhzad [Sun, 28 Apr 2019 12:17:11 +0000 (14:17 +0200)]
Rollup merge of #60325 - Centril:doc-ast-exprkind-type, r=oli-obk

Document ast::ExprKind::Type

r? @oli-obk

5 years agoRollup merge of #60270 - alexcrichton:metadata-multi-cgu, r=oli-obk
Mazdak Farrokhzad [Sun, 28 Apr 2019 12:17:10 +0000 (14:17 +0200)]
Rollup merge of #60270 - alexcrichton:metadata-multi-cgu, r=oli-obk

rustc: Flag metadata compatible with multiple CGUs

It looks like the `OutputType::Metadata` kind in the compiler was
misclassified in #38571 long ago by accident as incompatible with
codegen units and a single output file. This means that if you emit both
a linkable artifact and metadata it silently turns off multiple codegen
units unintentionally!

This commit corrects the situation to ensure that if `--emit metadata`
is used it doesn't implicitly disable multiple codegen units. This will
ensure we don't accidentally regress compiler performance when striving
to implement pipelined compilation!

5 years agoRollup merge of #60022 - nathankleyn:fix-issue-59543, r=Centril
Mazdak Farrokhzad [Sun, 28 Apr 2019 12:17:08 +0000 (14:17 +0200)]
Rollup merge of #60022 - nathankleyn:fix-issue-59543, r=Centril

Document `Item` type in `std::env::SplitPaths` iterator.

Previously there wasn't any documentation to show what the type of
`Item` was inside `std::env::SplitPaths`. Now, in the same format as
other examples of docs in `std` for `Iterator#Item`, we mention the
type.

This fixes #59543.

r? @steveklabnik

5 years agoRemove unnecessary function
Yuki OKUSHI [Sun, 28 Apr 2019 10:31:54 +0000 (19:31 +0900)]
Remove unnecessary function

5 years agoAuto merge of #60346 - dima74:patch-1, r=GuillaumeGomez
bors [Sun, 28 Apr 2019 09:58:59 +0000 (09:58 +0000)]
Auto merge of #60346 - dima74:patch-1, r=GuillaumeGomez

Fix default value for setting "Auto-hide item methods' documentation"

If I open any documentation page in incognito mode (for example [for `Option` enum](https://doc.rust-lang.org/nightly/std/option/enum.Option.html)), then methods will be collapsed, though [on the settings page](https://doc.rust-lang.org/nightly/settings.html) there will be displayed that "Auto-hide item methods' documentation" option is disabled.

If I understand correctly, property "Auto-hide item methods' documentation" [should be disabled by default](https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/render.rs#L1969), so correct check would be `property === "true"`. This is consistent with other options:

Options which are enabled by default are compared to `"false"`

https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/render.rs#L1965-L1968

https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/static/main.js#L2238
https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/static/main.js#L2321
https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/static/main.js#L2070

Options which are disabled by default are compared to `"true"`

https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/render.rs#L1970-L1972

https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/static/main.js#L1389
https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/static/main.js#L2334

5 years agoRemove two-phase-beyond-autoref
Yuki OKUSHI [Sun, 28 Apr 2019 03:51:04 +0000 (12:51 +0900)]
Remove two-phase-beyond-autoref

5 years agoRemove two-phase-borrows
Yuki OKUSHI [Sun, 28 Apr 2019 03:22:47 +0000 (12:22 +0900)]
Remove two-phase-borrows

5 years agoAuto merge of #60333 - Centril:stabilize-iterator-copied, r=varkor
bors [Sun, 28 Apr 2019 01:46:11 +0000 (01:46 +0000)]
Auto merge of #60333 - Centril:stabilize-iterator-copied, r=varkor

Stabilize Iterator::copied in 1.36.0

Per https://github.com/rust-lang/rust/issues/57127#issuecomment-487289429.

Closes https://github.com/rust-lang/rust/issues/57127.

r? @varkor

5 years agoFix default value for setting "Auto-hide item methods' documentation"
Dmitry Murzin [Sun, 28 Apr 2019 01:25:22 +0000 (04:25 +0300)]
Fix default value for setting "Auto-hide item methods' documentation"

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 agotidy: Fix false positives from long URLs
Vadim Petrochenkov [Sat, 27 Apr 2019 17:29:27 +0000 (20:29 +0300)]
tidy: Fix false positives from long URLs

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 agoStabilize Iterator::copied in 1.36.0.
Mazdak Farrokhzad [Sat, 27 Apr 2019 14:45:30 +0000 (16:45 +0200)]
Stabilize Iterator::copied in 1.36.0.

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 agoDocument ast::ExprKind::Type.
Mazdak Farrokhzad [Sat, 27 Apr 2019 10:06:02 +0000 (12:06 +0200)]
Document ast::ExprKind::Type.

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 agorustc: Flag metadata compatible with multiple CGUs
Alex Crichton [Thu, 25 Apr 2019 16:06:38 +0000 (09:06 -0700)]
rustc: Flag metadata compatible with multiple CGUs

It looks like the `OutputType::Metadata` kind in the compiler was
misclassified in #38571 long ago by accident as incompatible with
codegen units and a single output file. This means that if you emit both
a linkable artifact and metadata it silently turns off multiple codegen
units unintentionally!

This commit corrects the situation to ensure that if `--emit metadata`
is used it doesn't implicitly disable multiple codegen units. This will
ensure we don't accidentally regress compiler performance when striving
to implement pipelined compilation!

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