]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoUpdate sync condvar doc style
Ivan Tham [Sat, 31 Aug 2019 15:09:37 +0000 (23:09 +0800)]
Update sync condvar doc style

4 years agoAuto merge of #63991 - Centril:unique-improper-ctype, r=rkruppe
bors [Sat, 31 Aug 2019 06:38:46 +0000 (06:38 +0000)]
Auto merge of #63991 - Centril:unique-improper-ctype, r=rkruppe

`improper_ctypes`: guard against accidental change to `Unique<T>`

r? @eddyb

4 years agoAuto merge of #63975 - topecongiro:rustfmt-1.4.6, r=nikomatsakis
bors [Sat, 31 Aug 2019 01:35:10 +0000 (01:35 +0000)]
Auto merge of #63975 - topecongiro:rustfmt-1.4.6, r=nikomatsakis

Update rustfmt to 1.4.6

This PR updates rustfmt to 1.4.6. [CHANGELOG](https://github.com/rust-lang/rustfmt/blob/v1.4.6/CHANGELOG.md#146-2019-08-28).

4 years agoimproper_ctypes: guard against accidental change to Unique<T>.
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:50:39 +0000 (05:50 +0200)]
improper_ctypes: guard against accidental change to Unique<T>.

4 years agoAuto merge of #64026 - Centril:rollup-le667lp, r=Centril
bors [Fri, 30 Aug 2019 21:31:01 +0000 (21:31 +0000)]
Auto merge of #64026 - Centril:rollup-le667lp, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #62957 (Match the loop examples)
 - #63600 (Merge oli-obk mail addresses)
 - #63684 (Constify LinkedList new function)
 - #63847 ([rustdoc] Fix system theme detection)
 - #63999 (Add missing links on AsRef trait)
 - #64014 ( miri: detect too large dynamically sized objects )
 - #64015 (some const-eval test tweaks)

Failed merges:

r? @ghost

4 years agoRollup merge of #64015 - RalfJung:const-tests, r=oli-obk
Mazdak Farrokhzad [Fri, 30 Aug 2019 21:08:07 +0000 (23:08 +0200)]
Rollup merge of #64015 - RalfJung:const-tests, r=oli-obk

some const-eval test tweaks

Best reviewed commit-by-commit.

r? @oli-obk

4 years agoRollup merge of #64014 - RalfJung:miri-slice, r=oli-obk
Mazdak Farrokhzad [Fri, 30 Aug 2019 21:08:06 +0000 (23:08 +0200)]
Rollup merge of #64014 - RalfJung:miri-slice, r=oli-obk

 miri: detect too large dynamically sized objects

Needed to make https://github.com/rust-lang/miri/pull/929 pass.

r? @oli-obk

4 years agoRollup merge of #63999 - GuillaumeGomez:as-ref-missing-links, r=Mark-Simulacrum
Mazdak Farrokhzad [Fri, 30 Aug 2019 21:08:04 +0000 (23:08 +0200)]
Rollup merge of #63999 - GuillaumeGomez:as-ref-missing-links, r=Mark-Simulacrum

Add missing links on AsRef trait

cc @rust-lang/docs

4 years agoRollup merge of #63847 - GuillaumeGomez:system-theme-detection, r=kinnison
Mazdak Farrokhzad [Fri, 30 Aug 2019 21:08:03 +0000 (23:08 +0200)]
Rollup merge of #63847 - GuillaumeGomez:system-theme-detection, r=kinnison

[rustdoc] Fix system theme detection

Fixes #63830

The problem is that it returns the property "entirely" (so with the quotes in our case). Removing them fixes the issue.

cc @fenhl

r? @kinnison

4 years agoRollup merge of #63684 - GrayJack:const_list_new, r=Centril
Mazdak Farrokhzad [Fri, 30 Aug 2019 21:08:01 +0000 (23:08 +0200)]
Rollup merge of #63684 - GrayJack:const_list_new, r=Centril

Constify LinkedList new function

Change the `LinkedList::new()` function to become a const fn, allowing the use in constant context.

4 years agoRollup merge of #63600 - rust-lang:oli-obk-patch-1, r=Mark-Simulacrum
Mazdak Farrokhzad [Fri, 30 Aug 2019 21:07:59 +0000 (23:07 +0200)]
Rollup merge of #63600 - rust-lang:oli-obk-patch-1, r=Mark-Simulacrum

Merge oli-obk mail addresses

4 years agoRollup merge of #62957 - dns2utf8:doc_loop_keyword, r=GuillaumeGomez
Mazdak Farrokhzad [Fri, 30 Aug 2019 21:07:57 +0000 (23:07 +0200)]
Rollup merge of #62957 - dns2utf8:doc_loop_keyword, r=GuillaumeGomez

Match the loop examples

The idea is to show the usefulness of the expression side by side.

4 years agoAuto merge of #63982 - sam09:fix-63976, r=estebank
bors [Fri, 30 Aug 2019 17:54:55 +0000 (17:54 +0000)]
Auto merge of #63982 - sam09:fix-63976, r=estebank

When accessing private field of union, do not misidentify it as a struct

Fix incorrect error message when accessing private field of union.

Fixes #63976.

4 years agoAuto merge of #64018 - flip1995:clippyup, r=oli-obk
bors [Fri, 30 Aug 2019 13:56:35 +0000 (13:56 +0000)]
Auto merge of #64018 - flip1995:clippyup, r=oli-obk

Update Clippy

cc rust-lang/rust-clippy#4475

r? @oli-obk

4 years agoadd test
Ralf Jung [Fri, 30 Aug 2019 13:04:12 +0000 (15:04 +0200)]
add test

4 years agoAuto merge of #63827 - andjo403:out-of-process-rustc-in-rustdoc, r=Mark-Simulacrum
bors [Fri, 30 Aug 2019 10:25:26 +0000 (10:25 +0000)]
Auto merge of #63827 - andjo403:out-of-process-rustc-in-rustdoc, r=Mark-Simulacrum

Run doctests via out-of-process rustc

closes #63638

4 years agoUpdate Clippy
flip1995 [Fri, 30 Aug 2019 07:53:42 +0000 (09:53 +0200)]
Update Clippy

4 years agoconst-eval tests: make all unions repr(C)
Ralf Jung [Fri, 30 Aug 2019 07:35:02 +0000 (09:35 +0200)]
const-eval tests: make all unions repr(C)

4 years agoexplain why REF_AS_USIZE is important
Ralf Jung [Fri, 30 Aug 2019 07:31:21 +0000 (09:31 +0200)]
explain why REF_AS_USIZE is important

4 years agotweak const-valid test
Ralf Jung [Fri, 30 Aug 2019 07:30:59 +0000 (09:30 +0200)]
tweak const-valid test

4 years agomake unions repr(C)
Ralf Jung [Fri, 30 Aug 2019 07:29:58 +0000 (09:29 +0200)]
make unions repr(C)

4 years agoAuto merge of #63402 - estebank:strip-margin, r=oli-obk
bors [Fri, 30 Aug 2019 06:49:15 +0000 (06:49 +0000)]
Auto merge of #63402 - estebank:strip-margin, r=oli-obk

Strip code to the left and right in diagnostics for long lines

Fix #62999.

4 years agomod-level doc comment for validity check
Ralf Jung [Fri, 30 Aug 2019 06:37:02 +0000 (08:37 +0200)]
mod-level doc comment for validity check

4 years agobetter variable names
Ralf Jung [Tue, 27 Aug 2019 16:36:11 +0000 (18:36 +0200)]
better variable names

4 years agomiri: detect too large dynamically sized objects
Ralf Jung [Tue, 27 Aug 2019 10:54:46 +0000 (12:54 +0200)]
miri: detect too large dynamically sized objects

4 years agoAuto merge of #60966 - oli-obk:diagnostic_items, r=eddyb
bors [Fri, 30 Aug 2019 03:09:39 +0000 (03:09 +0000)]
Auto merge of #60966 - oli-obk:diagnostic_items, r=eddyb

Add a "diagnostic item" scheme for lints referring to libstd items

fixes https://github.com/rust-lang/rust/issues/39131

r? @Manishearth @rust-lang/wg-diagnostics

4 years agoUpdate tests
Oliver Scherer [Fri, 30 Aug 2019 00:46:25 +0000 (02:46 +0200)]
Update tests

4 years agoAdd a "diagnostic item" scheme
Oliver Scherer [Sun, 19 May 2019 18:16:04 +0000 (20:16 +0200)]
Add a "diagnostic item" scheme

This allows lints and other diagnostics to refer to items
by a unique ID instead of relying on whacky path
resolution schemes that may break when items are
relocated.

4 years agoMerge oli-obk mail addresses
Oliver Scherer [Thu, 15 Aug 2019 16:20:35 +0000 (18:20 +0200)]
Merge oli-obk mail addresses

4 years agoRun doctests via out-of-process rustc
Andreas Jonson [Thu, 29 Aug 2019 21:15:31 +0000 (23:15 +0200)]
Run doctests via out-of-process rustc

4 years agosupport rustdoc test from stdin to rustc
Andreas Jonson [Tue, 27 Aug 2019 06:07:56 +0000 (08:07 +0200)]
support rustdoc test from stdin to rustc

4 years agoFix test.
Sam Radhakrishan [Thu, 29 Aug 2019 19:27:20 +0000 (00:57 +0530)]
Fix test.

4 years agoAuto merge of #63971 - flip1995:clippyup, r=oli-obk
bors [Thu, 29 Aug 2019 18:52:09 +0000 (18:52 +0000)]
Auto merge of #63971 - flip1995:clippyup, r=oli-obk

Update Clippy

cc rust-lang/rust-clippy#4462

r? @oli-obk @Manishearth

4 years agoAuto merge of #64000 - Centril:rollup-70s9ar3, r=Centril
bors [Thu, 29 Aug 2019 15:14:47 +0000 (15:14 +0000)]
Auto merge of #64000 - Centril:rollup-70s9ar3, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #62734 (Hide trait default methods)
 - #63953 (bootstrap: allow specifying mirror for bootstrap compiler download.)
 - #63956 (rustc: Handle modules in "fat" LTO more robustly)
 - #63979 (std: Remove the `wasm_syscall` feature)

Failed merges:

r? @ghost

4 years agoRollup merge of #63979 - alexcrichton:remove-wasm-syscall, r=dtolnay
Mazdak Farrokhzad [Thu, 29 Aug 2019 15:14:03 +0000 (17:14 +0200)]
Rollup merge of #63979 - alexcrichton:remove-wasm-syscall, r=dtolnay

std: Remove the `wasm_syscall` feature

This commit removes the `wasm_syscall` feature from the
wasm32-unknown-unknown build of the standard library. This feature was
originally intended to allow an opt-in way to interact with the
operating system in a posix-like way but it was never stabilized.
Nowadays with the advent of the `wasm32-wasi` target that should
entirely replace the intentions of the `wasm_syscall` feature.

4 years agoRollup merge of #63956 - alexcrichton:fix-lto-all-cached, r=michaelwoerister
Mazdak Farrokhzad [Thu, 29 Aug 2019 15:14:01 +0000 (17:14 +0200)]
Rollup merge of #63956 - alexcrichton:fix-lto-all-cached, r=michaelwoerister

rustc: Handle modules in "fat" LTO more robustly

When performing a "fat" LTO the compiler has a whole mess of codegen
units that it links together. To do this it needs to select one module
as a "base" module and then link everything else into this module.
Previously LTO passes assume that there's at least one module in-memory
to link into, but nowadays that's not always true! With incremental
compilation modules may actually largely be cached and it may be
possible that there's no in-memory modules to work with.

This commit updates the logic of the LTO backend to handle modules a bit
more uniformly during a fat LTO. This commit immediately splits them
into two lists, one serialized and one in-memory. The in-memory list is
then searched for the largest module and failing that we simply
deserialize the first serialized module and link into that. This
refactoring avoids juggling three lists, two of which are serialized
modules and one of which is half serialized and half in-memory.

Closes #63349

4 years agoRollup merge of #63953 - crlf0710:bootstrap_mirroring, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 29 Aug 2019 15:13:59 +0000 (17:13 +0200)]
Rollup merge of #63953 - crlf0710:bootstrap_mirroring, r=Mark-Simulacrum

bootstrap: allow specifying mirror for bootstrap compiler download.

4 years agoRollup merge of #62734 - GuillaumeGomez:hide-default-methods, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 29 Aug 2019 15:13:57 +0000 (17:13 +0200)]
Rollup merge of #62734 - GuillaumeGomez:hide-default-methods, r=Mark-Simulacrum

Hide trait default methods

Fixes #62499.

However, the question remains: do we want to extend it to this point or not?

r? @QuietMisdreavus

4 years agoAdd missing links on AsRef trait
Guillaume Gomez [Thu, 29 Aug 2019 14:04:13 +0000 (16:04 +0200)]
Add missing links on AsRef trait

4 years agoAuto merge of #63998 - Centril:rollup-pfuwxz3, r=Centril
bors [Thu, 29 Aug 2019 11:20:45 +0000 (11:20 +0000)]
Auto merge of #63998 - Centril:rollup-pfuwxz3, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #63867 (resolve: Block expansion of a derive container until all its derives are resolved)
 - #63880 (Validation: check raw wide pointer metadata)
 - #63914 (ty: use Align for ReprOptions pack and align.)
 - #63941 (rustbuild: allow disabling deny(warnings) for bootstrap)
 - #63949 (Fix build src/libtest)
 - #63984 (Update rust-installer to limit memory use)
 - #63992 (Small improvement for Ord implementation of integers)

Failed merges:

r? @ghost

4 years agoRollup merge of #63992 - lzutao:integer-ord, r=nagisa
Mazdak Farrokhzad [Thu, 29 Aug 2019 11:18:01 +0000 (13:18 +0200)]
Rollup merge of #63992 - lzutao:integer-ord, r=nagisa

Small improvement for Ord implementation of integers

link: https://godbolt.org/z/tuTDOg
### Before

**asm**
```asm
example::cmp:
  mov eax, dword ptr [rdi]
  xor ecx, ecx
  cmp eax, dword ptr [rsi]
  seta cl
  mov eax, 255
  cmovae eax, ecx
  ret
```

**llvm-mca**
```
Iterations:        100
Instructions:      700
Total Cycles:      217
Total uOps:        1100

Dispatch Width:    6
uOps Per Cycle:    5.07
IPC:               3.23
Block RThroughput: 1.8
```

### After

**asm**
```asm
example::cmp:
  mov eax, dword ptr [rdi]
  xor ecx, ecx
  cmp eax, dword ptr [rsi]
  setne cl
  mov eax, 255
  cmovae eax, ecx
  ret
```

**llvm-mca**
```
Iterations:        100
Instructions:      700
Total Cycles:      209
Total uOps:        1000

Dispatch Width:    6
uOps Per Cycle:    4.78
IPC:               3.35
Block RThroughput: 1.7
```

r? @nagisa

4 years agoRollup merge of #63984 - cuviper:rust-installer-mem, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 29 Aug 2019 11:18:00 +0000 (13:18 +0200)]
Rollup merge of #63984 - cuviper:rust-installer-mem, r=Mark-Simulacrum

Update rust-installer to limit memory use

See https://github.com/rust-lang/rust-installer/pull/98 -- on a many-core machine, the xz memory for so many threads is more than a 32-bit process can handle. The xz stream is now limited to 8 threads.

r? @alexcrichton

4 years agoRollup merge of #63949 - JohnTitor:fix-quick-build, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 29 Aug 2019 11:17:59 +0000 (13:17 +0200)]
Rollup merge of #63949 - JohnTitor:fix-quick-build, r=Mark-Simulacrum

Fix build src/libtest

Fixes #63928

r? @Mark-Simulacrum

4 years agoRollup merge of #63941 - Keruspe:warnings, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 29 Aug 2019 11:17:57 +0000 (13:17 +0200)]
Rollup merge of #63941 - Keruspe:warnings, r=Mark-Simulacrum

rustbuild: allow disabling deny(warnings) for bootstrap

When deny-warnings is not specified or set to true, the behaviour is the same as before.
When deny-warnings is set to false, warnings are now allowed

Fixes #63911

4 years agoRollup merge of #63914 - hvenev:repr-fields, r=eddyb
Mazdak Farrokhzad [Thu, 29 Aug 2019 11:17:55 +0000 (13:17 +0200)]
Rollup merge of #63914 - hvenev:repr-fields, r=eddyb

ty: use Align for ReprOptions pack and align.

4 years agoRollup merge of #63880 - RalfJung:miri-meta, r=oli-obk
Mazdak Farrokhzad [Thu, 29 Aug 2019 11:17:53 +0000 (13:17 +0200)]
Rollup merge of #63880 - RalfJung:miri-meta, r=oli-obk

Validation: check raw wide pointer metadata

While I was at it, I also added a missing check for slices not to be too big.

r? @oli-obk
Fixes https://github.com/rust-lang/miri/issues/918

4 years agoRollup merge of #63867 - petrochenkov:dhelpers, r=matthewjasper
Mazdak Farrokhzad [Thu, 29 Aug 2019 11:17:52 +0000 (13:17 +0200)]
Rollup merge of #63867 - petrochenkov:dhelpers, r=matthewjasper

resolve: Block expansion of a derive container until all its derives are resolved

So, it turns out there's one more reason to block expansion of a `#[derive]` container until all the derives inside it are resolved, beside `Copy` (https://github.com/rust-lang/rust/pull/63248).

The set of derive helper attributes registered by derives in the container also has to be known before the derives themselves are expanded, otherwise it may be too late (see https://github.com/rust-lang/rust/pull/63468#issuecomment-524550872 and the `#[stable_hasher]`-related test failures in https://github.com/rust-lang/rust/pull/63468).

So, we stop our attempts to unblock the container earlier, as soon as the `Copy` status is known, and just block until all its derives are resolved.
After all the derives are resolved we immediately go and process their helper attributes in the item, without delaying it until expansion of the individual derives.

Unblocks https://github.com/rust-lang/rust/pull/63468
r? @matthewjasper (as a reviewer of https://github.com/rust-lang/rust/pull/63248)
cc @c410-f3r

4 years agoAuto merge of #63990 - Centril:rollup-q1nt0b0, r=Centril
bors [Thu, 29 Aug 2019 05:05:17 +0000 (05:05 +0000)]
Auto merge of #63990 - Centril:rollup-q1nt0b0, r=Centril

Rollup of 11 pull requests

Successful merges:

 - #63811 (Correctly suggest adding bounds to `impl Trait` argument)
 - #63933 (Resolve some small issues related to #63580)
 - #63938 (or-pattern: fix typo in error message)
 - #63945 (Recover `mut $pat` and other improvements)
 - #63958 (const_prop: only call error_to_const_error if we are actually showing something)
 - #63961 (Add Option<Span> to `require_lang_item`)
 - #63963 (remove the reference to __cxa_thread_atexit_impl)
 - #63965 (Prevent syntax error in LD linker version script)
 - #63968 (rustc_apfloat: make the crate #![no_std] explicitly.)
 - #63970 (Notify me (flip1995) when Clippy toolstate changes)
 - #63980 (add missing `#[repr(C)]` on the Slices union)

Failed merges:

 - #63989 (Add Yaah to clippy toolstain notification list)

r? @ghost

4 years agoSmall improvement for Ord implementation of integers
Lzu Tao [Thu, 29 Aug 2019 03:52:18 +0000 (03:52 +0000)]
Small improvement for Ord implementation of integers

4 years agoRollup merge of #63980 - DutchGhost:master, r=cramertj
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:58 +0000 (05:32 +0200)]
Rollup merge of #63980 - DutchGhost:master, r=cramertj

add missing `#[repr(C)]` on the Slices union

Adds the `#[repr(C)]` attribute to the `Slices` union used to convert an `&str` into a `&[u8]`.
Without the attribute, the union has an unspecified layout: https://doc.rust-lang.org/reference/types/union.html, so performing the 'transmute' is unsound without the attribute (as far as I understand).

The `Repr` union, used for converting a raw ptr + len to a slice has this attribute as well:
https://github.com/rust-lang/rust/blob/master/src/libcore/ptr/mod.rs#L211-#L216

4 years agoRollup merge of #63970 - flip1995:notify_clippy, r=oli-obk
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:57 +0000 (05:32 +0200)]
Rollup merge of #63970 - flip1995:notify_clippy, r=oli-obk

Notify me (flip1995) when Clippy toolstate changes

I want in on the fun :tada:

Also friendly ping @llogiq @mcarton: Since you two aren't _that_ active on the Clippy repo anymore, do you still want to get pinged on Clippy toolstate changes?

r? @oli-obk

4 years agoRollup merge of #63968 - eddyb:apfloat-nostd, r=matthewjasper
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:56 +0000 (05:32 +0200)]
Rollup merge of #63968 - eddyb:apfloat-nostd, r=matthewjasper

rustc_apfloat: make the crate #![no_std] explicitly.

We only need allocation, and even that could be made optional.

4 years agoRollup merge of #63965 - loganwendholt:linker-script-fix, r=michaelwoerister
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:54 +0000 (05:32 +0200)]
Rollup merge of #63965 - loganwendholt:linker-script-fix, r=michaelwoerister

Prevent syntax error in LD linker version script

As discussed in #63925, there is an edge case in which an invalid LD version script is generated when building a `cdylib` with no exported symbols. This PR makes a slight modification to the  LD version script generation by first checking to see if any symbols need to be exported. If not, the `global` section of the linker script is simply omitted, and the syntax error is averted.

4 years agoRollup merge of #63963 - Wind-River:master_003, r=alexcrichton
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:53 +0000 (05:32 +0200)]
Rollup merge of #63963 - Wind-River:master_003, r=alexcrichton

remove the reference to __cxa_thread_atexit_impl

r? @alexcrichton

cc @n-salim

4 years agoRollup merge of #63961 - JohnTitor:improve-require-lang-item, r=estebank
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:51 +0000 (05:32 +0200)]
Rollup merge of #63961 - JohnTitor:improve-require-lang-item, r=estebank

Add Option<Span> to `require_lang_item`

Fixes #63954

I'm not sure where to take `Some(span)` or something so I use `None` in many places.
r? @estebank

4 years agoRollup merge of #63958 - RalfJung:silence-const-prop, r=oli-obk
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:50 +0000 (05:32 +0200)]
Rollup merge of #63958 - RalfJung:silence-const-prop, r=oli-obk

const_prop: only call error_to_const_error if we are actually showing something

This makes `RUSTC_CTFE_BACKTRACE` useful again.

r? @oli-obk

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

4 years agoRollup merge of #63945 - Centril:recover-mut-pat, r=estebank
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:48 +0000 (05:32 +0200)]
Rollup merge of #63945 - Centril:recover-mut-pat, r=estebank

Recover `mut $pat` and other improvements

- Recover on e.g. `mut Foo(x, y)` and suggest `Foo(mut x, mut y)`. Fixes https://github.com/rust-lang/rust/issues/63764.
- Recover on e.g. `let mut mut x;`
- Recover on e.g. `let keyword` and `let keyword(...)`.
- Cleanups in `token.rs` with `fn is_non_raw_ident_where` and friends.

4 years agoRollup merge of #63938 - tshepang:typo, r=Centril
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:46 +0000 (05:32 +0200)]
Rollup merge of #63938 - tshepang:typo, r=Centril

or-pattern: fix typo in error message

cc https://github.com/rust-lang/rust/issues/54883.

4 years agoRollup merge of #63933 - wesleywiser:cleanup_from_move_promoted, r=oli-obk
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:45 +0000 (05:32 +0200)]
Rollup merge of #63933 - wesleywiser:cleanup_from_move_promoted, r=oli-obk

Resolve some small issues related to #63580

This resolves some feedback left on #63580 after it was merged:

- Adds documentation to `mir::Static` and `mir::StaticKind`
- Simplifies `maybe_get_optimized_mir()` and `maybe_get_promoted_mir()`

cc @bjorn3 @RalfJung

4 years agoRollup merge of #63811 - estebank:impl-trait-arg, r=cramertj
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:43 +0000 (05:32 +0200)]
Rollup merge of #63811 - estebank:impl-trait-arg, r=cramertj

Correctly suggest adding bounds to `impl Trait` argument

Fix #63706.

4 years agoAuto merge of #62855 - Aaron1011:feature/rustdoc-reexport-final, r=petrochenkov
bors [Thu, 29 Aug 2019 01:22:11 +0000 (01:22 +0000)]
Auto merge of #62855 - Aaron1011:feature/rustdoc-reexport-final, r=petrochenkov

Improve Rustdoc's handling of procedural macros

Fixes #58700
Fixes #58696
Fixes #49553
Fixes #52210

This commit removes the special rustdoc handling for proc macros, as we can now
retrieve their span and attributes just like any other item.

A new command-line option is added to rustdoc: `--crate-type`. This takes the same options as rustc's `--crate-type` option. However, all values other than `proc-macro` are treated the same. This allows Rustdoc to enable 'proc macro mode' when handling a proc macro crate.

In compiletest, a new 'rustdoc-flags' option is added. This allows us to
pass in the '--proc-macro-crate' flag in the absence of Cargo.

I've opened [an additional PR to Cargo](https://github.com/rust-lang/cargo/pull/7159) to support passing in this flag.
These two PRS can be merged in any order - the Cargo changes will not
take effect until the 'cargo' submodule is updated in this repository.

4 years agoAllow running rustdoc on proc-macro crates without specifying '--crate-type proc...
Aaron Hill [Wed, 28 Aug 2019 22:00:36 +0000 (18:00 -0400)]
Allow running rustdoc on proc-macro crates without specifying '--crate-type proc-macro'

Add a test to make sure that this works

4 years agoUpdate rust-installer to limit memory use
Josh Stone [Wed, 28 Aug 2019 21:48:02 +0000 (14:48 -0700)]
Update rust-installer to limit memory use

4 years agoAuto merge of #62941 - GuillaumeGomez:save-crate-filter, r=Mark-Simulacrum
bors [Wed, 28 Aug 2019 21:42:52 +0000 (21:42 +0000)]
Auto merge of #62941 - GuillaumeGomez:save-crate-filter, r=Mark-Simulacrum

Save crate filtering on rustdoc

Fixes #62929.

I added a hashmap and a hash encoding for the current crate list in case you have multiple crates handling on a same website (who talked about docs.rs?!). Like that, for each context, you have the filter crate selected.

r? @QuietMisdreavus

4 years agoFixes #63976. Incorrect error message.
Sam Radhakrishan [Wed, 28 Aug 2019 21:13:09 +0000 (02:43 +0530)]
Fixes #63976. Incorrect error message.

Fix incorrect error message when accessing
private field of union

4 years agoAuto merge of #63875 - philipc:issue-57822, r=michaelwoerister
bors [Wed, 28 Aug 2019 17:49:37 +0000 (17:49 +0000)]
Auto merge of #63875 - philipc:issue-57822, r=michaelwoerister

debuginfo: give unique names to closure and generator types

Closure types have been moved to the namespace where they
are defined, and both closure and generator type names now
include the disambiguator.

This fixes an exception when lldb prints nested closures.

Fixes #57822

I haven't included the `DW_AT_artificial` changes discussed in #57822 because they make the output worse IMO, but I can easily add these if still required. For example, for the new test case the output is now:
```
(lldb) p g
(issue_57822::main::closure-1) $1 = closure-1(closure(1))
```
but adding `DW_AT_artificial` changes this to:
```
(lldb) p g
(issue_57822::main::closure-1) $0 = closure-1 {

}
```

Note that nested generators didn't cause the exception. I haven't determined why, but I think it makes sense to add the disambiguator for them too. It feels like we still don't really understand why closures were causing an error though.

r? @michaelwoerister

4 years agoadd missing `#[repr(C)]` on a union
Dodo [Wed, 28 Aug 2019 15:38:24 +0000 (17:38 +0200)]
add missing `#[repr(C)]` on a union

4 years agostd: Remove the `wasm_syscall` feature
Alex Crichton [Tue, 23 Jul 2019 14:25:34 +0000 (07:25 -0700)]
std: Remove the `wasm_syscall` feature

This commit removes the `wasm_syscall` feature from the
wasm32-unknown-unknown build of the standard library. This feature was
originally intended to allow an opt-in way to interact with the
operating system in a posix-like way but it was never stabilized.
Nowadays with the advent of the `wasm32-wasi` target that should
entirely replace the intentions of the `wasm_syscall` feature.

4 years agoAuto merge of #63853 - matthewjasper:test-ast-serialization, r=estebank
bors [Wed, 28 Aug 2019 13:43:05 +0000 (13:43 +0000)]
Auto merge of #63853 - matthewjasper:test-ast-serialization, r=estebank

Add default serialization for `Ident`s

Also add tests for `-Zast-json` and `-Zast-json-noexpand`

closes #63728

4 years agoUpdate rustfmt to 1.4.6
topecongiro [Wed, 28 Aug 2019 13:36:56 +0000 (22:36 +0900)]
Update rustfmt to 1.4.6

4 years agoUpdate Clippy
flip1995 [Wed, 28 Aug 2019 11:25:04 +0000 (13:25 +0200)]
Update Clippy

4 years agoNotify me (flip1995) when Clippy toolstate changes
flip1995 [Wed, 28 Aug 2019 11:23:00 +0000 (13:23 +0200)]
Notify me (flip1995) when Clippy toolstate changes

4 years agoExtract `Decoder::entry_unless_proc_macro()`
Wesley Wiser [Wed, 28 Aug 2019 01:24:57 +0000 (21:24 -0400)]
Extract `Decoder::entry_unless_proc_macro()`

4 years agoSimplify `maybe_get_optimized_mir` and `maybe_get_promoted_mir`
Wesley Wiser [Tue, 27 Aug 2019 01:58:16 +0000 (21:58 -0400)]
Simplify `maybe_get_optimized_mir` and `maybe_get_promoted_mir`

Since both functions are always unwrapped, don't wrap the return value
in an `Option`.

4 years agoAdd some comments to `mir::Static` and `mir::StaticKind`
Wesley Wiser [Tue, 27 Aug 2019 01:07:58 +0000 (21:07 -0400)]
Add some comments to `mir::Static` and `mir::StaticKind`

4 years agoSave crate filtering on rustdoc
Guillaume Gomez [Wed, 24 Jul 2019 15:50:48 +0000 (17:50 +0200)]
Save crate filtering on rustdoc

4 years agorustc_apfloat: make the crate #![no_std] explicitly.
Eduard-Mihai Burtescu [Wed, 28 Aug 2019 08:23:41 +0000 (11:23 +0300)]
rustc_apfloat: make the crate #![no_std] explicitly.

4 years agoAuto merge of #63820 - oli-obk:eager_const_eval, r=nikomatsakis
bors [Wed, 28 Aug 2019 07:29:07 +0000 (07:29 +0000)]
Auto merge of #63820 - oli-obk:eager_const_eval, r=nikomatsakis

Simplify eager normalization of constants

r? @nikomatsakis

4 years agoAuto merge of #63127 - kper:pr, r=nikomatsakis
bors [Wed, 28 Aug 2019 03:42:00 +0000 (03:42 +0000)]
Auto merge of #63127 - kper:pr, r=nikomatsakis

Cleanup: Consistently use `Param` instead of `Arg` #62426

Fixes #62426

4 years agoPrevent syntax error in ld linker version script
Logan Wendholt [Wed, 28 Aug 2019 00:35:33 +0000 (20:35 -0400)]
Prevent syntax error in ld linker version script

4 years agoor-pattern: fix typo in error message
Tshepang Lekhonkhobe [Wed, 28 Aug 2019 00:23:58 +0000 (02:23 +0200)]
or-pattern: fix typo in error message

4 years agoAuto merge of #63960 - ehuss:update-cargo, r=alexcrichton
bors [Tue, 27 Aug 2019 23:57:05 +0000 (23:57 +0000)]
Auto merge of #63960 - ehuss:update-cargo, r=alexcrichton

Update cargo

Update cargo

10 commits in 3f700ec43ce72305eb5315cfc710681f3469d4b4..22f7dd0495cd72ce2082d318d5a9b4dccb9c5b8c
2019-08-19 22:43:12 +0000 to 2019-08-27 16:10:51 +0000
- Update and improve zsh completion (rust-lang/cargo#7296)
- Document that `package` can be used in `[patch]` (rust-lang/cargo#7263)
- Fix `error:`/`warning:` coloring inconsistency with rustc (rust-lang/cargo#7294)
- Tests: Import rustc_plugin from its new location (rust-lang/cargo#7287)
- Update README azure badge. (rust-lang/cargo#7293)
- Update home dependencies to v0.5 (rust-lang/cargo#7277)
- Fix typo (rust-lang/cargo#7279)
- Update libgit2 dependencies (rust-lang/cargo#7275)
- Fix old lockfile encoding wrt newlines (rust-lang/cargo#7262)
- Fix dSYM uplifting when symlink is broken (rust-lang/cargo#7268)

4 years agoRemove `sized` spans
Yuki Okushi [Tue, 27 Aug 2019 22:32:25 +0000 (07:32 +0900)]
Remove `sized` spans

4 years agoApply review comments
Yuki Okushi [Tue, 27 Aug 2019 22:10:47 +0000 (07:10 +0900)]
Apply review comments

4 years agoAdd Option<Span> to `require_lang_item`
Yuki Okushi [Tue, 27 Aug 2019 21:17:58 +0000 (06:17 +0900)]
Add Option<Span> to `require_lang_item`

4 years agoMerge pull request #9 from Wind-River/V7LIBC-948
Baoshan [Tue, 27 Aug 2019 22:06:16 +0000 (15:06 -0700)]
Merge pull request #9 from Wind-River/V7LIBC-948

remove the reference to __cxa_thread_atexit_impl

4 years agoAdd default serialization for `Ident`s
Matthew Jasper [Sat, 24 Aug 2019 15:25:55 +0000 (16:25 +0100)]
Add default serialization for `Ident`s

Add tests for -Zast-json and -Zast-json-noexpand, which need this impl.

4 years agoImprove 'mut ' diagnostic.
Mazdak Farrokhzad [Tue, 27 Aug 2019 21:44:44 +0000 (23:44 +0200)]
Improve 'mut ' diagnostic.

4 years agoUpdate cargo
Eric Huss [Tue, 27 Aug 2019 21:03:32 +0000 (14:03 -0700)]
Update cargo

4 years agorustc: Handle modules in "fat" LTO more robustly
Alex Crichton [Tue, 27 Aug 2019 19:25:35 +0000 (12:25 -0700)]
rustc: Handle modules in "fat" LTO more robustly

When performing a "fat" LTO the compiler has a whole mess of codegen
units that it links together. To do this it needs to select one module
as a "base" module and then link everything else into this module.
Previously LTO passes assume that there's at least one module in-memory
to link into, but nowadays that's not always true! With incremental
compilation modules may actually largely be cached and it may be
possible that there's no in-memory modules to work with.

This commit updates the logic of the LTO backend to handle modules a bit
more uniformly during a fat LTO. This commit immediately splits them
into two lists, one serialized and one in-memory. The in-memory list is
then searched for the largest module and failing that we simply
deserialize the first serialized module and link into that. This
refactoring avoids juggling three lists, two of which are serialized
modules and one of which is half serialized and half in-memory.

Closes #63349

4 years agoconst_prop: only call error_to_const_error if we are actually showing something
Ralf Jung [Tue, 27 Aug 2019 20:18:25 +0000 (22:18 +0200)]
const_prop: only call error_to_const_error if we are actually showing something

4 years agoEnsure 'let mut ;' where ':pat' is banned.
Mazdak Farrokhzad [Tue, 27 Aug 2019 17:51:21 +0000 (19:51 +0200)]
Ensure 'let mut ;' where ':pat' is banned.

4 years agoremove the reference to __cxa_thread_atexit_impl
Baoshan Pang [Tue, 27 Aug 2019 17:13:59 +0000 (10:13 -0700)]
remove the reference to __cxa_thread_atexit_impl

4 years agobootstrap: allow specifying mirror for bootstrap compiler download.
Charles Lew [Tue, 27 Aug 2019 16:45:29 +0000 (00:45 +0800)]
bootstrap: allow specifying mirror for bootstrap compiler download.

4 years agoAuto merge of #63922 - RalfJung:miri, r=nikomatsakis
bors [Tue, 27 Aug 2019 16:23:59 +0000 (16:23 +0000)]
Auto merge of #63922 - RalfJung:miri, r=nikomatsakis

update miri

Cc @oli-obk

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

4 years agoFix build src/libtest
Yuki Okushi [Tue, 27 Aug 2019 15:32:21 +0000 (00:32 +0900)]
Fix build src/libtest

4 years agoChanging error messages and renaming tests #63127
Kevin Per [Tue, 27 Aug 2019 13:47:41 +0000 (15:47 +0200)]
Changing error messages and renaming tests #63127

`async-await/no-args-non-move-async-closure`
`generator/no-arguments-on-generators`

4 years agorustbuild: allow disabling deny(warnings) for bootstrap
Marc-Antoine Perennou [Tue, 27 Aug 2019 07:37:51 +0000 (09:37 +0200)]
rustbuild: allow disabling deny(warnings) for bootstrap

When deny-warnings is not specified or set to true, the behaviour is the same as before.
When deny-warnings is set to false, warnings are now allowed

Fixes #63911

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 years agoupdate miri
Ralf Jung [Tue, 27 Aug 2019 13:49:47 +0000 (15:49 +0200)]
update miri

4 years agoAuto merge of #63639 - Mark-Simulacrum:rustdoc-clean-3, r=GuillaumeGomez
bors [Tue, 27 Aug 2019 12:45:16 +0000 (12:45 +0000)]
Auto merge of #63639 - Mark-Simulacrum:rustdoc-clean-3, r=GuillaumeGomez

rustdoc: general cleanup