]> git.lizzy.rs Git - rust.git/log
rust.git
5 years ago[RISCV] Disable c extension and atomic_cas.
David Craven [Sat, 28 Jul 2018 17:20:14 +0000 (19:20 +0200)]
[RISCV] Disable c extension and atomic_cas.

5 years ago[RISCV] Enable CI.
David Craven [Thu, 26 Jul 2018 11:40:40 +0000 (13:40 +0200)]
[RISCV] Enable CI.

5 years ago[RISCV] Add built-in target riscv32imac-unknown-none-elf.
David Craven [Thu, 26 Jul 2018 12:01:24 +0000 (14:01 +0200)]
[RISCV] Add built-in target riscv32imac-unknown-none-elf.

5 years ago[RISCV] Implement call abi.
David Craven [Tue, 24 Jul 2018 10:04:17 +0000 (12:04 +0200)]
[RISCV] Implement call abi.

5 years ago[RISCV] Enable LLVM backend.
David Craven [Tue, 24 Jul 2018 10:03:28 +0000 (12:03 +0200)]
[RISCV] Enable LLVM backend.

5 years agoFallout from fixing `try_read_value` to work with enums
Oliver Schneider [Wed, 1 Aug 2018 13:29:13 +0000 (15:29 +0200)]
Fallout from fixing `try_read_value` to work with enums

5 years agoAddress behaviour changing review comments
Oliver Schneider [Wed, 1 Aug 2018 10:55:05 +0000 (12:55 +0200)]
Address behaviour changing review comments

5 years agoAddress stylistic review comments and rebase fallout
Oliver Schneider [Mon, 30 Jul 2018 13:59:00 +0000 (15:59 +0200)]
Address stylistic review comments and rebase fallout

5 years agoSimplify the char correctness check
Oliver Schneider [Mon, 30 Jul 2018 13:42:11 +0000 (15:42 +0200)]
Simplify the char correctness check

5 years agoFix `try_read_value` not working for enums
Oliver Schneider [Thu, 26 Jul 2018 12:05:32 +0000 (14:05 +0200)]
Fix `try_read_value` not working for enums

5 years agoReintroduce `Undef` and properly check constant value sizes
Oliver Schneider [Tue, 24 Jul 2018 16:28:53 +0000 (18:28 +0200)]
Reintroduce `Undef` and properly check constant value sizes

5 years agoSplit out growth functionality into BitVector type
Mark Rousskov [Mon, 30 Jul 2018 14:58:14 +0000 (08:58 -0600)]
Split out growth functionality into BitVector type

5 years agoSwitch syntax attribute tracking to BitVector
Mark Rousskov [Mon, 30 Jul 2018 14:39:03 +0000 (08:39 -0600)]
Switch syntax attribute tracking to BitVector

5 years agoAuto merge of #52474 - alexcrichton:better-lto-error, r=eddyb
bors [Wed, 1 Aug 2018 11:38:20 +0000 (11:38 +0000)]
Auto merge of #52474 - alexcrichton:better-lto-error, r=eddyb

rustc: Handle linker diagnostics from LLVM

Previously linker diagnostic were being hidden when two modules were linked
together but failed to link. This commit fixes the situation by ensuring that we
have a diagnostic handler installed and also adds support for handling linker
diagnostics.

5 years agoImplement custom read_to_end for io::Take
ljedrz [Wed, 1 Aug 2018 08:23:07 +0000 (10:23 +0200)]
Implement custom read_to_end for io::Take

5 years agoAnother SmallVec.extend optimization
Andre Bogus [Wed, 1 Aug 2018 11:00:37 +0000 (13:00 +0200)]
Another SmallVec.extend optimization

This improves SmallVec.extend even more over #52859

Before (as of #52859):

```
test small_vec::tests::fill_small_vec_1_10_with_cap  ... bench:          31 ns/iter (+/- 5)
test small_vec::tests::fill_small_vec_1_10_wo_cap    ... bench:          70 ns/iter (+/- 4)
test small_vec::tests::fill_small_vec_1_50_with_cap  ... bench:          36 ns/iter (+/- 3)
test small_vec::tests::fill_small_vec_1_50_wo_cap    ... bench:         256 ns/iter (+/- 17)
test small_vec::tests::fill_small_vec_32_10_with_cap ... bench:          31 ns/iter (+/- 5)
test small_vec::tests::fill_small_vec_32_10_wo_cap   ... bench:          26 ns/iter (+/- 1)
test small_vec::tests::fill_small_vec_32_50_with_cap ... bench:          49 ns/iter (+/- 4)
test small_vec::tests::fill_small_vec_32_50_wo_cap   ... bench:         219 ns/iter (+/- 11)
test small_vec::tests::fill_small_vec_8_10_with_cap  ... bench:          32 ns/iter (+/- 2)
test small_vec::tests::fill_small_vec_8_10_wo_cap    ... bench:          61 ns/iter (+/- 12)
test small_vec::tests::fill_small_vec_8_50_with_cap  ... bench:          37 ns/iter (+/- 3)
test small_vec::tests::fill_small_vec_8_50_wo_cap    ... bench:         210 ns/iter (+/- 10)
```

After:

```
test small_vec::tests::fill_small_vec_1_10_wo_cap    ... bench:          31 ns/iter (+/- 3)
test small_vec::tests::fill_small_vec_1_50_with_cap  ... bench:          39 ns/iter (+/- 4)
test small_vec::tests::fill_small_vec_1_50_wo_cap    ... bench:          35 ns/iter (+/- 4)
test small_vec::tests::fill_small_vec_32_10_with_cap ... bench:          37 ns/iter (+/- 3)
test small_vec::tests::fill_small_vec_32_10_wo_cap   ... bench:          32 ns/iter (+/- 2)
test small_vec::tests::fill_small_vec_32_50_with_cap ... bench:          52 ns/iter (+/- 4)
test small_vec::tests::fill_small_vec_32_50_wo_cap   ... bench:          46 ns/iter (+/- 0)
test small_vec::tests::fill_small_vec_8_10_with_cap  ... bench:          35 ns/iter (+/- 4)
test small_vec::tests::fill_small_vec_8_10_wo_cap    ... bench:          31 ns/iter (+/- 0)
test small_vec::tests::fill_small_vec_8_50_with_cap  ... bench:          40 ns/iter (+/- 15)
test small_vec::tests::fill_small_vec_8_50_wo_cap    ... bench:          36 ns/iter (+/- 2)
```

5 years agoAlign 6-week cycle check with beta promotion instead of stable release.
kennytm [Wed, 1 Aug 2018 10:03:19 +0000 (18:03 +0800)]
Align 6-week cycle check with beta promotion instead of stable release.

The regression check is to make beta promotion easier, so it makes more
sense to use the Tuesday of the release week (T-2) as the end point of the
regression prevention, instead of Thursday (T-0). But since the beta
promotion PR is sent at Tuesday evening at UTC, the protection should
include the whole Tuesday as well, meaning the 6-week cycle will start from
Wednesdays.

This will also move the start of the regression protection week one day
earlier.

5 years agoresolve: Implement prelude search for macro paths
Vadim Petrochenkov [Sun, 22 Jul 2018 23:52:51 +0000 (02:52 +0300)]
resolve: Implement prelude search for macro paths

resolve/expansion: Implement tool attributes

5 years agoAuto merge of #52937 - pietroalbini:rollup, r=pietroalbini
bors [Wed, 1 Aug 2018 08:41:36 +0000 (08:41 +0000)]
Auto merge of #52937 - pietroalbini:rollup, r=pietroalbini

Rollup of 30 pull requests

Successful merges:

 - #52340 (Document From trait implementations for OsStr, OsString, CString, and CStr)
 - #52628 (Cleanup some rustdoc code)
 - #52732 (Remove unstable and deprecated APIs)
 - #52745 (Update clippy to latest master)
 - #52771 (Clarify thread::park semantics)
 - #52778 (Improve readability of serialize.rs)
 - #52810 ([NLL] Don't make "fake" match variables mutable)
 - #52821 (pretty print for std::collections::vecdeque)
 - #52822 (Fix From<LocalWaker>)
 - #52824 (Fix -Wpessimizing-move warnings in rustllvm/PassWrapper)
 - #52825 (Make sure #47772 does not regress)
 - #52831 (remove references to AUTHORS.txt file)
 - #52842 (update comment)
 - #52846 (Add timeout to use of `curl` in bootstrap.py.)
 - #52851 (Make the tool_lints actually usable)
 - #52853 (Improve bootstrap help on stages)
 - #52859 (Use Vec::extend in SmallVec::extend when applicable)
 - #52861 (Add targets for HermitCore (https://hermitcore.org) to the Rust compiler and port libstd to it.)
 - #52867 (releases.md: fix 2 typos)
 - #52870 (Implement Unpin for FutureObj and LocalFutureObj)
 - #52876 (run-pass/const-endianness: negate before to_le())
 - #52878 (Fix wrong issue number in the test name)
 - #52883 (Include lifetime in mutability suggestion in NLL messages)
 - #52888 (Use suggestions for shell format arguments)
 - #52904 (NLL: sort diagnostics by span)
 - #52905 (Fix a typo in unsize.rs)
 - #52907 (NLL: On "cannot move out of type" error, print original before rewrite)
 - #52914 (Only run the sparc-abi test on sparc)
 - #52918 (Backport 1.27.2 release notes)
 - #52929 (Update compatibility note for 1.28.0 to be correct)

Failed merges:

r? @ghost

5 years agoRollup merge of #52929 - Havvy:patch-1, r=alexcrichton
Pietro Albini [Wed, 1 Aug 2018 08:13:10 +0000 (10:13 +0200)]
Rollup merge of #52929 - Havvy:patch-1, r=alexcrichton

Update compatibility note for 1.28.0 to be correct

You can still put implementations on `dyn Trait + Send + Send`, but it'd be the same as putting them on `dyn Trait + Send`. This is why the error is that there are duplicate definitions in the example.

5 years agoRollup merge of #52918 - pietroalbini:1.27.2-notes, r=Mark-Simulacrum
Pietro Albini [Wed, 1 Aug 2018 08:13:08 +0000 (10:13 +0200)]
Rollup merge of #52918 - pietroalbini:1.27.2-notes, r=Mark-Simulacrum

Backport 1.27.2 release notes

r? @Mark-Simulacrum

5 years agoRollup merge of #52914 - nagisa:sparc-is-sparc’s-own-business, r=alexcrichton
Pietro Albini [Wed, 1 Aug 2018 08:13:07 +0000 (10:13 +0200)]
Rollup merge of #52914 - nagisa:sparc-is-sparc’s-own-business, r=alexcrichton

Only run the sparc-abi test on sparc

It is not required for LLVM to have SPARC target support, so it is
necessary to only run this test when LLVM does support SPARC. Sadly, it
isn’t possible to specify exactly this constraint. Instead, we specify
that this test should run on SPARC host only (it surely is sane
assumption to make that compiler running on a SPARC can generate
SPARC, right?)

Since you cannot specify multiple `only-*` to have it run on both 32-bit
and 64-bit SPARC we pick 64-bit SPARC, because it is exactly what is
being tested by this test.

Fixes #52881

5 years agoRollup merge of #52907 - pnkfelix:issue-52877-original-source-should-precede-suggesti...
Pietro Albini [Wed, 1 Aug 2018 08:13:06 +0000 (10:13 +0200)]
Rollup merge of #52907 - pnkfelix:issue-52877-original-source-should-precede-suggestions, r=petrochenkov

NLL: On "cannot move out of type" error, print original before rewrite

NLL: On "cannot move out of type" error, print original source before rewrite.

 * Arguably this change is sometimes injecting noise into the output  (namely in the cases where the suggested rewrite is inline with the   suggestion and we end up highlighting the original source code).   I would not be opposed to something more aggressive/dynamic, like   revising the suggestion code to automatically print the original  source when necessary (e.g. when the error does not have a span   that includes the span of the suggestion).

 * Also, as another note on this change: The doc comment for `Diagnostic::span_suggestion`  says:
```rust
    /// The message
    ///
    /// * should not end in any punctuation (a `:` is added automatically)
    /// * should not be a question
    /// * should not contain any parts like "the following", "as shown"
```
  *  but the `:` is *not* added when the emitted line appears  out-of-line relative to the suggestion. I find that to be an  unfortunate UI experience.

----

As a drive-by fix, also changed code to combine multiple suggestions for a pattern into a single multipart suggestion (which vastly improves user experience IMO).

----

Includes the updates to expected NLL diagnostics.

Fix #52877

5 years agoRollup merge of #52905 - pravic:unsize-typo, r=alexcrichton
Pietro Albini [Wed, 1 Aug 2018 08:13:05 +0000 (10:13 +0200)]
Rollup merge of #52905 - pravic:unsize-typo, r=alexcrichton

Fix a typo in unsize.rs

RfC -> RFC

5 years agoRollup merge of #52904 - pnkfelix:issue-51167-sort-by-span, r=petrochenkov
Pietro Albini [Wed, 1 Aug 2018 08:13:04 +0000 (10:13 +0200)]
Rollup merge of #52904 - pnkfelix:issue-51167-sort-by-span, r=petrochenkov

NLL: sort diagnostics by span

Sorting the output diagnostics by span is a long planned revision to the NLL diagnostics that we hope will yield a less surprising user experience in some case.

Once we got them buffered, it was trivial to implement. (The hard part is skimming the resulting changes to the diagnostics to make sure nothing broke... Note that I largely rubber-stamped the `#[rustc_regions]` output change.)

Fix #51167

5 years agoRollup merge of #52888 - estebank:shell-sugg, r=oli-obk
Pietro Albini [Wed, 1 Aug 2018 08:13:02 +0000 (10:13 +0200)]
Rollup merge of #52888 - estebank:shell-sugg, r=oli-obk

Use suggestions for shell format arguments

Follow up to #52649.

5 years agoRollup merge of #52883 - estebank:nll-diag-mut, r=oli-obk
Pietro Albini [Wed, 1 Aug 2018 08:13:01 +0000 (10:13 +0200)]
Rollup merge of #52883 - estebank:nll-diag-mut, r=oli-obk

Include lifetime in mutability suggestion in NLL messages

Fix #52880.

5 years agoRollup merge of #52878 - mikhail-m1:master, r=kennytm
Pietro Albini [Wed, 1 Aug 2018 08:13:00 +0000 (10:13 +0200)]
Rollup merge of #52878 - mikhail-m1:master, r=kennytm

Fix wrong issue number in the test name

I made a mistake in previous PR #52620, second issue number was wrong, changing from #52133 to #52113

r? @kennytm

5 years agoRollup merge of #52876 - cuviper:const-endianness-be, r=kennytm
Pietro Albini [Wed, 1 Aug 2018 08:12:58 +0000 (10:12 +0200)]
Rollup merge of #52876 - cuviper:const-endianness-be, r=kennytm

run-pass/const-endianness: negate before to_le()

`const LE_I128` needs parentheses to negate the value *before* calling
`to_le()`, otherwise it doesn't match the operations performed in the
black-boxed part of the test.  This only makes a tangible difference on
big-endian targets.

5 years agoRollup merge of #52870 - cramertj:unpin-futureobj, r=aturon
Pietro Albini [Wed, 1 Aug 2018 08:12:57 +0000 (10:12 +0200)]
Rollup merge of #52870 - cramertj:unpin-futureobj, r=aturon

Implement Unpin for FutureObj and LocalFutureObj

cc @MajorBreakfast

r? @aturon

5 years agoRollup merge of #52867 - matthiaskrgr:release_typos, r=Mark-Simulacrum
Pietro Albini [Wed, 1 Aug 2018 08:12:56 +0000 (10:12 +0200)]
Rollup merge of #52867 - matthiaskrgr:release_typos, r=Mark-Simulacrum

releases.md: fix 2 typos

5 years agoRollup merge of #52861 - ColinFinck:master, r=alexcrichton
Pietro Albini [Wed, 1 Aug 2018 08:12:55 +0000 (10:12 +0200)]
Rollup merge of #52861 - ColinFinck:master, r=alexcrichton

Add targets for HermitCore (https://hermitcore.org) to the Rust compiler and port libstd to it.

As a start, the port uses the simplest possible configuration (no jemalloc, abort on panic) and makes use of existing Unix-specific code wherever possible.
It adds targets for x86_64 (current main HermitCore platform) and aarch64 (HermitCore platform under development).

Together with the patches to "liblibc" (https://github.com/rust-lang/libc/pull/1048) and llvm (https://github.com/rust-lang/llvm/pull/122), this enables HermitCore applications to be written in Rust.

5 years agoRollup merge of #52859 - ljedrz:smallvec_true_extend, r=Mark-Simulacrum
Pietro Albini [Wed, 1 Aug 2018 08:12:54 +0000 (10:12 +0200)]
Rollup merge of #52859 - ljedrz:smallvec_true_extend, r=Mark-Simulacrum

Use Vec::extend in SmallVec::extend when applicable

As calculated in #52738, `Vec::extend` is much faster than `push`ing to it in a loop. We can take advantage of this method in `SmallVec` too - at least in cases when its underlying object is an `AccumulateVec::Heap`.

~~This approach also accidentally improves the `push` loop of the `AccumulateVec::Array` variant, because it doesn't utilize `SmallVec::push` which performs `self.reserve(1)` with every iteration; this is unnecessary, because we're already reserving the whole space we will be needing by performing `self.reserve(iter.size_hint().0)` at the beginning.~~

5 years agoRollup merge of #52853 - RalfJung:bootstrap-help, r=alexcrichton
Pietro Albini [Wed, 1 Aug 2018 08:12:52 +0000 (10:12 +0200)]
Rollup merge of #52853 - RalfJung:bootstrap-help, r=alexcrichton

Improve bootstrap help on stages

Cc @eddyb

5 years agoRollup merge of #52851 - flip1995:tool_lints, r=oli-obk
Pietro Albini [Wed, 1 Aug 2018 08:12:51 +0000 (10:12 +0200)]
Rollup merge of #52851 - flip1995:tool_lints, r=oli-obk

Make the tool_lints actually usable

cc #44690

Necessary for rust-lang-nursery/rust-clippy#2955 and rust-lang-nursery/rust-clippy#2977

This PR makes it possible for lint tools (at the moment only for Clippy) to implement the `tool_lints`, like it was documented in #52018.

Because the `declare_lint` macro is pretty cluttered right now, there was not really a good way to add the `tool_name` as an additional argument of the macro. That's why I chose to introduce the new `declare_tool_lint` macro.

The switch from `&str` to `String` in the `lint_groups` `FxHashMap` is because I got weird error messages in the `check_lint_name` method. And the `by_name` field of the `LintStore` also uses `String`.

### What comes with this PR:

If this PR lands and Clippy switches to the `tool_lints`, the currently used methods
```rust
#[cfg_attr(feature = "cargo-clippy", allow(clippy_lint))]
#[allow(unknown_lints, clippy_lint)]
```
to `allow`/`warn`/`deny`/`forbid` Clippy lints, won't have any effects anymore, but also won't produce a warning. That is because the name of `clippy_lint` will then be `clippy::clippy_lint`. (Maybe we can add a clippy lint to search for `cfg_attr` appearances with the `cargo-clippy` feature?)

r? @oli-obk

5 years agoRollup merge of #52846 - kennytm:bootstrap-curl-timeout, r=Mark-Simulacrum
Pietro Albini [Wed, 1 Aug 2018 08:12:50 +0000 (10:12 +0200)]
Rollup merge of #52846 - kennytm:bootstrap-curl-timeout, r=Mark-Simulacrum

Add timeout to use of `curl` in bootstrap.py.

Recently we've seen a lot of "30 minutes no output" spurious errors while downloading the bootstrap compiler. This added several timeout options so if the "30 minutes no output" errors were caused by connection or transfer issue, we could fail quicker for curl to retry.

5 years agoRollup merge of #52842 - toidiu:ak-commentUpdate, r=estebank
Pietro Albini [Wed, 1 Aug 2018 08:12:48 +0000 (10:12 +0200)]
Rollup merge of #52842 - toidiu:ak-commentUpdate, r=estebank

update comment

r? @joshtriplett

Addressing comment: https://github.com/rust-lang/rust/pull/52761#pullrequestreview-141323066

5 years agoRollup merge of #52831 - dsciarra:rm-ref-to-author-file, r=alexcrichton
Pietro Albini [Wed, 1 Aug 2018 08:12:47 +0000 (10:12 +0200)]
Rollup merge of #52831 - dsciarra:rm-ref-to-author-file, r=alexcrichton

remove references to AUTHORS.txt file

Rust does not ship an AUTHORS.txt file anymore.

5 years agoRollup merge of #52825 - RalfJung:codegen, r=alexcrichton
Pietro Albini [Wed, 1 Aug 2018 08:12:46 +0000 (10:12 +0200)]
Rollup merge of #52825 - RalfJung:codegen, r=alexcrichton

Make sure #47772 does not regress

Mostly to make my life in https://github.com/rust-lang/rust/pull/52206 harder.^^

Or should I just add that test there?

5 years agoRollup merge of #52824 - varkor:fix-llvm-ret-move-warnings, r=rkruppe
Pietro Albini [Wed, 1 Aug 2018 08:12:45 +0000 (10:12 +0200)]
Rollup merge of #52824 - varkor:fix-llvm-ret-move-warnings, r=rkruppe

Fix -Wpessimizing-move warnings in rustllvm/PassWrapper

These are producing warnings when building rustc (`warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]`).

5 years agoRollup merge of #52822 - MajorBreakfast:fix-from-local-waker, r=cramertj
Pietro Albini [Wed, 1 Aug 2018 08:12:44 +0000 (10:12 +0200)]
Rollup merge of #52822 - MajorBreakfast:fix-from-local-waker, r=cramertj

Fix From<LocalWaker>

This is a follow-up to https://github.com/rust-lang/rust/pull/52640

Fixes `From<LocalWaker>` which is affected by the same accidental drop bug (unless I'm totally mistaken)

r? @cramertj

5 years agoRollup merge of #52821 - fukatani:gdb-vecdeque-print, r=michaelwoerister
Pietro Albini [Wed, 1 Aug 2018 08:12:42 +0000 (10:12 +0200)]
Rollup merge of #52821 - fukatani:gdb-vecdeque-print, r=michaelwoerister

pretty print for std::collections::vecdeque

I want pretty print function for VecDeque like Vec.

```rust
use std::collections::VecDeque;

fn main() {
    let mut d: VecDeque<i32> = VecDeque::new();
    d.push_back(4);
    d.push_back(4);
    d.push_back(6);
    let mut v: Vec<i32> = Vec::new();
    v.push(4);
    v.push(4);
    v.push(6);
}
```

```
(gdb) p v
$1 = Vec<i32>(len: 3, cap: 4) = {4, 4, 6}
(gdb) p d
$2 = VecDeque<i32>(len: 3, cap: 8) = {4, 4, 6}
```

Thanks.

5 years agoRollup merge of #52810 - matthewjasper:more-immutablity, r=pnkfelix
Pietro Albini [Wed, 1 Aug 2018 08:12:41 +0000 (10:12 +0200)]
Rollup merge of #52810 - matthewjasper:more-immutablity, r=pnkfelix

[NLL] Don't make "fake" match variables mutable

These variables can't be mutated by the user, but since they have names the unused-mut lint thinks that it should check them.

5 years agoRollup merge of #52778 - ljedrz:readable_serialize, r=kennytm
Pietro Albini [Wed, 1 Aug 2018 08:12:40 +0000 (10:12 +0200)]
Rollup merge of #52778 - ljedrz:readable_serialize, r=kennytm

Improve readability of serialize.rs

5 years agoRollup merge of #52771 - matklad:patch-1, r=kennytm
Pietro Albini [Wed, 1 Aug 2018 08:12:38 +0000 (10:12 +0200)]
Rollup merge of #52771 - matklad:patch-1, r=kennytm

Clarify thread::park semantics

It took me quite some time to realize that the example is not actually racy, so let's clarify it? :-)

5 years agoRollup merge of #52745 - commandline:master, r=oli-obk
Pietro Albini [Wed, 1 Aug 2018 08:12:37 +0000 (10:12 +0200)]
Rollup merge of #52745 - commandline:master, r=oli-obk

Update clippy to latest master

r? @oli-obk

There is a regression in the version in current nightly that falsely lints `println!` and `writeln!` that use named arguments, thinking all rhs values for the argument expressions are literals even when they are not. This update includes the fix for that.

5 years agoRollup merge of #52732 - SimonSapin:spring, r=Mark-Simulacrum
Pietro Albini [Wed, 1 Aug 2018 08:12:36 +0000 (10:12 +0200)]
Rollup merge of #52732 - SimonSapin:spring, r=Mark-Simulacrum

Remove unstable and deprecated APIs

5 years agoRollup merge of #52628 - Mark-Simulacrum:rustdoc-cleanup-1, r=QuietMisdreavus
Pietro Albini [Wed, 1 Aug 2018 08:12:35 +0000 (10:12 +0200)]
Rollup merge of #52628 - Mark-Simulacrum:rustdoc-cleanup-1, r=QuietMisdreavus

Cleanup some rustdoc code

Commits are mostly individual though some do depend on others.

5 years agoRollup merge of #52340 - cypher:document-from-trait-in-ffi, r=steveklabnik
Pietro Albini [Wed, 1 Aug 2018 08:12:32 +0000 (10:12 +0200)]
Rollup merge of #52340 - cypher:document-from-trait-in-ffi, r=steveklabnik

Document From trait implementations for OsStr, OsString, CString, and CStr

As part of issue #51430 (cc @skade).

The allocation and copy claims should be double-checked.

r? @steveklabnik

5 years agoAuto merge of #52756 - alexcrichton:cap-applicable, r=oli-obk
bors [Wed, 1 Aug 2018 06:44:09 +0000 (06:44 +0000)]
Auto merge of #52756 - alexcrichton:cap-applicable, r=oli-obk

rustc: Disallow machine applicability in foreign macros

Recent changes to lints disallowed lints from being emitted against code located
in foreign macros, except for future-incompatible lints. For a future
incompatible lint, however, the automatic suggestions may not be applicable!

This commit updates this code path to force all applicability suggestions made
to foreign macros to never be `MachineApplicable`. This should avoid rustfix
actually attempting fixing these suggestions, causing non-compiling code to be
produced.

Closes rust-lang/cargo#5799

5 years agoadd comment
Ralf Jung [Wed, 1 Aug 2018 06:39:30 +0000 (08:39 +0200)]
add comment

5 years agorustc_resolve: record single-segment extern crate import resolutions.
Eduard-Mihai Burtescu [Wed, 1 Aug 2018 01:26:58 +0000 (04:26 +0300)]
rustc_resolve: record single-segment extern crate import resolutions.

5 years agoUpdate compatibility note for 1.28.0 to be correct
Ryan Scheel [Wed, 1 Aug 2018 01:31:15 +0000 (18:31 -0700)]
Update compatibility note for 1.28.0 to be correct

5 years agoFixup test case
Mark Rousskov [Sun, 29 Jul 2018 02:22:45 +0000 (20:22 -0600)]
Fixup test case

5 years agoAdd dyn to Write
Mark Rousskov [Sun, 29 Jul 2018 00:15:52 +0000 (18:15 -0600)]
Add dyn to Write

5 years agoCleanup highlighting code
Mark Rousskov [Sun, 22 Jul 2018 20:10:10 +0000 (14:10 -0600)]
Cleanup highlighting code

Removes some unused code and de-publicizes structs

5 years agoRemove global derive_id and reset_ids functions
Mark Rousskov [Sun, 22 Jul 2018 13:25:00 +0000 (07:25 -0600)]
Remove global derive_id and reset_ids functions

Previously these functions relied on TLS but we can instead thread the
relevant state through explicitly.

5 years agocheck_const: use the same ParamEnv as codegen for statics
Ralf Jung [Tue, 31 Jul 2018 22:25:46 +0000 (00:25 +0200)]
check_const: use the same ParamEnv as codegen for statics

5 years agoAddress code review
John Renner [Tue, 31 Jul 2018 22:00:45 +0000 (15:00 -0700)]
Address code review

5 years agoUse suggestions for shell format arguments
Esteban Küber [Mon, 30 Jul 2018 23:33:53 +0000 (16:33 -0700)]
Use suggestions for shell format arguments

5 years agoBackport 1.27.2 release notes
Pietro Albini [Tue, 31 Jul 2018 21:13:41 +0000 (23:13 +0200)]
Backport 1.27.2 release notes

5 years agoaddress review feedback (`sort_by_key` is so much cleaner here than `sort_by`!).
Felix S. Klock II [Tue, 31 Jul 2018 21:00:01 +0000 (23:00 +0200)]
address review feedback (`sort_by_key` is so much cleaner here than `sort_by`!).

5 years agoAuto merge of #52234 - petrochenkov:macuse2, r=Mark-Simulacrum
bors [Tue, 31 Jul 2018 20:52:14 +0000 (20:52 +0000)]
Auto merge of #52234 - petrochenkov:macuse2, r=Mark-Simulacrum

resolve: Modularize crate-local `#[macro_export] macro_rules`

Based on https://github.com/rust-lang/rust/pull/50911, cc https://github.com/rust-lang/rust/pull/50911#issuecomment-401151270

`#[macro_export] macro_rules` items are collected from the whole crate and are planted into the root module as items, so the external view of the crate is symmetric with its internal view and something like `$crate::my_macro` where `my_macro` is `#[macro_export] macro_rules` works both locally and from other crates.

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

5 years agoDon't count MIR locals as borrowed after StorageDead when finding locals live across...
John Kåre Alsaker [Tue, 31 Jul 2018 19:54:30 +0000 (21:54 +0200)]
Don't count MIR locals as borrowed after StorageDead when finding locals live across a yield terminator

5 years agoAllow borrow conflicts for promoted length 0 arrays
Matthew Jasper [Tue, 31 Jul 2018 20:35:22 +0000 (21:35 +0100)]
Allow borrow conflicts for promoted length 0 arrays

5 years agoAllow unnameable tests
John Renner [Tue, 31 Jul 2018 20:17:44 +0000 (13:17 -0700)]
Allow unnameable tests

5 years agoOnly run the sparc-abi test on sparc
Simonas Kazlauskas [Tue, 31 Jul 2018 19:37:41 +0000 (22:37 +0300)]
Only run the sparc-abi test on sparc

It is not required for LLVM to have SPARC target support, so it is
necessary to only run this test when LLVM does support SPARC. Sadly, it
isn’t possible to specify exactly this constraint. Instead, we specify
that this test should run on SPARC host only (it surely is sane
assumption to make that compiler running on a SPARC can generate
SPARC, right?)

Since you cannot specify multiple `only-*` to have it run on both 32-bit
and 64-bit SPARC we pick 64-bit SPARC, because it is exactly what is
being tested by this test.

Fixes #52881

5 years agoPut back original field discovery
Guillaume Gomez [Tue, 31 Jul 2018 19:43:29 +0000 (21:43 +0200)]
Put back original field discovery

5 years agoUse SetLenOnDrop in Vec::truncate()
Laurentiu Nicola [Tue, 31 Jul 2018 15:36:04 +0000 (18:36 +0300)]
Use SetLenOnDrop in Vec::truncate()

This avoids a redundant length check in some cases when calling
`Vec::truncate` or `Vec::clear`.

Fixes #51802

5 years agorustc: Handle linker diagnostic from LLVM
Alex Crichton [Tue, 17 Jul 2018 23:20:51 +0000 (16:20 -0700)]
rustc: Handle linker diagnostic from LLVM

Previously linker diagnostic were being hidden when two modules were linked
together but failed to link. This commit fixes the situation by ensuring that we
have a diagnostic handler installed and also adds support for handling linker
diagnostics.

5 years agoFormat code for easier editing
Mark Rousskov [Sun, 22 Jul 2018 13:39:52 +0000 (07:39 -0600)]
Format code for easier editing

5 years agoFurther extract error code switch
Mark Rousskov [Sun, 22 Jul 2018 17:10:19 +0000 (11:10 -0600)]
Further extract error code switch

Removes dependency on UnstableFeatures from markdown rendering

5 years agoRemove dependency on error handling from find_testable_code
Mark Rousskov [Sat, 21 Jul 2018 23:15:25 +0000 (17:15 -0600)]
Remove dependency on error handling from find_testable_code

5 years agoProvide test configuration through struct
Mark Rousskov [Sat, 21 Jul 2018 22:54:30 +0000 (16:54 -0600)]
Provide test configuration through struct

This is far more sound than passing many different arguments of the same
type.

5 years agoProvide warnings for invalid code blocks in markdown files
Mark Rousskov [Sat, 21 Jul 2018 22:30:02 +0000 (16:30 -0600)]
Provide warnings for invalid code blocks in markdown files

Previously we would only warn on Rust code but we can also do so when
testing markdown (the diag::Handler is available).

5 years agoPull out nightly checking to edges
Mark Rousskov [Sat, 21 Jul 2018 22:12:16 +0000 (16:12 -0600)]
Pull out nightly checking to edges

Parsing the code block's LangString (```foo) previously checked itself
to see if we were on nightly; that isn't the right place to do so. Move
that check slightly outwards to better abstract LangString.

(This is also an optimization as we avoid the costly environment
variable load of RUSTC_BOOTSTRAP).

5 years agoNLL: On "cannot move out of type" error, print original source before rewrite.
Felix S. Klock II [Tue, 31 Jul 2018 15:22:12 +0000 (17:22 +0200)]
NLL: On "cannot move out of type" error, print original source before rewrite.

 * Arguably this change is sometimes injecting noise into the output
   (namely in the cases where the suggested rewrite is inline with the
   suggestion and we end up highlighting the original source code).
   I would not be opposed to something more aggressive/dynamic, like
   revising the suggestion code to automatically print the original
   source when necessary (e.g. when the error does not have a span
   that includes the span of the suggestion).

 * Also, as another note on this change: The doc comment for `Diagnostic::span_suggestion`
   says:
    /// The message
    ///
    /// * should not end in any punctuation (a `:` is added automatically)
    /// * should not be a question
    /// * should not contain any parts like "the following", "as shown"

   but the `:` is *not* added when the emitted line appears
   out-of-line relative to the suggestion. I find that to be an
   unfortunate UI experience.

----

As a drive-by fix, also changed code to combine multiple suggestions
for a pattern into a single multipart suggestion (which vastly
improves user experience IMO).

----

Includes the updates to expected NLL diagnostics.

5 years agoenable jemalloc assertions when configured to do so
Ralf Jung [Tue, 31 Jul 2018 15:01:39 +0000 (17:01 +0200)]
enable jemalloc assertions when configured to do so

5 years agoAuto merge of #52461 - irinagpopa:safe-llvm, r=nikomatsakis
bors [Tue, 31 Jul 2018 13:32:32 +0000 (13:32 +0000)]
Auto merge of #52461 - irinagpopa:safe-llvm, r=nikomatsakis

 rustc_codegen_llvm: use safe references for LLVM FFI types.

Part of #45274.

5 years agoFix a typo in unsize.rs
pravic [Tue, 31 Jul 2018 13:28:50 +0000 (16:28 +0300)]
Fix a typo in unsize.rs

RfC -> RFC

5 years agotests/ui: Add missing mips{64} ignores
dragan.mladjenovic [Tue, 31 Jul 2018 09:01:27 +0000 (11:01 +0200)]
tests/ui: Add missing mips{64} ignores

5 years agoUpdate the `.nll.stderr` files under new sorted-by-span scheme.
Felix S. Klock II [Tue, 31 Jul 2018 12:51:36 +0000 (14:51 +0200)]
Update the `.nll.stderr` files under new sorted-by-span scheme.

5 years agoUpdate tests that use `-Z borrowck=compare` or `#[feature(nll)]` to accmmodate diagno...
Felix S. Klock II [Tue, 31 Jul 2018 12:36:50 +0000 (14:36 +0200)]
Update tests that use `-Z borrowck=compare` or `#[feature(nll)]` to accmmodate diagnostic change.

5 years agorustc_llvm: fix linking on mingw.
Irina Popa [Tue, 31 Jul 2018 12:36:38 +0000 (15:36 +0300)]
rustc_llvm: fix linking on mingw.

5 years agoBlindly update the `#[rustc_region]` tests which got touched by the NLL diagnostic...
Felix S. Klock II [Tue, 31 Jul 2018 12:35:43 +0000 (14:35 +0200)]
Blindly update the `#[rustc_region]` tests which got touched by the NLL diagnostic change.

5 years agoSort NLL error diagnostics by span in an attempt to make them match source order
Felix S. Klock II [Tue, 31 Jul 2018 12:30:46 +0000 (14:30 +0200)]
Sort NLL error diagnostics by span in an attempt to make them match source order
(and thus, hopefully, more closely match user expectation).

5 years agoBenchmarks for SmallVec
ljedrz [Tue, 31 Jul 2018 12:11:04 +0000 (14:11 +0200)]
Benchmarks for SmallVec

5 years agoAuto merge of #50267 - humanenginuity:master, r=alexcrichton
bors [Tue, 31 Jul 2018 11:20:16 +0000 (11:20 +0000)]
Auto merge of #50267 - humanenginuity:master, r=alexcrichton

Implement inner deref for Option and Result

tracking issue: #50264

5 years agohopefully make test pass on windows
Ralf Jung [Tue, 31 Jul 2018 08:35:27 +0000 (10:35 +0200)]
hopefully make test pass on windows

5 years agoAuto merge of #52850 - SimonSapin:unstablize, r=alexcrichton
bors [Tue, 31 Jul 2018 09:08:33 +0000 (09:08 +0000)]
Auto merge of #52850 - SimonSapin:unstablize, r=alexcrichton

Revert "Stabilize to_bytes and from_bytes for integers."

This reverts commit c8f9b84b393915a48253e3edc862c15a9b7152a7 / PR https://github.com/rust-lang/rust/pull/51835, and reopens the tracking issue https://github.com/rust-lang/rust/issues/49792.

These methods were stabilized in Rust 1.29, which is still in Nightly as of this writing. So my understanding is that it is still time to change our minds. Given the ongoing discussion in https://github.com/rust-lang/rust/pull/51919 about possibly renaming these APIs and since 1.29 goes to beta soon, I’d like to revert this stabilization for now until a decision is made in that PR. It’s possible that a decision will be made in time for 1.29, but there is no urgency. At most I expect this functionality to make it into 1.30.

5 years agomake sure that the no-panic test tests what it is supposed to test
Ralf Jung [Sun, 29 Jul 2018 20:29:49 +0000 (22:29 +0200)]
make sure that the no-panic test tests what it is supposed to test

5 years agoFix coding style.
Colin Finck [Tue, 31 Jul 2018 07:49:10 +0000 (09:49 +0200)]
Fix coding style.

5 years agoAuto merge of #52630 - Mark-Simulacrum:rustdoc-cleanup-2, r=QuietMisdreavus
bors [Tue, 31 Jul 2018 07:02:10 +0000 (07:02 +0000)]
Auto merge of #52630 - Mark-Simulacrum:rustdoc-cleanup-2, r=QuietMisdreavus

Delete unused code in rustdoc

Also hid the unused crate exports of rustdoc. This is technically a breaking change but we don't even ship librustdoc in the sysroot so I don't expect breakage.

5 years agoAuto merge of #52863 - steveklabnik:update-books, r=Mark-Simulacrum
bors [Tue, 31 Jul 2018 03:30:47 +0000 (03:30 +0000)]
Auto merge of #52863 - steveklabnik:update-books, r=Mark-Simulacrum

update books for new release

r? @Mark-Simulacrum

5 years agoJust tidying up
John Renner [Tue, 31 Jul 2018 02:55:23 +0000 (19:55 -0700)]
Just tidying up

5 years agoReexport tests without polluting namespaces
John Renner [Wed, 25 Jul 2018 00:51:37 +0000 (17:51 -0700)]
Reexport tests without polluting namespaces

5 years agoAuto merge of #52731 - nikomatsakis:issue-52057-inference-variable, r=pnkfelix
bors [Tue, 31 Jul 2018 01:25:49 +0000 (01:25 +0000)]
Auto merge of #52731 - nikomatsakis:issue-52057-inference-variable, r=pnkfelix

Issue 52057 — inference variable

Break out the computation of universal region relations and do it during the typeck, where we can handle the resulting constraints that arise.

r? @pnkfelix

5 years agoDisable debug sections when optimization flags is set for LLD.
Yury Delendik [Tue, 31 Jul 2018 00:55:08 +0000 (19:55 -0500)]
Disable debug sections when optimization flags is set for LLD.

5 years agoregion_infer: rustfmt, pacifying the mercilous tidy
Niko Matsakis [Thu, 26 Jul 2018 12:38:18 +0000 (15:38 +0300)]
region_infer: rustfmt, pacifying the mercilous tidy

5 years agoassert no region obligations on entering custom type op
Niko Matsakis [Thu, 26 Jul 2018 12:19:21 +0000 (15:19 +0300)]
assert no region obligations on entering custom type op

Fixes #51649