]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #57860 - jethrogb:jb/sgx-os-ffi, r=joshtriplett
Mazdak Farrokhzad [Thu, 24 Jan 2019 17:25:47 +0000 (18:25 +0100)]
Rollup merge of #57860 - jethrogb:jb/sgx-os-ffi, r=joshtriplett

Add os::fortanix_sgx::ffi module

This uses the same byte slice accessors that Unix has. The [ABI specifies](https://docs.rs/fortanix-sgx-abi/0.3.2/fortanix_sgx_abi/struct.ByteBuffer.html) byte slices.

5 years agoRollup merge of #57846 - QuietMisdreavus:proc-macro-links, r=GuillaumeGomez
Mazdak Farrokhzad [Thu, 24 Jan 2019 17:25:45 +0000 (18:25 +0100)]
Rollup merge of #57846 - QuietMisdreavus:proc-macro-links, r=GuillaumeGomez

rustdoc: fix ICE from loading proc-macro stubs

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

When trying to resolve a macro, rustdoc first tries to load it from the resolver to see whether it's a Macros 2.0 macro, so it can return that Def before looking for any other kind of macro. However, this becomes a problem when you try to load proc-macros: since you can't use a proc-macro inside its own crate, this lookup also fails when attempting to link to it.

However, we have a hint that this lookup will fail: Macros which are actually `ProcMacroStub`s will fail the lookup, so we can use that information to skip loading the macro. Rustdoc will then happily check `resolve.all_macros`, which will return a usable Def that we can link to.

5 years agoRollup merge of #57803 - jethrogb:jb/sgx-unwind-version, r=alexcrichton
Mazdak Farrokhzad [Thu, 24 Jan 2019 17:25:44 +0000 (18:25 +0100)]
Rollup merge of #57803 - jethrogb:jb/sgx-unwind-version, r=alexcrichton

Several changes to libunwind for SGX target

Two fixes:
* #34978 bites again!
* __rust_alloc are actually private symbols. Add new public versions. Also, these ones are `extern "C"`.

Upstream changes (https://github.com/fortanix/llvm-project/pull/2, https://github.com/fortanix/llvm-project/pull/3):
b7357de Avoid too new relocation types being emitted
0feefe5 Use new symbol names to call Rust allocator

Fixes https://github.com/fortanix/rust-sgx/issues/65

5 years agoRollup merge of #57606 - oli-obk:shrink, r=RalfJung
Mazdak Farrokhzad [Thu, 24 Jan 2019 17:25:43 +0000 (18:25 +0100)]
Rollup merge of #57606 - oli-obk:shrink, r=RalfJung

Get rid of the fake stack frame for reading from constants

r? @RalfJung

fixes the ice in https://github.com/rust-lang/rust/issues/53708 but still keeps around the wrong "non-exhaustive match" error

cc @varkor

5 years agoRollup merge of #57380 - bearcage:master, r=alexcrichton
Mazdak Farrokhzad [Thu, 24 Jan 2019 17:25:41 +0000 (18:25 +0100)]
Rollup merge of #57380 - bearcage:master, r=alexcrichton

Fix Instant/Duration math precision & associativity on Windows

**tl;dr** Addition and subtraction on Duration/Instant are not associative on windows because we use the perfcounter frequency in every calculation instead of just when we measure time.

This is my first contrib (PR or Issue) to Rust, so please lmk if I've done this wrong. I followed CONTRIBUTING to the extent I could given my system doesn't seem to be able to build the compiler with changes in the source tree. I also asked about this issue in #rust-beginners a week or so ago, before digging through libstd -- I'm unsure if there's a good way to follow up on that, but I'd be happy to update the docs on the timing structs if this fixes the problem.

## Issue

The `Duration` type keeps seconds in the upper-64 and nanoseconds in the lower-32 bits. In theory doing math on these ought to be basically the same as doing math on any other 64 or 32 bit integral number.

On windows (and I think macos too), however, our math gets messy because the Instant type stores the current point in time in units of HPET Performance Counter counts, not nanoseconds, and does unit conversions on every math operation, rather than just when we measure the time from the system clock.

I tried this code:

```
use std::time::{Duration, Instant};

fn main() {
    let now = Instant::now();
    let offset = Duration::from_millis(5);
    assert_eq!((now + offset) - now, (now - now) + offset);
}
```

On UNIX machines (linux and macos) it behaves as you'd expect -- [no crash](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=cf2206c0b7e07d8ecc7767a512364094).

On Windows hosts, however, it blows up because of a precision problem in the Instant +/- Duration math:

```
C:\Users\aberg\work\timetest (master -> origin)
λ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
     Running `target\debug\timetest.exe`
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `4.999914ms`,
 right: `5ms`', src\main.rs:6:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: process didn't exit successfully: `target\debug\timetest.exe` (exit code: 101)

C:\Users\aberg\work\timetest (master -> origin)
λ cat src\main.rs
use std::time::{Duration, Instant};

fn main() {
    let now = Instant::now();
    let offset = Duration::from_millis(5);
    assert_eq!((now + offset) - now, (now - now) + offset);
}
```

On windows I think this is a consequence of doing the HPET-PerfCounter-Unit conversion on each math operation. I suspect the reason it works on macs is that (from what I could find online) most apple machines report timing in nanoseconds anyway. For anyone interested, the equivalent functions on macos, with a little work to fish out the numerator/denominator from a timebase struct:

* `QueryPerformanceCounter()` -> `mach_absolute_time()`
* `QueryPerformanceFrequency()` -> `mach_timebase_info()`

If this PR ends up working as I expect it to when CI runs the tests, I can make the same changes to the macos implementation.

## Potential Fix

We ought to be able to sort this out by storing nanoseconds, rather than PerfCounter units, that way intermediate math is done in the most precise units we support and we're only doing unit conversions when we actually measure the system clock (and it might even translate to a small perf gain for people doing tons of Instant/Duration math).

I believe this will address the underlying cause of #56034, and make the guessed epsilon constant from #56059 unnecessary. If it's of interest, I can write up how these timing types work on the tier 1 platforms to address #32626 as well, since I'm already in here figuring it out.

## This Patch

To that end, I've got this patch, which I think should fix it on windows, but I'm having trouble testing it -- any time I change anything in libstd I start getting this error, which no amount of clean building seems to resolve:

```
C:\Users\aberg\work\rust (master -> origin)
λ python x.py test --stage 0 --no-doc src/libstd
Updating only changed submodules
Submodules updated in 0.27 seconds
    Finished dev [unoptimized] target(s) in 2.41s
Building stage0 std artifacts (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc)
    Finished release [optimized] target(s) in 6.78s
Copying stage0 std from stage0 (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc / x86_64-pc-windows-msvc)
Building stage0 test artifacts (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc)
   Compiling test v0.0.0 (C:\Users\aberg\work\rust\src\libtest)
error[E0460]: found possibly newer version of crate `std` which `getopts` depends on
  --> src\libtest\lib.rs:36:1
   |
36 | extern crate getopts;
   | ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: perhaps that crate needs to be recompiled?
   = note: the following crate versions were found:
           crate `std`: \\?\C:\Users\aberg\work\rust\build\x86_64-pc-windows-msvc\stage0-sysroot\lib\rustlib\x86_64-pc-windows-msvc\lib\libstd-d7a80ca2ae113c97.rlib
           crate `std`: \\?\C:\Users\aberg\work\rust\build\x86_64-pc-windows-msvc\stage0-sysroot\lib\rustlib\x86_64-pc-windows-msvc\lib\std-d7a80ca2ae113c97.dll
           crate `getopts`: \\?\C:\Users\aberg\work\rust\build\x86_64-pc-windows-msvc\stage0-test\x86_64-pc-windows-msvc\release\deps\libgetopts-ae40a96de5f5d144.rlib

error: aborting due to previous error

For more information about this error, try `rustc --explain E0460`.
error: Could not compile `test`.

To learn more, run the command again with --verbose.
command did not execute successfully: "C:\\Users\\aberg\\work\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "build" "--target" "x86_64-pc-windows-msvc" "-j" "12" "--release" "--manifest-path" "C:\\Users\\aberg\\work\\rust\\src/libtest/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101
failed to run: C:\Users\aberg\work\rust\build\bootstrap\debug\bootstrap test --stage 0 --no-doc src/libstd
Build completed unsuccessfully in 0:00:20
```

---

Since you wrote the linked PRs and might remember looking at related problems:

r? @alexcrichton

5 years agoAuto merge of #57269 - gnzlbg:simd_bitmask, r=rkruppe
bors [Thu, 24 Jan 2019 13:11:06 +0000 (13:11 +0000)]
Auto merge of #57269 - gnzlbg:simd_bitmask, r=rkruppe

Add intrinsic to create an integer bitmask from a vector mask

This PR adds a new simd intrinsic: `simd_bitmask(vector) -> unsigned integer` that creates an integer bitmask from a vector mask by extracting one bit of each vector lane.

This is required to implement: https://github.com/rust-lang-nursery/packed_simd/issues/166 .

EDIT: the reason we need an intrinsics for this is that we have to truncate the vector lanes to an `<i1 x N>` vector, and then bitcast that to an `iN` integer (while making sure that we only materialize `i8`, ... , `i64` - that is, no `i1`, `i2`, `i4`, types), and we can't do any of that in a Rust library.

r? @rkruppe

5 years agoAuto merge of #57066 - Zoxc:graph-race, r=michaelwoerister
bors [Thu, 24 Jan 2019 10:20:12 +0000 (10:20 +0000)]
Auto merge of #57066 - Zoxc:graph-race, r=michaelwoerister

Fix race condition when emitting stored diagnostics

r? @michaelwoerister

5 years agoAdd a comment on the meaning of Instant t: Duration
Alex Berghage [Thu, 24 Jan 2019 04:36:38 +0000 (21:36 -0700)]
Add a comment on the meaning of Instant t: Duration

5 years agoAuto merge of #57869 - Centril:rollup, r=Centril
bors [Thu, 24 Jan 2019 01:24:13 +0000 (01:24 +0000)]
Auto merge of #57869 - Centril:rollup, r=Centril

Rollup of 11 pull requests

Successful merges:

 - #57179 (Update std/lib.rs docs to reflect Rust 2018 usage)
 - #57730 (Merge visitors in AST validation)
 - #57779 (Recover from parse errors in literal struct fields and incorrect float literals)
 - #57793 (Explain type mismatch cause pointing to return type when it is `impl Trait`)
 - #57795 (Use structured suggestion in stead of notes)
 - #57817 (Add error for trailing angle brackets.)
 - #57834 (Stabilize Any::get_type_id and rename to type_id)
 - #57836 (Fix some cross crate existential type ICEs)
 - #57840 (Fix issue 57762)
 - #57844 (use port 80 for retrieving GPG key)
 - #57858 (Ignore line ending on older git versions)

Failed merges:

r? @ghost

5 years agoRollup merge of #57858 - pietroalbini:ignore-eol-images, r=GuillaumeGomez
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:20:03 +0000 (00:20 +0100)]
Rollup merge of #57858 - pietroalbini:ignore-eol-images, r=GuillaumeGomez

Ignore line ending on older git versions

On Ubuntu 16.04 git 2.7.4 tries to fix the line ending of `.png` and `.ico` files, and obviously it ruins them. This PR adds an attribute to those files to ignore which line ending they use.

r? @GuillaumeGomez

5 years agoRollup merge of #57844 - euclio:keyserver-port, r=alexcrichton
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:20:02 +0000 (00:20 +0100)]
Rollup merge of #57844 - euclio:keyserver-port, r=alexcrichton

use port 80 for retrieving GPG key

This works around firewalls blocking port 11371.

See https://unix.stackexchange.com/questions/75892/keyserver-timed-out-when-trying-to-add-a-gpg-public-key.

5 years agoRollup merge of #57840 - tromey:fix-issue-57762, r=nikic
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:20:00 +0000 (00:20 +0100)]
Rollup merge of #57840 - tromey:fix-issue-57762, r=nikic

Fix issue 57762

against a stock LLVM 7.  LLVM 7 was released without a necessary fix
for a bug in the DWARF discriminant code.

This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7.

Closes #57762

5 years agoRollup merge of #57836 - oli-obk:existential_crisis, r=estebank
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:59 +0000 (00:19 +0100)]
Rollup merge of #57836 - oli-obk:existential_crisis, r=estebank

Fix some cross crate existential type ICEs

fixes #53443

5 years agoRollup merge of #57834 - SimonSapin:type_id, r=Centril
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:58 +0000 (00:19 +0100)]
Rollup merge of #57834 - SimonSapin:type_id, r=Centril

Stabilize Any::get_type_id and rename to type_id

FCP: https://github.com/rust-lang/rust/issues/27745#issuecomment-373906749

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

5 years agoRollup merge of #57817 - davidtwco:issue-54521, r=estebank
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:57 +0000 (00:19 +0100)]
Rollup merge of #57817 - davidtwco:issue-54521, r=estebank

Add error for trailing angle brackets.

Fixes #54521.

This PR adds a error (and accompanying machine applicable
suggestion) for trailing angle brackets on function calls with a
turbofish.

r? @estebank

5 years agoRollup merge of #57795 - estebank:did-you-mean, r=zackmdavis
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:55 +0000 (00:19 +0100)]
Rollup merge of #57795 - estebank:did-you-mean, r=zackmdavis

Use structured suggestion in stead of notes

5 years agoRollup merge of #57793 - estebank:impl-trait-resolve, r=oli-obk
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:54 +0000 (00:19 +0100)]
Rollup merge of #57793 - estebank:impl-trait-resolve, r=oli-obk

Explain type mismatch cause pointing to return type when it is `impl Trait`

Fix #57743.

5 years agoRollup merge of #57779 - estebank:recover-struct-fields, r=davidtwco
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:53 +0000 (00:19 +0100)]
Rollup merge of #57779 - estebank:recover-struct-fields, r=davidtwco

Recover from parse errors in literal struct fields and incorrect float literals

Fix #52496.

5 years agoRollup merge of #57730 - Zoxc:combined-ast-validator, r=cramertj
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:52 +0000 (00:19 +0100)]
Rollup merge of #57730 - Zoxc:combined-ast-validator, r=cramertj

Merge visitors in AST validation

Cuts runtime for AST validation on `syntex_syntax` from 31.5 ms to 17 ms.

5 years agoRollup merge of #57179 - Xaeroxe:patch-1, r=QuietMisdreavus
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:50 +0000 (00:19 +0100)]
Rollup merge of #57179 - Xaeroxe:patch-1, r=QuietMisdreavus

Update std/lib.rs docs to reflect Rust 2018 usage

Fixes #56544

This paragraph was written for Rust 2015.  Since 2018 has been stable for a while I think we can update it.

5 years agoAuto merge of #57857 - pietroalbini:fix-android-ci, r=aidanhs
bors [Wed, 23 Jan 2019 15:53:23 +0000 (15:53 +0000)]
Auto merge of #57857 - pietroalbini:fix-android-ci, r=aidanhs

Fix Android CI failing to download SDKs

A component of the Android SDK now requires an additional license ([full license text](https://gist.github.com/pietroalbini/28b46a6fed0921d129de58e7aef29f11)) to be accepted before it's possible to use it. The license is dated January 16th 2019, so it's recent.

The weird thing about the license is that it doesn't prompt you to accept it during `sdkmanager --licenses` like all the other ones, but during `sdkmanager platform-tools emulator ...`, and we didn't pipe `yes` to it before this PR.

The PR changes the SDK installation script to accept all the licenses even on the `sdkmanager platform-tools emulator` command.

5 years agoFix race condition when emitting stored diagnostics
John Kåre Alsaker [Sat, 22 Dec 2018 17:59:03 +0000 (18:59 +0100)]
Fix race condition when emitting stored diagnostics

5 years agoAdd os::fortanix_sgx::ffi module
Jethro Beekman [Wed, 23 Jan 2019 13:10:40 +0000 (18:40 +0530)]
Add os::fortanix_sgx::ffi module

5 years agoignore images line ending on older git versions
Pietro Albini [Wed, 23 Jan 2019 10:54:23 +0000 (11:54 +0100)]
ignore images line ending on older git versions

On Ubuntu 16.04 git 2.7.4 tries to fix the line ending of .png and .ico
files, and obviously it ruins them. This commit adds an attribute to
those files to properly mark them as binary.

5 years agoRemove unused feature gates
Oliver Scherer [Wed, 23 Jan 2019 10:34:58 +0000 (11:34 +0100)]
Remove unused feature gates

5 years agoFollow naming scheme for "frame" methods
Oliver Scherer [Wed, 23 Jan 2019 10:34:02 +0000 (11:34 +0100)]
Follow naming scheme for "frame" methods

5 years agomake sure to accept all android licenses
Pietro Albini [Wed, 23 Jan 2019 10:21:24 +0000 (11:21 +0100)]
make sure to accept all android licenses

5 years agoRebase and fix new instantiation fn
Alex Berghage [Wed, 23 Jan 2019 02:31:55 +0000 (19:31 -0700)]
Rebase and fix new instantiation fn

5 years agoMove Instant backing type to Duration
Alex Berghage [Mon, 21 Jan 2019 01:05:09 +0000 (18:05 -0700)]
Move Instant backing type to Duration

Per review comments, this commit switches out the backing
type for Instant on windows to a Duration. Tests all pass,
and the code's a lot simpler (plus it should be portable now,
with the exception of the QueryPerformanceWhatever functions).

5 years agoSimplify units in Duration/Instant math on Windows
Alex Berghage [Sun, 6 Jan 2019 18:53:47 +0000 (11:53 -0700)]
Simplify units in Duration/Instant math on Windows

Right now we do unit conversions between PerfCounter measurements
and nanoseconds for every add/sub we do between Durations and Instants
on Windows machines. This leads to goofy behavior, like this snippet
failing:

```
let now = Instant::now();
let offset = Duration::from_millis(5);
assert_eq!((now + offset) - now, (now - now) + offset);
```

with precision problems like this:

```
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `4.999914ms`,
 right: `5ms`', src\main.rs:6:5
```

To fix it, this changeset does the unit conversion once, when we
measure the clock, and all the subsequent math in u64 nanoseconds.

It also adds an exact associativity test to the `sys/time.rs`
test suite to make sure we don't regress on this in the future.

5 years agoAuto merge of #57835 - pnkfelix:issue-57673-remove-leaky-nested-probe, r=arielb1
bors [Tue, 22 Jan 2019 23:02:38 +0000 (23:02 +0000)]
Auto merge of #57835 - pnkfelix:issue-57673-remove-leaky-nested-probe, r=arielb1

typeck: remove leaky nested probe during trait object method resolution

addresses #57673  (but not marking with f-x because thats now afflicting beta channel).

Fix #57216

5 years agoadd intra-doc link test to proc-macro test
QuietMisdreavus [Tue, 22 Jan 2019 21:44:19 +0000 (15:44 -0600)]
add intra-doc link test to proc-macro test

5 years agodon't call get_macro on proc-macro stubs
QuietMisdreavus [Tue, 22 Jan 2019 21:40:27 +0000 (15:40 -0600)]
don't call get_macro on proc-macro stubs

5 years agouse port 80 for retrieving GPG key
Andy Russell [Tue, 22 Jan 2019 21:15:02 +0000 (16:15 -0500)]
use port 80 for retrieving GPG key

This works around firewalls blocking port 11371.

See https://unix.stackexchange.com/questions/75892/keyserver-timed-out-when-trying-to-add-a-gpg-public-key.

5 years agoAuto merge of #57805 - matthiaskrgr:rls, r=Xanewok
bors [Tue, 22 Jan 2019 20:04:13 +0000 (20:04 +0000)]
Auto merge of #57805 - matthiaskrgr:rls, r=Xanewok

submodules: update rls and clippy

Changes:
````
Remove state.analysis due to Rust PR #57476
Improve missing nightly readme info
Bump languageserver-types to v0.54.0 and renam crate name to lsp-types
Delete bors.toml
Fix tests
Fix https://github.com/rust-lang/rls/issues/1231
Implement asynchronous message reading
Use typed requests
Implement Tokio-based test LSP client
Update README.md to account for Travis url change
Simplify wait_for_all recv calls
Update dependencies
Revert NLL bug workaround
Remove old test_data entry in .gitignore
Reorganize some tests
Don't test RLS binary target directly
Move tooltip tests to integration tests
Simplify tooltip test harness
Only use FIXTURES_DIR to determine fixtures
Remove src/test/mod.rs
Centralise FIXTURES_DIR across unit and integration tests
Move lens test to tests/
Suppress unused warnings in tests/*
Beautify main.rs and lib.rs
WIP: Move tests
Move src/test/harness to tests/support/harness
Split RLS into bin/lib
Update Clippy
Change all mentions of `rls-preview` to `rls`
Make config mutex borrow scope explicit
Fallback to racer definition
````

Fixes rls build.

5 years agoSimplify the version check
Tom Tromey [Tue, 22 Jan 2019 18:44:23 +0000 (11:44 -0700)]
Simplify the version check

Address the review comments by simplifying the version check to
just "< 8".

5 years agoFix issue 57762
Tom Tromey [Tue, 22 Jan 2019 18:13:53 +0000 (11:13 -0700)]
Fix issue 57762

Issue 57762 points out a compiler crash when the compiler was built
using a stock LLVM 7.  LLVM 7 was released without a necessary fix for
a bug in the DWARF discriminant code.

This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7.

Closes #57762

5 years agosubmodules: update clippy from 1838bfe5 to 280069dd
Matthias Krüger [Tue, 22 Jan 2019 17:03:40 +0000 (18:03 +0100)]
submodules: update clippy from 1838bfe5 to 280069dd

Changes:
````
Rustfmt all the things
Don't make decisions on values that don't represent the decision
Rustup
Actually check for constants.
formatting fix
Update clippy_lints/src/needless_bool.rs
formatting fix
needless bool lint suggestion is wrapped in brackets if it is an "else" clause of an "if-else" statement
Remove negative integer literal checks.
Fix `implicit_return` false positives.
````

5 years agosubmodules: update rls from ae0d89a to c9d25b6
Matthias Krüger [Mon, 21 Jan 2019 15:32:43 +0000 (16:32 +0100)]
submodules: update rls from ae0d89a to c9d25b6

Changes:
````
Remove state.analysis due to Rust PR #57476
Improve missing nightly readme info
Bump languageserver-types to v0.54.0 and renam crate name to lsp-types
Delete bors.toml
Fix tests
Fix https://github.com/rust-lang/rls/issues/1231
Implement asynchronous message reading
Use typed requests
Implement Tokio-based test LSP client
Update README.md to account for Travis url change
Simplify wait_for_all recv calls
Update dependencies
Revert NLL bug workaround
Remove old test_data entry in .gitignore
Reorganize some tests
Don't test RLS binary target directly
Move tooltip tests to integration tests
Simplify tooltip test harness
Only use FIXTURES_DIR to determine fixtures
Remove src/test/mod.rs
Centralise FIXTURES_DIR across unit and integration tests
Move lens test to tests/
Suppress unused warnings in tests/*
Beautify main.rs and lib.rs
WIP: Move tests
Move src/test/harness to tests/support/harness
Split RLS into bin/lib
Update Clippy
Change all mentions of `rls-preview` to `rls`
Make config mutex borrow scope explicit
Fallback to racer definition
````

Fixes rls build.

5 years agoRemove unused links
Jacob Kiesel [Tue, 22 Jan 2019 16:39:19 +0000 (09:39 -0700)]
Remove unused links

5 years agoAdd regression test
Oliver Scherer [Mon, 14 Jan 2019 18:51:00 +0000 (19:51 +0100)]
Add regression test

5 years agoSpan fixup
Oliver Scherer [Mon, 14 Jan 2019 18:50:49 +0000 (19:50 +0100)]
Span fixup

5 years agoBail out on overly generic substitutions
Oliver Scherer [Mon, 14 Jan 2019 16:54:35 +0000 (17:54 +0100)]
Bail out on overly generic substitutions

5 years agoGet rid of the fake stack frame
Oliver Scherer [Mon, 14 Jan 2019 16:54:00 +0000 (17:54 +0100)]
Get rid of the fake stack frame

5 years agoAuto merge of #57647 - cuviper:gdb-version, r=tromey
bors [Tue, 22 Jan 2019 16:14:42 +0000 (16:14 +0000)]
Auto merge of #57647 - cuviper:gdb-version, r=tromey

[rust-gdb] relax the GDB version regex

The pretty-printer script is checking `gdb.VERSION` to see if it's at
least 8.1 for some features. With `re.match`, it will only find the
version at the beginning of that string, but in Fedora the string is
something like "Fedora 8.2-5.fc29". Using `re.search` instead will find
the first location that matches anywhere, so it will find my 8.2.

5 years agoFix some cross crate existential type ICEs
Oliver Scherer [Tue, 22 Jan 2019 14:08:31 +0000 (15:08 +0100)]
Fix some cross crate existential type ICEs

5 years agounit test for issue 57673.
Felix S. Klock II [Tue, 22 Jan 2019 13:49:18 +0000 (14:49 +0100)]
unit test for issue 57673.

5 years agoDo not initiate nested probe within `assemble_probe`.
Felix S. Klock II [Tue, 22 Jan 2019 12:51:30 +0000 (13:51 +0100)]
Do not initiate nested probe within `assemble_probe`.

In particular, the table entries (associated with type-variables
created during the probe) must persist as long as the candidates
assembled during the probe. If you make a nested probe without
creating a nested `ProbeContext`, the table entries are popped at the
end of the nested probe, while the type-variables would leak out via
the assembled candidates attached to `self` (the outer
`ProbeContext`). This causes an ICE (*if you are lucky*)!

5 years agoAuto merge of #57830 - Centril:rollup, r=Centril
bors [Tue, 22 Jan 2019 13:40:01 +0000 (13:40 +0000)]
Auto merge of #57830 - Centril:rollup, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #57537 (Small perf improvement for fmt)
 - #57552 (Default images)
 - #57604 (Make `str` indexing generic on `SliceIndex`.)
 - #57667 (Fix memory leak in P::filter_map)
 - #57677 (const_eval: Predetermine the layout of all locals when pushing a stack frame)
 - #57791 (Add regression test for #54582)
 - #57798 (Corrected spelling inconsistency)
 - #57809 (Add powerpc64-unknown-freebsd)
 - #57813 (fix validation range printing when encountering undef)

Failed merges:

r? @ghost

5 years agoStabilize Any::get_type_id and rename to type_id
Simon Sapin [Tue, 22 Jan 2019 13:25:27 +0000 (14:25 +0100)]
Stabilize Any::get_type_id and rename to type_id

FCP: https://github.com/rust-lang/rust/issues/27745#issuecomment-373906749

5 years agoRollup merge of #57813 - RalfJung:validation-range-printing, r=oli-obk
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:36 +0000 (12:20 +0100)]
Rollup merge of #57813 - RalfJung:validation-range-printing, r=oli-obk

fix validation range printing when encountering undef

5 years agoRollup merge of #57809 - MikaelUrankar:powerpc64-unknown-freebsd, r=nagisa
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:34 +0000 (12:20 +0100)]
Rollup merge of #57809 - MikaelUrankar:powerpc64-unknown-freebsd, r=nagisa

Add powerpc64-unknown-freebsd

FreeBSD review: https://reviews.freebsd.org/D18367

5 years agoRollup merge of #57798 - hellow554:master, r=davidtwco
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:33 +0000 (12:20 +0100)]
Rollup merge of #57798 - hellow554:master, r=davidtwco

Corrected spelling inconsistency

resolves #57773

5 years agoRollup merge of #57791 - estebank:issue-54582, r=zackmdavis
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:32 +0000 (12:20 +0100)]
Rollup merge of #57791 - estebank:issue-54582, r=zackmdavis

Add regression test for #54582

Fix #54582.

5 years agoRollup merge of #57677 - dotdash:locals, r=michaelwoerister
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:31 +0000 (12:20 +0100)]
Rollup merge of #57677 - dotdash:locals, r=michaelwoerister

const_eval: Predetermine the layout of all locals when pushing a stack frame

Usually the layout of any locals is required at least three times, once
when it becomes live, once when it is written to, and once it is read
from. By adding a cache for them, we can reduce the number of layout
queries speeding up code that is heavy on const_eval.

5 years agoRollup merge of #57667 - ishitatsuyuki:p-leak, r=nnethercote
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:29 +0000 (12:20 +0100)]
Rollup merge of #57667 - ishitatsuyuki:p-leak, r=nnethercote

Fix memory leak in P::filter_map

Probably this function isn't widely used, but anyway this wasn't working as intended.

r? @eddyb

Do not rollup if you want to see if max-rss change in perf.

5 years agoRollup merge of #57604 - alercah:str-index, r=sfackler
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:28 +0000 (12:20 +0100)]
Rollup merge of #57604 - alercah:str-index, r=sfackler

Make `str` indexing generic on `SliceIndex`.

Fixes #55603

5 years agoRollup merge of #57552 - GuillaumeGomez:default-images, r=QuietMisdreavus
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:27 +0000 (12:20 +0100)]
Rollup merge of #57552 - GuillaumeGomez:default-images, r=QuietMisdreavus

Default images

Add default rust logo (the image at the top of the sidebar) and default favicon. No more missing image or inexistent icon on the documentation tabs!

r? @QuietMisdreavus

5 years agoRollup merge of #57537 - sinkuu:fmt_perf, r=alexcrichton
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:23 +0000 (12:20 +0100)]
Rollup merge of #57537 - sinkuu:fmt_perf, r=alexcrichton

Small perf improvement for fmt

Added benchmark is based on #10761

5 years agoAuto merge of #56221 - estebank:remove-dummy-checks, r=varkor
bors [Tue, 22 Jan 2019 10:59:09 +0000 (10:59 +0000)]
Auto merge of #56221 - estebank:remove-dummy-checks, r=varkor

Remove unnecessary dummy span checks

The emitter already verifies wether a given span note or span label
can be emitted to the output. If it can't, because it is a dummy
span, it will be either elided for labels or emitted as an unspanned
note/help when applicable.

5 years agoAdd intrinsic to create an integer bitmask from the MSB of integer vectors
gnzlbg [Wed, 2 Jan 2019 15:49:30 +0000 (16:49 +0100)]
Add intrinsic to create an integer bitmask from the MSB of integer vectors

5 years agoAuto merge of #57821 - RalfJung:miri, r=oli-obk
bors [Tue, 22 Jan 2019 08:24:58 +0000 (08:24 +0000)]
Auto merge of #57821 - RalfJung:miri, r=oli-obk

update miri

r? @oli-obk

5 years agoCorrected spelling inconsistency
Marcel Hellwig [Mon, 21 Jan 2019 07:09:56 +0000 (08:09 +0100)]
Corrected spelling inconsistency

resolves #57773

5 years agoAuto merge of #57475 - SimonSapin:signed, r=estebank
bors [Tue, 22 Jan 2019 05:42:11 +0000 (05:42 +0000)]
Auto merge of #57475 - SimonSapin:signed, r=estebank

Add signed num::NonZeroI* types

Multiple people have asked for them in https://github.com/rust-lang/rust/issues/49137. Given that the unsigned ones already exist, they are very easy to add and not an additional maintenance burden.

5 years agoFix typo
varkor [Mon, 21 Jan 2019 23:53:56 +0000 (15:53 -0800)]
Fix typo

Co-Authored-By: estebank <estebank@users.noreply.github.com>
5 years agoFix typo
varkor [Mon, 21 Jan 2019 23:53:45 +0000 (15:53 -0800)]
Fix typo

Co-Authored-By: estebank <estebank@users.noreply.github.com>
5 years agoAccept more invalid code that is close to correct fields
Esteban Küber [Mon, 21 Jan 2019 23:28:51 +0000 (15:28 -0800)]
Accept more invalid code that is close to correct fields

5 years agoExtend trailing `>` detection for paths.
David Wood [Mon, 21 Jan 2019 23:35:31 +0000 (00:35 +0100)]
Extend trailing `>` detection for paths.

This commit extends the trailing `>` detection to also work for paths
such as `Foo::<Bar>>:Baz`.

This involves making the existing check take the token that is expected
to follow the path being checked as a parameter.

Care is taken to ensure that this only happens on the construction of a
whole path segment and not a partial path segment (during recursion).

Through this enhancement, it was also observed that the ordering of
right shift token and greater than tokens was overfitted to the examples
being tested.

In practice, given a sequence of `>` characters: `>>>>>>>>>`
..then they will be split into `>>` eagerly: `>> >> >> >> >`.
..but when a `<` is prepended, then the first `>>` is split:
`<T> > >> >> >> >`
..and then when another `<` is prepended, a right shift is first again:
`Vec<<T>> >> >> >> >`

In the previous commits, a example that had two `<<` characters was
always used and therefore it was incorrectly assumed that `>>` would
always be first - but when there is a single `<`, this is not the case.

5 years agoMove logic to its own method
Esteban Küber [Mon, 21 Jan 2019 23:13:59 +0000 (15:13 -0800)]
Move logic to its own method

5 years agoAuto merge of #55009 - oli-obk:const_safety, r=RalfJung
bors [Mon, 21 Jan 2019 23:10:11 +0000 (23:10 +0000)]
Auto merge of #55009 - oli-obk:const_safety, r=RalfJung

Make raw ptr ops unsafe in const contexts

r? @RalfJung

cc @Centril

5 years agoPluralize error messages.
David Wood [Mon, 21 Jan 2019 20:16:46 +0000 (21:16 +0100)]
Pluralize error messages.

This commit pluralizes error messages when more than a single trailing
`>` character is present.

5 years agoAdd error for trailing angle brackets.
David Wood [Mon, 21 Jan 2019 18:42:06 +0000 (19:42 +0100)]
Add error for trailing angle brackets.

This commit adds a error (and accompanying machine applicable
suggestion) for trailing angle brackets on function calls with a
turbofish.

5 years agoupdate miri
Ralf Jung [Mon, 21 Jan 2019 21:25:02 +0000 (22:25 +0100)]
update miri

5 years agofix validation range printing when encountering undef
Ralf Jung [Mon, 21 Jan 2019 14:48:07 +0000 (14:48 +0000)]
fix validation range printing when encountering undef

5 years agoAdd powerpc64-unknown-freebsd
Your Name [Mon, 21 Jan 2019 17:50:54 +0000 (18:50 +0100)]
Add powerpc64-unknown-freebsd

5 years agoFix some non-determinism in help messages for E0277 errors.
Simon Sapin [Mon, 21 Jan 2019 15:55:32 +0000 (16:55 +0100)]
Fix some non-determinism in help messages for E0277 errors.

The diagnostic for this error prints `the following implementations
were found` followed by the first N relevant impls, sorted.

This commit makes the sort happen before slicing,
so that the set of impls being printed is deterministic
when the input is not.

5 years agoUpdate libunwind for SGX target
Jethro Beekman [Mon, 21 Jan 2019 13:20:36 +0000 (18:50 +0530)]
Update libunwind for SGX target

5 years agoExpose alloc/dealloc properly for SGX libunwind
Jethro Beekman [Mon, 21 Jan 2019 15:32:48 +0000 (21:02 +0530)]
Expose alloc/dealloc properly for SGX libunwind

5 years agoDeclare some unconst operations as unsafe in const fn
Oliver Scherer [Fri, 7 Dec 2018 17:26:46 +0000 (18:26 +0100)]
Declare some unconst operations as unsafe in const fn

5 years agoAuto merge of #55045 - kleimkuhler:add-std-is_sorted, r=KodrAus
bors [Mon, 21 Jan 2019 13:55:45 +0000 (13:55 +0000)]
Auto merge of #55045 - kleimkuhler:add-std-is_sorted, r=KodrAus

Add `is_sorted` to `Iterator` and `[T]`

This is an initial implementation for the first step of [RFC 2351](https://github.com/rust-lang/rfcs/blob/master/text/2351-is-sorted.md)

Tracking issue: https://github.com/rust-lang/rust/issues/53485

5 years agoAuto merge of #57756 - matthiaskrgr:clippy_submodule_upd, r=oli-obk
bors [Mon, 21 Jan 2019 11:07:29 +0000 (11:07 +0000)]
Auto merge of #57756 - matthiaskrgr:clippy_submodule_upd, r=oli-obk

submodules: update clippy from 1b89724b to e648adf0

Fixes clippy toolstate

Changes:
````
Catch up with `format_args` change
Fix bad `while_let_on_iterator` suggestion.
rustup https://github.com/rust-lang/rust/pull/57747
Fixing issues pointed out by dogfood tests.
Update to collect all the files then throw the error.
Adding a test for checking if test files are missing.
Remove bors.toml
add applicability to lint name suggestion
````

r? @oli-obk

5 years agoDifferentiate between closure and function bodies
Oliver Scherer [Fri, 7 Dec 2018 17:25:55 +0000 (18:25 +0100)]
Differentiate between closure and function bodies

5 years agoAuto merge of #57792 - Centril:rollup, r=Centril
bors [Mon, 21 Jan 2019 08:32:19 +0000 (08:32 +0000)]
Auto merge of #57792 - Centril:rollup, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #56796 (Change bounds on `TryFrom` blanket impl to use `Into` instead of `From`)
 - #57768 (Continue parsing after parent type args and suggest using angle brackets)
 - #57769 (Suggest correct cast for struct fields with shorthand syntax)
 - #57783 (Add "dereference boxed value" suggestion.)
 - #57784 (Add span for bad doc comment)

Failed merges:

r? @ghost

5 years agoUse structured suggestion in stead of notes
Esteban Küber [Mon, 21 Jan 2019 03:37:38 +0000 (19:37 -0800)]
Use structured suggestion in stead of notes

5 years agoAuto merge of #57708 - nbigaouette:pr-53774-fix-missing-rust-gdbui-install, r=Mark...
bors [Mon, 21 Jan 2019 03:12:26 +0000 (03:12 +0000)]
Auto merge of #57708 - nbigaouette:pr-53774-fix-missing-rust-gdbui-install, r=Mark-Simulacrum

Install missing 'rust-gdbui''

PR #53774 added `rust-gdbui` as wrapper to launch [gdbui](https://gdbgui.com/), similar to `rust-gdb`.

Unfortunately I've never seen the script in my local installation (from rustup, using rust 1.31.1). @tromey on the PR [suggested it might be missing](https://github.com/rust-lang/rust/pull/53774#issuecomment-419704939) from the installation process.

This PR simply adds a line for `rust-gdbui` too.

5 years agoExplain type mismatch cause pointing to return type when it is `impl Trait`
Esteban Küber [Mon, 21 Jan 2019 02:42:10 +0000 (18:42 -0800)]
Explain type mismatch cause pointing to return type when it is `impl Trait`

5 years agosubmodules: update clippy from 1b89724b to 1838bfe5
Matthias Krüger [Mon, 21 Jan 2019 01:58:57 +0000 (02:58 +0100)]
submodules: update clippy from 1b89724b to 1838bfe5

Changes:
````
Fixing typo in CONTRIBUTING.md
Fix breakage due to rust-lang/rust#57651
Run rustfmt
Fixed breakage due to rust-lang/rust#57489
Fix breakage due to rust-lang/rust#57755
Catch up with `format_args` change
Fix bad `while_let_on_iterator` suggestion.
rustup https://github.com/rust-lang/rust/pull/57747
Fixing issues pointed out by dogfood tests.
Update to collect all the files then throw the error.
Adding a test for checking if test files are missing.
Remove bors.toml
add applicability to lint name suggestion
````

5 years agoRollup merge of #57784 - JohnTitor:improve-error-message, r=estebank
Mazdak Farrokhzad [Mon, 21 Jan 2019 01:21:58 +0000 (02:21 +0100)]
Rollup merge of #57784 - JohnTitor:improve-error-message, r=estebank

Add span for bad doc comment

Fixes #57382

r? @estebank

5 years agoRollup merge of #57783 - davidtwco:issue-57741, r=estebank
Mazdak Farrokhzad [Mon, 21 Jan 2019 01:21:57 +0000 (02:21 +0100)]
Rollup merge of #57783 - davidtwco:issue-57741, r=estebank

Add "dereference boxed value" suggestion.

Contributes to #57741.

This PR adds a `help: consider dereferencing the boxed value` suggestion to discriminants of match statements when the match arms have type `T` and the discriminant has type `Box<T>`.

r? @estebank

5 years agoRollup merge of #57769 - estebank:cast-suggestion-struct-field, r=matthewjasper
Mazdak Farrokhzad [Mon, 21 Jan 2019 01:21:56 +0000 (02:21 +0100)]
Rollup merge of #57769 - estebank:cast-suggestion-struct-field, r=matthewjasper

Suggest correct cast for struct fields with shorthand syntax

```
error[E0308]: mismatched types
  --> $DIR/type-mismatch-struct-field-shorthand.rs:8:19
   |
LL |     let _ = RGB { r, g, b };
   |                   ^ expected f64, found f32
help: you can cast an `f32` to `f64` in a lossless way
   |
LL |     let _ = RGB { r: r.into(), g, b };
   |                   ^^^^^^^^^^^
```

Fix #52497.

5 years agoRollup merge of #57768 - estebank:type-args-sugg, r=zackmdavis
Mazdak Farrokhzad [Mon, 21 Jan 2019 01:21:55 +0000 (02:21 +0100)]
Rollup merge of #57768 - estebank:type-args-sugg, r=zackmdavis

Continue parsing after parent type args and suggest using angle brackets

```
error[E0214]: parenthesized parameters may only be used with a trait
--> $DIR/E0214.rs:2:15
   |
LL |     let v: Vec(&str) = vec!["foo"];
   |               ^^^^^^
   |               |
   |               only traits may use parentheses
   |               help: use angle brackets instead: `<&str>`
```

r? @zackmdavis

5 years agoRollup merge of #56796 - KrishnaSannasi:try_from_impl_change, r=shepmaster
Mazdak Farrokhzad [Mon, 21 Jan 2019 01:21:53 +0000 (02:21 +0100)]
Rollup merge of #56796 - KrishnaSannasi:try_from_impl_change, r=shepmaster

Change bounds on `TryFrom` blanket impl to use `Into` instead of `From`

This is from this [comment](https://github.com/rust-lang/rust/issues/33417#issuecomment-447111156) I made.

This will expand the impls available for `TryFrom` and `TryInto`, without losing anything in the process.

5 years agoAdd regression test for #54582
Esteban Küber [Mon, 21 Jan 2019 01:14:15 +0000 (17:14 -0800)]
Add regression test for #54582

5 years agoAuto merge of #57789 - ehuss:update-cargo, r=Mark-Simulacrum
bors [Mon, 21 Jan 2019 00:29:31 +0000 (00:29 +0000)]
Auto merge of #57789 - ehuss:update-cargo, r=Mark-Simulacrum

Update cargo

Pull in fix for #57774.

6 commits in ffe65875fd05018599ad07e7389e99050c7915be..907c0febe7045fa02dff2a35c5e36d3bd59ea50d
2019-01-17 23:57:50 +0000 to 2019-01-20 22:31:07 +0000
- Put mtime-on-use behind a feature flag. (rust-lang/cargo#6573)
- Fix a typo in the unstable docs (rust-lang/cargo#6569)
- Perhaps you meant: foo, bar or foobar (rust-lang/cargo#6550)
- Refactor: Create uninstall submodule (rust-lang/cargo#6557)
- Fix spurious Windows errors with switch_features_rerun. (rust-lang/cargo#6561)
- Stop building on master on Travis. (rust-lang/cargo#6562)

r? @Mark-Simulacrum

5 years agoUpdate cargo
Eric Huss [Sun, 20 Jan 2019 23:31:43 +0000 (15:31 -0800)]
Update cargo

5 years agoTweak field parse error recovery
Esteban Küber [Sun, 20 Jan 2019 23:16:36 +0000 (15:16 -0800)]
Tweak field parse error recovery

5 years agoExtend incorrect float literal recovery to account for suffixes
Esteban Küber [Sun, 20 Jan 2019 22:25:53 +0000 (14:25 -0800)]
Extend incorrect float literal recovery to account for suffixes

5 years agoReword message for incorrect float literal
Esteban Küber [Sun, 20 Jan 2019 21:59:35 +0000 (13:59 -0800)]
Reword message for incorrect float literal

5 years agoUse is_dummy instead of comparing against DUMMY_SP
Esteban Küber [Sun, 20 Jan 2019 21:53:13 +0000 (13:53 -0800)]
Use is_dummy instead of comparing against DUMMY_SP

5 years agoAuto merge of #57704 - lenoil98:patch-2, r=alexcrichton
bors [Sun, 20 Jan 2019 21:49:24 +0000 (21:49 +0000)]
Auto merge of #57704 - lenoil98:patch-2, r=alexcrichton

Update bootstrap.py

Add PowerPC64 support on FreeBSD