]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRemove submodule step from README
Nick Cameron [Fri, 11 Jan 2019 01:27:12 +0000 (14:27 +1300)]
Remove submodule step from README

Since the bootstrap does it now

5 years agoAuto merge of #57484 - alexcrichton:fix-nightlies, r=Mark-Simulacru
bors [Thu, 10 Jan 2019 21:31:34 +0000 (21:31 +0000)]
Auto merge of #57484 - alexcrichton:fix-nightlies, r=Mark-Simulacru

Integrate miri into build-manifest

This fixes a mistake where miri was accidentally left out of the
build-manifest parsing, meaning that today's nightly generated a
manifest with invalid urls!

Fixes #57488.

5 years agoIntegrate miri into build-manifest
Alex Crichton [Thu, 10 Jan 2019 01:14:11 +0000 (17:14 -0800)]
Integrate miri into build-manifest

This fixes a mistake where miri was accidentally left out of the
build-manifest parsing, meaning that today's nightly generated a
manifest with invalid urls!

5 years agoAuto merge of #57419 - cramertj:pin-set, r=withouboats
bors [Wed, 9 Jan 2019 13:48:37 +0000 (13:48 +0000)]
Auto merge of #57419 - cramertj:pin-set, r=withouboats

Reborrow Pin<P> using &mut in `Pin::set`

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

This makes it possible to call `.set` multiple times without
using `.as_mut()` first to reborrow the pointer.

r? @withoutboats
cc @rust-lang/libs

5 years agoAuto merge of #56614 - Zoxc:query-perf2, r=michaelwoerister
bors [Wed, 9 Jan 2019 11:08:14 +0000 (11:08 +0000)]
Auto merge of #56614 - Zoxc:query-perf2, r=michaelwoerister

Replace LockCell with atomic types

Split from https://github.com/rust-lang/rust/pull/56509

r? @michaelwoerister

5 years agoAuto merge of #57086 - oli-obk:miri_dist, r=kennytm
bors [Wed, 9 Jan 2019 06:42:11 +0000 (06:42 +0000)]
Auto merge of #57086 - oli-obk:miri_dist, r=kennytm

Prepare everything for distributing miri via rustup

The next step is to tell rustup about `cargo-miri` in https://github.com/rust-lang/rustup.rs/blob/31935e5f633a5acd3a203d23b61d1556c64a821c/src/rustup/lib.rs#L28 and https://github.com/rust-lang/rustup.rs/blob/1ccd706d1d572c777c5134bd7db7aa1a8df7f278/src/rustup-win-installer/src/lib.rs#L29

5 years agoAuto merge of #56407 - GuillaumeGomez:missing-docs-reexported-macros, r=varkor
bors [Tue, 8 Jan 2019 22:16:13 +0000 (22:16 +0000)]
Auto merge of #56407 - GuillaumeGomez:missing-docs-reexported-macros, r=varkor

check missing docs for reexported macros as well

Fixes #56334.

5 years agoAuto merge of #56638 - matthewjasper:remove-ref-region, r=nikomatsakis
bors [Tue, 8 Jan 2019 19:33:20 +0000 (19:33 +0000)]
Auto merge of #56638 - matthewjasper:remove-ref-region, r=nikomatsakis

Remove some `Region`s from HAIR

Use `ReErased` for any regions that need to be created in RValue::Ref
in MIR generation. We will change them to all to `ReVar` before borrow
checking anyway.

r? @nikomatsakis

5 years agoUpdate stdsimd submodule
Guillaume Gomez [Mon, 7 Jan 2019 15:20:25 +0000 (16:20 +0100)]
Update stdsimd submodule

5 years agoAuto merge of #57429 - alexcrichton:fix-dist, r=Mark-Simulacrum
bors [Tue, 8 Jan 2019 16:47:27 +0000 (16:47 +0000)]
Auto merge of #57429 - alexcrichton:fix-dist, r=Mark-Simulacrum

Build LLVM with -static-libstdc++ on dist builds

This commit is intended on fixing a regression from #57286 where the
distributed LLVM shared library unfortunately depends on a dynamic copy
of libstdc++, meaning we're no longer as binary compatible as we
thought! This tweaks the build of LLVM as out distribution is slightly
different now, and is hoped to fix the issue.

Closes #57426

5 years agoMore feature whitelisting of winapi
Oliver Scherer [Mon, 7 Jan 2019 16:17:41 +0000 (17:17 +0100)]
More feature whitelisting of winapi

5 years agoAdjust cargo workspace hack to miri/cargo interactions
Oliver Scherer [Tue, 1 Jan 2019 13:36:05 +0000 (14:36 +0100)]
Adjust cargo workspace hack to miri/cargo interactions

5 years agofixup
Oliver Scherer [Sun, 23 Dec 2018 20:31:45 +0000 (21:31 +0100)]
fixup

5 years agoPrepare everything for distributing miri via rustup
Oliver Scherer [Sun, 23 Dec 2018 20:20:35 +0000 (21:20 +0100)]
Prepare everything for distributing miri via rustup

5 years agoIgnore some IDE-local files
Oliver Scherer [Sun, 23 Dec 2018 20:21:02 +0000 (21:21 +0100)]
Ignore some IDE-local files

5 years agoAuto merge of #57114 - Zoxc:query-perf11, r=michaelwoerister
bors [Tue, 8 Jan 2019 14:11:19 +0000 (14:11 +0000)]
Auto merge of #57114 - Zoxc:query-perf11, r=michaelwoerister

Clean up and optimize OpenTask / read_index

r? @michaelwoerister

5 years agoAuto merge of #56988 - alexcrichton:monotonic-instant, r=sfackler
bors [Tue, 8 Jan 2019 11:30:19 +0000 (11:30 +0000)]
Auto merge of #56988 - alexcrichton:monotonic-instant, r=sfackler

std: Force `Instant::now()` to be monotonic

This commit is an attempt to force `Instant::now` to be monotonic
through any means possible. We tried relying on OS/hardware/clock
implementations, but those seem buggy enough that we can't rely on them
in practice. This commit implements the same hammer Firefox recently
implemented (noted in #56612) which is to just keep whatever the lastest
`Instant::now()` return value was in memory, returning that instead of
the OS looks like it's moving backwards.

Closes #48514
Closes #49281
cc #51648
cc #56560
Closes #56612
Closes #56940

5 years agoAuto merge of #57332 - Dylan-DPC:feature/stabilise-cfg-attr, r=Centril
bors [Tue, 8 Jan 2019 07:49:13 +0000 (07:49 +0000)]
Auto merge of #57332 - Dylan-DPC:feature/stabilise-cfg-attr, r=Centril

stabilize cfg_attr_multi

Stabilizes cfg_attr_multi feature

Related to #54881

Will add the lint in a seperate PR

r? @Centril

5 years agoBuild LLVM with -static-libstdc++ on dist builds
Alex Crichton [Mon, 7 Jan 2019 21:47:35 +0000 (13:47 -0800)]
Build LLVM with -static-libstdc++ on dist builds

This commit is intended on fixing a regression from #57286 where the
distributed LLVM shared library unfortunately depends on a dynamic copy
of libstdc++, meaning we're no longer as binary compatible as we
thought! This tweaks the build of LLVM as out distribution is slightly
different now, and is hoped to fix the issue.

Closes #57426

5 years agoAuto merge of #57095 - Zoxc:prof-fix, r=michaelwoerister
bors [Tue, 8 Jan 2019 02:00:12 +0000 (02:00 +0000)]
Auto merge of #57095 - Zoxc:prof-fix, r=michaelwoerister

Fix and optimize query profiling

r? @michaelwoerister

cc @wesleywiser

5 years agoReborrow Pin<P> using &mut in `Pin::set`
Taylor Cramer [Mon, 7 Jan 2019 19:45:34 +0000 (11:45 -0800)]
Reborrow Pin<P> using &mut in `Pin::set`

This makes it possible to call `.set` multiple times without
using `.as_mut()` first to reborrow the pointer.

5 years agoAuto merge of #57303 - matthiaskrgr:clippy_submodule_upd, r=oli-obk
bors [Mon, 7 Jan 2019 19:44:00 +0000 (19:44 +0000)]
Auto merge of #57303 - matthiaskrgr:clippy_submodule_upd, r=oli-obk

submodules: update clippy and rls

Fixes clippy toolstate

Changes:
````
Update to latest compiletest-rs release
add testcase for #3462
deps: bump rustc_tools_util version from 0.1.0 to 0.1.1 just in case...
rustc_tool_utils: fix failure to create proper non-repo version string when used in crates on crates.io, bump version
UI test cleanup: Extract ifs_same_cond tests
UI test cleanup: Extract for_kv_map lint tests
Fix test for rust-lang/rust#57250
Limit infinite_iter collect() check to known types
Some improvements to util documentation
Use hashset for name blacklist
Reformat random_state tests
Use node_id_to_type_opt instead of node_it_to_type in random_state
Check pattern equality while checking declaration equality
random_state lint
Use an FxHashSet for valid idents in documentation lint
Fix suggestion for unnecessary_ref lint
Update CONTRIBUTING.md for rustfix tests
Update .fixed files via update-references.sh
Run rustfix on first UI test
Use WIP branch for compiletest_rs
````

Also updates RLS and removes the patching of rustc_tool_utils from cargo.toml

RLS changes:
````
update clippy hash and rustc_tools_util and use rustc_tools_util from crates.io
Work around https://github.com/rust-lang/rust/pull/55937
Update Clippy... again
Update Clippy
Update clippy
````
r? @oli-obk

5 years agobless you
dylan_DPC [Sun, 6 Jan 2019 12:07:28 +0000 (17:37 +0530)]
bless you

5 years agoremove unwanted stage0 line, fix style
dylan_DPC [Fri, 4 Jan 2019 17:33:36 +0000 (23:03 +0530)]
remove unwanted stage0 line, fix style

5 years agoremove unused imports and feature gate from tests
dylan_DPC [Fri, 4 Jan 2019 11:51:29 +0000 (17:21 +0530)]
remove unused imports and feature gate from tests

5 years agostabilise cfg_attr
dylan_DPC [Fri, 4 Jan 2019 07:07:27 +0000 (12:37 +0530)]
stabilise cfg_attr

5 years agoRevert "Auto merge of #57101 - o01eg:fix-57014, r=alexcrichton"
Matthias Krüger [Sun, 6 Jan 2019 12:55:15 +0000 (13:55 +0100)]
Revert "Auto merge of #57101 - o01eg:fix-57014, r=alexcrichton"

This reverts commit 68614265d312fc2cbe8a696f7dabb9416eb6f221, reversing
changes made to cae623c5ce12df8f237264d8f2c31fdaa664c382.

Should fix tools on windows.

Reopens #57014

5 years agosubmodules: update rls from 6f5e4bb to 1a6361b
Matthias Krüger [Sat, 5 Jan 2019 14:44:23 +0000 (15:44 +0100)]
submodules: update rls from 6f5e4bb to 1a6361b

Changes:
````
Update Clippy
Move TestFailures when collecting failures
Update languageserver-types to 0.51.1
update clippy hash and rustc_tools_util and use rustc_tools_util from crates.io
Work around https://github.com/rust-lang/rust/pull/55937
Update Clippy... again
Update Clippy
Update clippy
````

5 years agosubmodules: update clippy from 39bd8449 to c63b6349
Matthias Krüger [Sat, 5 Jan 2019 14:40:10 +0000 (15:40 +0100)]
submodules: update clippy from 39bd8449 to c63b6349

Changes:
````
Revert "tests: used_underscore_binding_macro: disable random_state lint."
Revert "Auto merge of #3603 - xfix:random-state-lint, r=phansch"
rustup https://github.com/rust-lang/rust/pull/56837
rustup (don't know the exact PR unfortunately)
Add itertools to integration tests
tests: used_underscore_binding_macro: disable random_state lint.
Trigger `use_self` lint in local macros
Add run-rustfix where it already passes
rustup: https://github.com/rust-lang/rust/pull/55517
Make clippy work with parallel rustc
Add ui/for_kv_map test for false positive in #1279
Update to latest compiletest-rs release
add testcase for #3462
deps: bump rustc_tools_util version from 0.1.0 to 0.1.1 just in case...
Use compiletest's aux-build header instead of include macro
rustc_tool_utils: fix failure to create proper non-repo version string when used in crates on crates.io, bump version
rustfmt
UI test cleanup: Extract ifs_same_cond tests
Extract IteratorFalsePositives into option_helpers.rs
UI test cleanup: Extract for_kv_map lint tests
UI test cleanup: Extract lint from methods.rs test
Fix test for rust-lang/rust#57250
Limit infinite_iter collect() check to known types
Some improvements to util documentation
Use hashset for name blacklist
Reformat random_state tests
Use node_id_to_type_opt instead of node_it_to_type in random_state
Check pattern equality while checking declaration equality
random_state lint
Move constant write checks to temporary_assignment lint
Use an FxHashSet for valid idents in documentation lint
Fix suggestion for unnecessary_ref lint
Update CONTRIBUTING.md for rustfix tests
Update .fixed files via update-references.sh
Run rustfix on first UI test
Use WIP branch for compiletest_rs
````

5 years agoRename some functions
John Kåre Alsaker [Mon, 7 Jan 2019 17:50:51 +0000 (18:50 +0100)]
Rename some functions

5 years agoFix and optimize query profiling
John Kåre Alsaker [Mon, 24 Dec 2018 12:35:37 +0000 (13:35 +0100)]
Fix and optimize query profiling

5 years agoAuto merge of #57405 - pietroalbini:rollup, r=pietroalbini
bors [Mon, 7 Jan 2019 17:01:25 +0000 (17:01 +0000)]
Auto merge of #57405 - pietroalbini:rollup, r=pietroalbini

Rollup of 6 pull requests

Successful merges:

 - #57290 (remove outdated comment)
 - #57308 (Make CompileController thread-safe)
 - #57358 (use utf-8 throughout htmldocck)
 - #57369 (Provide the option to use libc++ even on all platforms)
 - #57375 (Add duration constants)
 - #57403 (Make extern ref HTTPS)

Failed merges:

 - #57370 (Support passing cflags/cxxflags/ldflags to LLVM build)

r? @ghost

5 years agostd: Force `Instant::now()` to be monotonic
Alex Crichton [Wed, 19 Dec 2018 18:29:23 +0000 (10:29 -0800)]
std: Force `Instant::now()` to be monotonic

This commit is an attempt to force `Instant::now` to be monotonic
through any means possible. We tried relying on OS/hardware/clock
implementations, but those seem buggy enough that we can't rely on them
in practice. This commit implements the same hammer Firefox recently
implemented (noted in #56612) which is to just keep whatever the lastest
`Instant::now()` return value was in memory, returning that instead of
the OS looks like it's moving backwards.

Closes #48514
Closes #49281
cc #51648
cc #56560
Closes #56612
Closes #56940

5 years agoRollup merge of #57403 - claudijd:tweak_code_of_conduct, r=alexcrichton
Pietro Albini [Mon, 7 Jan 2019 15:25:41 +0000 (16:25 +0100)]
Rollup merge of #57403 - claudijd:tweak_code_of_conduct, r=alexcrichton

Make extern ref HTTPS

Basically, saw an HTTP link and noticed it could be HTTPS.  When visiting the link, the URL pattern changed on the site since last linking, so fixed that too!

5 years agoRollup merge of #57375 - stjepang:duration-constants, r=joshtriplett
Pietro Albini [Mon, 7 Jan 2019 15:25:40 +0000 (16:25 +0100)]
Rollup merge of #57375 - stjepang:duration-constants, r=joshtriplett

Add duration constants

Add constants `SECOND`, `MILLISECOND`, `MICROSECOND`, and `NANOSECOND` to `core::time`.

This will make working with durations more ergonomic. Compare:

```rust
// Convenient, but deprecated function.
thread::sleep_ms(2000);

// The current canonical way to sleep for two seconds.
thread::sleep(Duration::from_secs(2));

// Sleeping using one of the new constants.
thread::sleep(2 * SECOND);
```

5 years agoRollup merge of #57369 - petrhosek:llvm-libcxx, r=alexcrichton
Pietro Albini [Mon, 7 Jan 2019 15:25:38 +0000 (16:25 +0100)]
Rollup merge of #57369 - petrhosek:llvm-libcxx, r=alexcrichton

Provide the option to use libc++ even on all platforms

This is the default on platforms which use libc++ as the default C++
library but this option allows using libc++ on others as well.

5 years agoRollup merge of #57358 - euclio:docck-unicode, r=QuietMisdreavus
Pietro Albini [Mon, 7 Jan 2019 15:25:36 +0000 (16:25 +0100)]
Rollup merge of #57358 - euclio:docck-unicode, r=QuietMisdreavus

use utf-8 throughout htmldocck

This commit improves compatibility with Python 3, which already uses
Unicode throughout.

It also fixes a subtle incompatibility stemming from the use of
`entitydefs`, which contains replacement text _encoded in latin-1_ for
HTML entities. When using Python 3, this would cause `0xa0` to be
incorrectly added to the element tree.

This meant that there was a rustdoc test that would pass under Python 2
but fail under Python 3, due to an incorrect regex match against the
non-breaking space character. This commit triggers that failure in both
versions, and also fixes it.

5 years agoRollup merge of #57308 - Zoxc:controller-sync, r=michaelwoerister
Pietro Albini [Mon, 7 Jan 2019 15:25:35 +0000 (16:25 +0100)]
Rollup merge of #57308 - Zoxc:controller-sync, r=michaelwoerister

Make CompileController thread-safe

5 years agoRollup merge of #57290 - mark-i-m:remove-outdated-comment, r=michaelwoerister
Pietro Albini [Mon, 7 Jan 2019 15:25:33 +0000 (16:25 +0100)]
Rollup merge of #57290 - mark-i-m:remove-outdated-comment, r=michaelwoerister

remove outdated comment

https://github.com/rust-lang/rust/issues/44234 was closed, apparently solved by #45353

r? @michaelwoerister

5 years agoMake extern ref HTTPS
Jonathan Claudius [Mon, 7 Jan 2019 14:52:32 +0000 (09:52 -0500)]
Make extern ref HTTPS

5 years agoAuto merge of #57304 - davidtwco:issue-57280, r=nikomatsakis
bors [Mon, 7 Jan 2019 14:16:27 +0000 (14:16 +0000)]
Auto merge of #57304 - davidtwco:issue-57280, r=nikomatsakis

NLL: Fix bug in associated constant type annotations.

Fixes #57280.

This PR reverses the variance used when relating types from the type
annotation of an associated constant - this matches the behaviour of the
lexical borrow checker and fixes a bug whereby matching a `&'a str`
against a `&'static str` would produce an error.

r? @nikomatsakis

5 years agoAuto merge of #57336 - ehuss:bump-stage0, r=alexcrichton
bors [Mon, 7 Jan 2019 11:31:32 +0000 (11:31 +0000)]
Auto merge of #57336 - ehuss:bump-stage0, r=alexcrichton

Bump stage0

Updates stage 0
From: rustc 1.32.0-beta.2 (a01e4761a 2018-12-08)
To:   rustc 1.32.0-beta.11 (e64fee6a3 2019-01-04)

Intended to pull in #57292 which will fix #57142.

The following is a list of PRs this also pulls in in case anyone is interested in seeing the changes:

#56930
#56961
#57236
#57305

5 years agoSpecify the tracking issue
Stjepan Glavina [Mon, 7 Jan 2019 10:39:22 +0000 (11:39 +0100)]
Specify the tracking issue

5 years agoAuto merge of #57327 - akash-fortanix:aa/update-compiler_builtins, r=kennytm
bors [Mon, 7 Jan 2019 08:55:49 +0000 (08:55 +0000)]
Auto merge of #57327 - akash-fortanix:aa/update-compiler_builtins, r=kennytm

Update compiler_builtins 0.1.2 -> 0.1.4

r? @alexcrichton

5 years agoAuto merge of #57394 - euclio:compiletest-optimization, r=Mark-Simulacrum
bors [Mon, 7 Jan 2019 06:17:37 +0000 (06:17 +0000)]
Auto merge of #57394 - euclio:compiletest-optimization, r=Mark-Simulacrum

slightly optimize compiletest test collection

Save quite a few syscalls and avoiding pushing in a loop.

5 years agoslightly optimize compiletest test collection
Andy Russell [Mon, 7 Jan 2019 04:18:00 +0000 (23:18 -0500)]
slightly optimize compiletest test collection

Save quite a few syscalls and avoiding pushing in a loop.

5 years agoAuto merge of #57365 - sinkuu:unused, r=oli-obk
bors [Mon, 7 Jan 2019 03:44:41 +0000 (03:44 +0000)]
Auto merge of #57365 - sinkuu:unused, r=oli-obk

Remove unused code

5 years agoAuto merge of #57379 - petrochenkov:parsrecov, r=estebank
bors [Mon, 7 Jan 2019 01:05:45 +0000 (01:05 +0000)]
Auto merge of #57379 - petrochenkov:parsrecov, r=estebank

tests: Do not use `-Z parse-only`, continue compilation to test recovery

Make tests closer to reality!

The next step will be enabling `-Z continue-parse-after-error` by default and looking at the regressions.

A few instances of `-Z parse-only` are kept when it's appropriate, see e.g `ui/impl-trait/impl-trait-plus-priority.rs`, which tests mostly semantically wrong code and would generate too much useless noise if allowed to continue.

5 years agoAuto merge of #57344 - petrochenkov:regreach, r=arielb1
bors [Sun, 6 Jan 2019 22:26:16 +0000 (22:26 +0000)]
Auto merge of #57344 - petrochenkov:regreach, r=arielb1

privacy: Fix regression in impl reachability

Rollback to pre-https://github.com/rust-lang/rust/pull/56878 logic of determining reachability.
`reachability(impl Trait<Substs> for Type<Substs>) = reachability(Trait & Type)`, substs are ignored.

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

5 years agotests: Do not use `-Z parse-only`, continue compilation to test recovery
Vadim Petrochenkov [Sun, 6 Jan 2019 15:33:05 +0000 (18:33 +0300)]
tests: Do not use `-Z parse-only`, continue compilation to test recovery

5 years agocheck missing docs for reexported macros as well
Guillaume Gomez [Sat, 1 Dec 2018 13:46:25 +0000 (14:46 +0100)]
check missing docs for reexported macros as well

5 years agoUpdate compiler_builtins 0.1.2 -> 0.1.4
akashfortanix [Fri, 4 Jan 2019 04:04:31 +0000 (09:34 +0530)]
Update compiler_builtins 0.1.2 -> 0.1.4

5 years agoAuto merge of #57272 - petrochenkov:featrecov, r=estebank
bors [Sun, 6 Jan 2019 15:40:58 +0000 (15:40 +0000)]
Auto merge of #57272 - petrochenkov:featrecov, r=estebank

Make sure feature gate errors are recoverable (take 2)

Continuation of https://github.com/rust-lang/rust/pull/56999/commits/15cefe4b2a65bb2a4febcd353cb37b90dfafa4f1.
Turns out I missed the most important part - the main feature gate checking pass.

5 years agoAuto merge of #57121 - glaubitz:flock-fixes, r=nagisa
bors [Sun, 6 Jan 2019 13:05:11 +0000 (13:05 +0000)]
Auto merge of #57121 - glaubitz:flock-fixes, r=nagisa

flock: Use fcntl constants directly from libc crate on Unix targets

Since the values for the fcntl constants can vary from architecture
to architecture, it is better to use the values defined in the libc
crate instead of assigning literals in the flock code which would
make the assumption that all architectures use the same values.

Fixes #57007

5 years agoRe-export constants from core into std
Stjepan Glavina [Sun, 6 Jan 2019 13:02:42 +0000 (14:02 +0100)]
Re-export constants from core into std

5 years agoAdd duration constants
Stjepan Glavina [Sun, 6 Jan 2019 12:44:55 +0000 (13:44 +0100)]
Add duration constants

5 years agoFix CI failures
Vadim Petrochenkov [Sun, 6 Jan 2019 12:35:39 +0000 (15:35 +0300)]
Fix CI failures

5 years agoMake sure feature gate errors are recoverable (take 2)
Vadim Petrochenkov [Wed, 2 Jan 2019 14:14:24 +0000 (17:14 +0300)]
Make sure feature gate errors are recoverable (take 2)

5 years agoflock: Use fcntl constants directly from libc crate on Unix targets
John Paul Adrian Glaubitz [Sun, 6 Jan 2019 10:02:30 +0000 (11:02 +0100)]
flock: Use fcntl constants directly from libc crate on Unix targets

Since the values for the fcntl constants can vary from architecture
to architecture, it is better to use the values defined in the libc
crate instead of assigning literals in the flock code which would
make the assumption that all architectures use the same values.

Fixes #57007

5 years agoAuto merge of #57291 - euclio:method-call-suggestion, r=estebank
bors [Sun, 6 Jan 2019 10:30:05 +0000 (10:30 +0000)]
Auto merge of #57291 - euclio:method-call-suggestion, r=estebank

use structured suggestion for method calls

Furthermore, don't suggest calling the method if it is part of a place
expression, as this is invalid syntax.

I'm thinking it might be worth putting a label on the method assignment span like "this is a method" and removing the span from the "methods are immutable" text so it isn't reported twice.

The suggestions in `src/test/ui/did_you_mean/issue-40396.stderr` are suboptimal. I could check if the containing expression is `BinOp`, but I'm not sure if that's general enough. Any ideas?

r? @estebank

5 years agoUpdate libc to 0.2.46
John Paul Adrian Glaubitz [Sun, 6 Jan 2019 10:01:42 +0000 (11:01 +0100)]
Update libc to 0.2.46

5 years agoAuto merge of #57287 - alexcrichton:fix-jemalloc, r=nikomatsakis
bors [Sun, 6 Jan 2019 07:48:16 +0000 (07:48 +0000)]
Auto merge of #57287 - alexcrichton:fix-jemalloc, r=nikomatsakis

rustc: Fix regression where jemalloc isn't used

In #56986 the linkage of jemalloc to the compiler was switched from the
driver library to the rustc binary to ensure that only rustc itself uses
jemalloc. In doing so, however, it turns out jemalloc wasn't actually
linked in at all! None of the symbols were referenced so the static
library wasn't used. This means that jemalloc wasn't pulled in at all.

This commit performs a bit of a dance to reference jemalloc symbols,
attempting to pull it in despite LLVM's optimizations.

Closes #57115

5 years agouse utf-8 throughout htmldocck
Andy Russell [Sat, 5 Jan 2019 19:17:51 +0000 (14:17 -0500)]
use utf-8 throughout htmldocck

This commit improves compatibility with Python 3, which already uses
Unicode throughout.

It also fixes a subtle incompatibility stemming from the use of
`entitydefs`, which contains replacement text _encoded in latin-1_ for
HTML entities. When using Python 3, this would cause `0xa0` to be
incorrectly added to the element tree.

This meant that there was a rustdoc test that would pass under Python 2
but fail under Python 3, due to an incorrect regex match against the
non-breaking space character. This commit triggers that failure in both
versions, and also fixes it.

5 years agoProvide the option to use libc++ even on all platforms
Petr Hosek [Wed, 14 Nov 2018 00:25:51 +0000 (16:25 -0800)]
Provide the option to use libc++ even on all platforms

This is the default on platforms which use libc++ as the default C++
library but this option allows using libc++ on others as well.

5 years agoAuto merge of #57263 - ishitatsuyuki:bump-openssl, r=sfackler
bors [Sun, 6 Jan 2019 05:08:59 +0000 (05:08 +0000)]
Auto merge of #57263 - ishitatsuyuki:bump-openssl, r=sfackler

Upgrade openssl and openssl-sys

Fix #57169

5 years agoAuto merge of #57286 - alexcrichton:less-thin-2-2, r=nikomatsakis
bors [Sun, 6 Jan 2019 02:26:20 +0000 (02:26 +0000)]
Auto merge of #57286 - alexcrichton:less-thin-2-2, r=nikomatsakis

bootstrap: Link LLVM as a dylib with ThinLTO (take 2)

When building a distributed compiler on Linux where we use ThinLTO to
create the LLVM shared object this commit switches the compiler to
dynamically linking that LLVM artifact instead of statically linking to
LLVM. The primary goal here is to reduce CI compile times, avoiding two+
ThinLTO builds of all of LLVM. By linking dynamically to LLVM we'll
reuse the one ThinLTO step done by LLVM's build itself.

Lots of discussion about this change can be found [here] and down. A
perf run will show whether this is worth it or not!

[here]: https://github.com/rust-lang/rust/pull/53245#issuecomment-417015334

---

This PR previously landed in https://github.com/rust-lang/rust/pull/56944, caused https://github.com/rust-lang/rust/issues/57111, and was reverted in https://github.com/rust-lang/rust/pull/57116. I've added one more commit here which should fix the breakage that we saw.

5 years agoUpgrade openssl and openssl-sys
Tatsuyuki Ishi [Wed, 2 Jan 2019 10:06:36 +0000 (19:06 +0900)]
Upgrade openssl and openssl-sys

5 years agoRemove unused code
Shotaro Yamada [Sun, 6 Jan 2019 01:08:11 +0000 (10:08 +0900)]
Remove unused code

5 years agoAddress review comments
Vadim Petrochenkov [Sat, 5 Jan 2019 20:46:04 +0000 (23:46 +0300)]
Address review comments

5 years agoAuto merge of #57230 - estebank:return-mismatch, r=varkor
bors [Sat, 5 Jan 2019 22:25:47 +0000 (22:25 +0000)]
Auto merge of #57230 - estebank:return-mismatch, r=varkor

Modify mismatched type error for functions with no return

Fix #50009.

```
error[E0308]: mismatched types
  --> $DIR/coercion-missing-tail-expected-type.rs:3:24
   |
LL | fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types
   |    --------            ^^^ expected i32, found ()
   |    |
   |    this function's body doesn't return
LL |     x + 1;
   |          - help: consider removing this semicolon
   |
   = note: expected type `i32`
              found type `()`
```

instead of

```
error[E0308]: mismatched types
  --> $DIR/coercion-missing-tail-expected-type.rs:3:28
   |
LL |   fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types
   |  ____________________________^
LL | |     x + 1;
   | |          - help: consider removing this semicolon
LL | | }
   | |_^ expected i32, found ()
   |
   = note: expected type `i32`
              found type `()`
```

5 years agoprivacy: Mark everything in a header of a reachable impl as reachable
Vadim Petrochenkov [Sat, 5 Jan 2019 18:56:49 +0000 (21:56 +0300)]
privacy: Mark everything in a header of a reachable impl as reachable

5 years agoprivacy: Fix regression in impl reachability
Vadim Petrochenkov [Fri, 4 Jan 2019 18:30:54 +0000 (21:30 +0300)]
privacy: Fix regression in impl reachability

5 years agoAuto merge of #57354 - kennytm:rollup, r=kennytm
bors [Sat, 5 Jan 2019 17:39:59 +0000 (17:39 +0000)]
Auto merge of #57354 - kennytm:rollup, r=kennytm

Rollup of 17 pull requests

Successful merges:

 - #57219 (Remove some unused code)
 - #57229 (Fix #56806 by using `delay_span_bug` in object safety layout sanity checks)
 - #57233 (Rename and fix nolink-with-link-args test)
 - #57238 (Fix backtraces for inlined functions on Windows)
 - #57249 (Fix broken links to second edition TRPL.)
 - #57267 (src/jemalloc is gone, remove its mention from COPYRIGHT)
 - #57273 (Update the stdsimd submodule)
 - #57278 (Add Clippy to config.toml.example)
 - #57295 (Fix 'be be' constructs)
 - #57311 (VaList::copy should not require a mutable ref)
 - #57312 (`const fn` is no longer coming soon (const keyword docs))
 - #57313 (Improve Box<T> -> Pin<Box<T>> conversion)
 - #57314 (Fix repeated word typos)
 - #57326 (Doc rewording, use the same name `writer`)
 - #57338 (rustdoc: force binary filename for compiled doctests)
 - #57342 (librustc_mir: Make qualify_min_const_fn module public)
 - #57343 (Calculate privacy access only via query)

Failed merges:

 - #57340 (Use correct tracking issue for c_variadic)

r? @ghost

5 years agoRollup merge of #57343 - Xanewok:querify-access-levels, r=nikomatsakis
kennytm [Sat, 5 Jan 2019 15:57:06 +0000 (23:57 +0800)]
Rollup merge of #57343 - Xanewok:querify-access-levels, r=nikomatsakis

Calculate privacy access only via query

Initially converted to query in https://github.com/rust-lang/rust/commit/a9f6babcda1479f4e5566d1aadbf9a0d99aa3182 and then changed to respect dependencies https://github.com/rust-lang/rust/commit/8281e883dd12260f00ce650aa8824507d9c447af.

I did this as an effort to prune `CrateAnalysis` from librustc_save_analysis, with the only thing remaining being the glob map (`name` is unused, existing `crate_name` is exposed in the compiler passes, instead).

Since calculating the glob map is opt-in, it'd be great if we could calculate that on-demand. However, it seems that it'd require converting resolution to queries, which I'm not sure how to do yet.

In an effort to get rid of `CrateAnalysis` altogether, could we try unconditionally calculating the glob_map in the resolver, thus completely removing `CrateAnalysis` struct, and doing a perf run?

r? @nikomatsakis

cc @petrochenkov do you have any idea how/if at all could we querify the resolver? I've stumbled upon a comment that's ~3? years old at the moment, so I'm guessing things might have changed and it actually may be feasible now. https://github.com/rust-lang/rust/blob/fe0c10019d7ee96909cc42cc265ef999a6b5dd70/src/librustc_driver/driver.rs#L589-L593

5 years agoRollup merge of #57342 - phansch:make_public, r=Centril
kennytm [Sat, 5 Jan 2019 15:57:04 +0000 (23:57 +0800)]
Rollup merge of #57342 - phansch:make_public, r=Centril

librustc_mir: Make qualify_min_const_fn module public

Trying to write a `const_fn` lint for Clippy. @oli-obk suggested
[here][link] to use the `is_min_const_fn` function from the
`qualify_min_const_fn` module. However, the module is currently private
and this commit makes it public.

I lack any historical knowledge of the development of the `const_fn`
feature, so I'm not sure if it was private on purpose or not. fwiw, all
modules are already public except `qualify_min_const_fn`.

r? @oli-obk

[link]: https://github.com/rust-lang/rust-clippy/issues/2440#issuecomment-446109978

5 years agoRollup merge of #57338 - QuietMisdreavus:doctest-file-name, r=GuillaumeGomez
kennytm [Sat, 5 Jan 2019 15:57:02 +0000 (23:57 +0800)]
Rollup merge of #57338 - QuietMisdreavus:doctest-file-name, r=GuillaumeGomez

rustdoc: force binary filename for compiled doctests

Fixes https://github.com/rust-lang/rust/issues/57317, needed for https://github.com/rust-lang/rust-by-example/issues/1137

Right now, when building a doctest, rustdoc provides the compiler an output directory (a temp dir) but lets the compiler name the executable. If the doctest needs to be executed, it then tries to run a binary named `rust_out` from that directory. For the most part, this works fine. However, if the doctest sets its own crate name, the compiler uses that name for the output binary instead. This causes rustdoc to try to execute a nonexistent binary, causing the test to fail.

This PR changes the paths rustdoc gives to the compiler when building doctests to force the output *filename* instead of just the *directory*.

5 years agoRollup merge of #57326 - king6cong:doc, r=rkruppe
kennytm [Sat, 5 Jan 2019 15:57:01 +0000 (23:57 +0800)]
Rollup merge of #57326 - king6cong:doc, r=rkruppe

Doc rewording, use the same name `writer`

None

5 years agoRollup merge of #57314 - wiktorkuchta:master, r=Centril
kennytm [Sat, 5 Jan 2019 15:56:59 +0000 (23:56 +0800)]
Rollup merge of #57314 - wiktorkuchta:master, r=Centril

Fix repeated word typos

Inspired by #57295 (I skipped 'be be' because of it) and my [PR in another repo
](https://github.com/e-maxx-eng/e-maxx-eng/pull/389)
Not a stupid `sed`, I actually tried to fix case by case.

5 years agoRollup merge of #57313 - Nemo157:box-to-pin, r=cramertj
kennytm [Sat, 5 Jan 2019 15:56:58 +0000 (23:56 +0800)]
Rollup merge of #57313 - Nemo157:box-to-pin, r=cramertj

Improve Box<T> -> Pin<Box<T>> conversion

I found the `From` trait conversion for this very hard to find, having a named function for it is much more discoverable. Also fixes #56256 as I need that in the place I'm using this.

Has a placeholder tracking issue, will file an issue once I get feedback.

5 years agoRollup merge of #57312 - Mendess2526:master, r=Centril
kennytm [Sat, 5 Jan 2019 15:56:56 +0000 (23:56 +0800)]
Rollup merge of #57312 - Mendess2526:master, r=Centril

`const fn` is no longer coming soon (const keyword docs)

The `const` keyword [documentation](https://doc.rust-lang.org/std/keyword.const.html) mentions that `const fn`s are coming soon, but they have already been added.

5 years agoRollup merge of #57311 - dlrobertson:fix_valist_copy, r=KodrAus
kennytm [Sat, 5 Jan 2019 15:56:55 +0000 (23:56 +0800)]
Rollup merge of #57311 - dlrobertson:fix_valist_copy, r=KodrAus

VaList::copy should not require a mutable ref

`VaList::copy` does not need to take a mutable reference. The `va_copy`
intrinsic takes a immutable reference.

5 years agoRollup merge of #57295 - d-e-s-o:topic/be-be, r=zackmdavis
kennytm [Sat, 5 Jan 2019 15:56:53 +0000 (23:56 +0800)]
Rollup merge of #57295 - d-e-s-o:topic/be-be, r=zackmdavis

Fix 'be be' constructs

I noticed a duplicated "be" somewhere in the code. A search for it
manifested a couple more locations with the same problem. This change
removes one of the "be"s.

5 years agoRollup merge of #57278 - mati865:config_clippy, r=alexcrichton
kennytm [Sat, 5 Jan 2019 15:56:52 +0000 (23:56 +0800)]
Rollup merge of #57278 - mati865:config_clippy, r=alexcrichton

Add Clippy to config.toml.example

Omitted in https://github.com/rust-lang/rust/pull/51122

The order is based on https://github.com/rust-lang/rust/blob/ec194646fef1a467073ad74b8b68f6f202cfce97/src/bootstrap/install.rs#L212

5 years agoRollup merge of #57273 - alexcrichton:update-stdsimd, r=nikomatsakis
kennytm [Sat, 5 Jan 2019 15:56:51 +0000 (23:56 +0800)]
Rollup merge of #57273 - alexcrichton:update-stdsimd, r=nikomatsakis

Update the stdsimd submodule

Add a new cmpxchg16b intrinsics for x86_64 and some corrections for ARM/AArch64

5 years agoRollup merge of #57267 - rust-lang:SimonSapin-patch-1, r=varkor
kennytm [Sat, 5 Jan 2019 15:56:49 +0000 (23:56 +0800)]
Rollup merge of #57267 - rust-lang:SimonSapin-patch-1, r=varkor

src/jemalloc is gone, remove its mention from COPYRIGHT

The `src/jemalloc` submodule was removed in 61e89446ef6e115630faa75c985c599d739f7586 / https://github.com/rust-lang/rust/pull/55238.

5 years agoRollup merge of #57249 - frewsxcv:frewsxcv-second-edition, r=KodrAus
kennytm [Sat, 5 Jan 2019 15:56:48 +0000 (23:56 +0800)]
Rollup merge of #57249 - frewsxcv:frewsxcv-second-edition, r=KodrAus

Fix broken links to second edition TRPL.

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

Remove `second-edition/` from TRPL hyperlinks.

5 years agoRollup merge of #57238 - Zoxc:bt-fix, r=alexcrichton
kennytm [Sat, 5 Jan 2019 15:56:47 +0000 (23:56 +0800)]
Rollup merge of #57238 - Zoxc:bt-fix, r=alexcrichton

Fix backtraces for inlined functions on Windows

Fixes an regression introduced in https://github.com/rust-lang/rust/pull/50526

r? @alexcrichton

5 years agoRollup merge of #57233 - Smibu:rename-and-fix-nolink-test, r=alexcrichton
kennytm [Sat, 5 Jan 2019 15:56:46 +0000 (23:56 +0800)]
Rollup merge of #57233 - Smibu:rename-and-fix-nolink-test, r=alexcrichton

Rename and fix nolink-with-link-args test

There are three problems with the nolink-with-link-args test:

* The test fails when using MSVC. It's caused by the `linker-flavor=ld` flag which was added in #46291.
* In its comment, this test tests that "link_args are indeed passed when nolink is specified", but the `nolink` attribute has been removed [a long time ago](https://github.com/rust-lang/rust/pull/12826).
* Pattern has a small typo.

At first I was going to completely remove this test, but there is [a closed pull request for that](https://github.com/rust-lang/rust/pull/21090).

So:

* rename the file as suggested in the closed PR
* adjust the comment
* fix typo in the pattern
* add `ignore-msvc`.

r? @alexcrichton

5 years agoRollup merge of #57229 - mikeyhew:fix-56806, r=varkor
kennytm [Sat, 5 Jan 2019 15:56:44 +0000 (23:56 +0800)]
Rollup merge of #57229 - mikeyhew:fix-56806, r=varkor

Fix #56806 by using `delay_span_bug` in object safety layout sanity checks

It's possible that `is_object_safe` is called on a trait method that with an invalid receiver type. This caused an ICE in #56806, because `receiver_is_dispatchable` returns `true` for `self: Box<dyn Trait>`, which causes one of the layout sanity checks in object_safety.rs to fail. Replacing `bug!` with `delay_span_bug` solves this.

The fact that `receiver_is_dispatchable` returns `true` here could be considered a bug. It passes the check that the method implements, though: `Box<dyn Trait>` implements `DispatchFromDyn<Box<dyn Trait>>` because `dyn Trait` implements `Unsize<dyn Trait>`. It would be good to hear what @eddyb and @nikomatsakis think.

Note that I only added a test for the case encountered in #56806. I could not come up with a case that triggered an ICE from the other check, `bug!("receiver when Self = dyn Trait should be ScalarPair, found Scalar")`. There is no way, to my knowledge, that you can make `receiver_is_dispatchable` return true but still have a `Scalar` ABI when `Self = dyn Trait`.

One other case I encountered while debugging #56806 was that if you have a type parameter `T` that implements `Deref<Target=Self>` and `DispatchFromDyn<T>`, and use it as a method receiver, it will cause an ICE during `is_object_safe` because `T` has no layout ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=d9b7497b3be0ca8382fa7d9497263214)):

```rust
trait Trait<T: Deref<Target=Self> + DispatchFromDyn<T>> {
    fn foo(self: T) -> dyn Trait<T>;
}
```

I don't intend to remove the ICE there because it is a pathological case, especially since there is no way to implement `DispatchFromDyn<T>` for `T` — the checks in typeck/coherence/builtin.rs do not allow that.

fixes #56806
r? @varkor

5 years agoRollup merge of #57219 - matthewjasper:mir-cleanup, r=nikomatsakis
kennytm [Sat, 5 Jan 2019 15:56:43 +0000 (23:56 +0800)]
Rollup merge of #57219 - matthewjasper:mir-cleanup, r=nikomatsakis

Remove some unused code

Closes #57096

5 years agoAuto merge of #57145 - RalfJung:panic-if-uninhabited, r=alexcrichton
bors [Sat, 5 Jan 2019 14:58:57 +0000 (14:58 +0000)]
Auto merge of #57145 - RalfJung:panic-if-uninhabited, r=alexcrichton

panic when calling MaybeUninhabited::into_inner on uninhabited type

I do this by adding an internal-only intrinsic `panic_if_uninhabited`. I have no idea what I am doing here, just mindlessly copying code around, so please review carefully!

5 years agoRemove `Region` from HAIR
Matthew Jasper [Sat, 5 Jan 2019 13:52:22 +0000 (13:52 +0000)]
Remove `Region` from HAIR

Use `ReErased` for any regions that need to be created in RValue::Ref
in MIR generation.

5 years agoAuto merge of #57101 - o01eg:fix-57014, r=alexcrichton
bors [Sat, 5 Jan 2019 12:21:44 +0000 (12:21 +0000)]
Auto merge of #57101 - o01eg:fix-57014, r=alexcrichton

Search codegen backends based on target libdir instead of sysroot

Fixes #57014

Fixes cases with custom libdir when it consists of two or more parts.

5 years agoAuto merge of #57099 - davidtwco:issue-57098, r=nikomatsakis
bors [Sat, 5 Jan 2019 09:41:04 +0000 (09:41 +0000)]
Auto merge of #57099 - davidtwco:issue-57098, r=nikomatsakis

NLL: Add closure cannot be moved note.

Fixes #57098.

This PR extends existing logic for checking whether a closure that
is `FnOnce` and therefore moves variables that it captures from the
environment has already been invoked when being invoked again.

Now, this logic will also check whether the closure is being moved after
previously being moved or invoked and add an appropriate note.

r? @pnkfelix

5 years agoAuto merge of #56837 - arielb1:nonprincipal-trait-objects, r=nikomatsakis
bors [Sat, 5 Jan 2019 03:36:31 +0000 (03:36 +0000)]
Auto merge of #56837 - arielb1:nonprincipal-trait-objects, r=nikomatsakis

Add support for trait-objects without a principal

The hard-error version of #56481 - should be merged after we do something about the `traitobject` crate.

Fixes #33140.
Fixes #57057.

r? @nikomatsakis

5 years agoAuto merge of #56145 - weiznich:re_rebalance_coherence, r=nikomatsakis
bors [Sat, 5 Jan 2019 00:49:12 +0000 (00:49 +0000)]
Auto merge of #56145 - weiznich:re_rebalance_coherence, r=nikomatsakis

Implement the Re-rebalance coherence RFC

This is the first time I touch anything in the compiler so just tell me if I got something wrong.

Big thanks to @sgrif for the pointers where to look for those things.
cc #55437

5 years agouse `delay_span_bug` instead of `bug!` when doing layout sanity check
Michael Hewson [Wed, 19 Dec 2018 23:27:58 +0000 (18:27 -0500)]
use `delay_span_bug` instead of `bug!` when doing layout sanity check

It's possible that `is_object_safe` is called on a trait that is ill-formed, and we shouldn't ICE unless there are no errors being raised. Using `delay_span_bug` solves this.

fixes #56806

5 years agoAuto merge of #56079 - mark-i-m:patch-1, r=nikomatsakis
bors [Fri, 4 Jan 2019 22:14:13 +0000 (22:14 +0000)]
Auto merge of #56079 - mark-i-m:patch-1, r=nikomatsakis

Link to rustc guide

As proposed in https://github.com/rust-lang-nursery/rustc-guide/issues/239

5 years agoadd test for #57162
Ariel Ben-Yehuda [Fri, 4 Jan 2019 19:53:00 +0000 (21:53 +0200)]
add test for #57162

Fixes #57162.

5 years agoadd some debug logging to collect
Ariel Ben-Yehuda [Fri, 4 Jan 2019 13:27:55 +0000 (15:27 +0200)]
add some debug logging to collect