]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #59906 - czipperz:bufwriter-use-getmut, r=kennytm
Mazdak Farrokhzad [Sun, 14 Apr 2019 15:49:24 +0000 (17:49 +0200)]
Rollup merge of #59906 - czipperz:bufwriter-use-getmut, r=kennytm

Make BufWriter use get_mut instead of manipulating inner in Write implementation

`get_mut` allows us to abstract over the implementation detail of inner being optional.

5 years agoRollup merge of #59900 - czipperz:remove-bracket-mut-syntax-in-pin-docs, r=RalfJung
Mazdak Farrokhzad [Sun, 14 Apr 2019 15:49:23 +0000 (17:49 +0200)]
Rollup merge of #59900 - czipperz:remove-bracket-mut-syntax-in-pin-docs, r=RalfJung

Remove [mut] syntax in pin docs

Resolves #59832

5 years agoRollup merge of #59896 - estebank:dedup-spans, r=davidtwco
Mazdak Farrokhzad [Sun, 14 Apr 2019 15:49:21 +0000 (17:49 +0200)]
Rollup merge of #59896 - estebank:dedup-spans, r=davidtwco

Remove duplicated redundant spans

Fix #59895.

5 years agoRollup merge of #59877 - Zoxc:hiridify_def_id, r=eddyb
Mazdak Farrokhzad [Sun, 14 Apr 2019 15:49:19 +0000 (17:49 +0200)]
Rollup merge of #59877 - Zoxc:hiridify_def_id, r=eddyb

HirIdify hir::Def

cc @ljedrz
r? @oli-obk

5 years agoRollup merge of #59856 - albins:update-polonius, r=nikomatsakis
Mazdak Farrokhzad [Sun, 14 Apr 2019 15:49:18 +0000 (17:49 +0200)]
Rollup merge of #59856 - albins:update-polonius, r=nikomatsakis

update polonius-engine

This updates polonius-engine to [version 0.7.0](https://github.com/rust-lang/polonius/blob/master/RELEASES.md#v070), which adds a hybrid algorithm that starts off with performing a cheaper, location-insensitive analysis before proceeding with the full analysis.

r? @nikomatsakis

5 years agoAuto merge of #59929 - RalfJung:miri, r=oli-obk
bors [Sun, 14 Apr 2019 12:55:21 +0000 (12:55 +0000)]
Auto merge of #59929 - RalfJung:miri, r=oli-obk

update miri

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

5 years agoupdate miri
Ralf Jung [Sun, 14 Apr 2019 09:02:18 +0000 (11:02 +0200)]
update miri

5 years agoAuto merge of #59693 - nnethercote:64-bit-Spans, r=petrochenkov
bors [Sun, 14 Apr 2019 08:55:16 +0000 (08:55 +0000)]
Auto merge of #59693 - nnethercote:64-bit-Spans, r=petrochenkov

Increase `Span` from 4 bytes to 8 bytes.

This increases the size of some important types, such as `ast::Expr` and
`mir::Statement`. However, it drastically reduces how much the interner
is used, and the fields are more natural sizes that don't require bit
operations to extract.

As a result, instruction counts drop across a range of workloads, by as
much as 10% for `script-servo` incremental builds.

Peak memory usage goes up a little for some cases, but down by more for
some other cases -- as much as 18% for non-incremental builds of
`packed-simd`.

The commit also:
- removes the `repr(packed)`, because it has negligible effect, but can
  cause undefined behaviour;
- replaces explicit impls of common traits (`Copy`, `PartialEq`, etc.)
  with derived ones.

r? @petrochenkov

5 years agoUpdate tests
John Kåre Alsaker [Thu, 11 Apr 2019 16:33:36 +0000 (18:33 +0200)]
Update tests

5 years agoHirIdify hir::Def
ljedrz [Wed, 3 Apr 2019 07:07:45 +0000 (09:07 +0200)]
HirIdify hir::Def

5 years agoAuto merge of #59798 - rchaser53:issue-59488, r=estebank
bors [Sun, 14 Apr 2019 05:58:13 +0000 (05:58 +0000)]
Auto merge of #59798 - rchaser53:issue-59488, r=estebank

Improvement for comparision against fn

I try to add error message.
related: https://github.com/rust-lang/rust/issues/59488

5 years agoAuto merge of #59950 - Centril:rollup-hpmr62i, r=Centril
bors [Sun, 14 Apr 2019 01:10:57 +0000 (01:10 +0000)]
Auto merge of #59950 - Centril:rollup-hpmr62i, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #59776 (Apply resource-suffix to search-index and source-files scripts as well)
 - #59784 (Suggest importing macros from the crate root)
 - #59812 (Exclude profiler-generated symbols from MSVC __imp_-symbol workaround.)
 - #59874 (Clean up handling of `-Z pgo-gen` commandline option.)
 - #59890 (Don't generate empty json variables)
 - #59911 (Revert "compile crates under test w/ -Zemit-stack-sizes")

Failed merges:

r? @ghost

5 years agoRollup merge of #59911 - pnkfelix:revert-pr-59401-to-fix-emit-stack-sizes-gc-sections...
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:39:50 +0000 (00:39 +0200)]
Rollup merge of #59911 - pnkfelix:revert-pr-59401-to-fix-emit-stack-sizes-gc-sections-ld-gold-bug, r=alexcrichton

Revert "compile crates under test w/ -Zemit-stack-sizes"

Revert PR #59401 to fix issue #59652 (a stable-to-beta regression).

This is result of squashing two revert commits:

Revert "compile all crates under test w/ -Zemit-stack-sizes"

This reverts commit 7d365cf27f4249fc9b61ba8abfc813abe43f1cb7.

Revert "bootstrap: build compiler-builtins with -Z emit-stack-sizes"

This reverts commit 8b8488ce8fc047282e7159343f30609417f9fa39.

----

(My intention is that someone can re-add this code again later, either after the `ld.gold` issue itself is fixed, or with safe-guards to check whether `ld.gold` is in use and then issuing warnings about the problems here when they arise.)

5 years agoRollup merge of #59890 - GuillaumeGomez:empty-json-variables, r=QuietMisdreavus
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:39:48 +0000 (00:39 +0200)]
Rollup merge of #59890 - GuillaumeGomez:empty-json-variables, r=QuietMisdreavus

Don't generate empty json variables

r? @rust-lang/rustdoc

5 years agoRollup merge of #59874 - michaelwoerister:pgo-updates-1, r=cramertj
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:39:46 +0000 (00:39 +0200)]
Rollup merge of #59874 - michaelwoerister:pgo-updates-1, r=cramertj

Clean up handling of `-Z pgo-gen` commandline option.

This PR adapts the `-Z pgo-gen` flag to how Clang and GCC handle the corresponding `-fprofile-generate` flag. In particular, the flag now optionally takes a directory to place the profiling data in and allows to omit the argument (instead of having to pass an empty string).

5 years agoRollup merge of #59812 - michaelwoerister:profile-gen-msvc-imp, r=alexcrichton
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:39:44 +0000 (00:39 +0200)]
Rollup merge of #59812 - michaelwoerister:profile-gen-msvc-imp, r=alexcrichton

Exclude profiler-generated symbols from MSVC __imp_-symbol workaround.

LLVM's profiling instrumentation adds a few symbols that are used by the profiler runtime. Since these show up as globals in the LLVM IR, the compiler generates `dllimport`-related `__imp_` stubs for them. This can lead to linker errors because the instrumentation symbols have weak linkage or are in a comdat section, but the `__imp_` stubs aren't.

Instead of trying to replicate the linkage/comdat setup for the stubs, this PR just excludes the profiler-related symbols from stub-generation since they aren't supposed to be referenced via `__declspec(dllimport)` anywhere anyway.

r? @alexcrichton

EDIT: I considered making this more general, i.e. inferring from the symbol name if it is a Rust symbol or not. But then I figured out that that would yield false negatives for `#[no_mangle]` et al, so I went with a blacklist approach.

5 years agoRollup merge of #59784 - davidtwco:issue-59764, r=estebank
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:39:43 +0000 (00:39 +0200)]
Rollup merge of #59784 - davidtwco:issue-59764, r=estebank

Suggest importing macros from the crate root

Fixes #59764.

r? @estebank
cc @varkor

5 years agoRollup merge of #59776 - GuillaumeGomez:apply-resource-suffix, r=QuietMisdreavus
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:39:41 +0000 (00:39 +0200)]
Rollup merge of #59776 - GuillaumeGomez:apply-resource-suffix, r=QuietMisdreavus

Apply resource-suffix to search-index and source-files scripts as well

Fixes #59771.

r? @QuietMisdreavus

5 years agoAuto merge of #59949 - Centril:rollup-lsiqq1g, r=Centril
bors [Sat, 13 Apr 2019 22:24:33 +0000 (22:24 +0000)]
Auto merge of #59949 - Centril:rollup-lsiqq1g, r=Centril

Rollup of 16 pull requests

Successful merges:

 - #59675 (Stabilize the `alloc` crate.)
 - #59708 (Mark variables captured by reference as mutable correctly)
 - #59735 (remove lookup_char_pos_adj)
 - #59747 (Copy book.toml unstable book generator)
 - #59796 (Retire `IsNotConst` naming)
 - #59804 (Clean up jobserver integration)
 - #59818 (Eliminate `FnBox` usages from libstd.)
 - #59830 (Fix links on keyword docs.)
 - #59835 (Re-export NonZero signed variant in std)
 - #59852 (std: Add `{read,write}_vectored` for more types)
 - #59855 (Fix attributes position in type declaration)
 - #59858 (Make duplicate matcher bindings a hard error)
 - #59899 (In `-Zprint-type-size` output, sort enum variants by size.)
 - #59912 (MaybeUninit: remove deprecated functions)
 - #59925 (Fix paste error in split_ascii_whitespace docs.)
 - #59930 (Exclude some copies of old book editions from search engines)

Failed merges:

r? @ghost

5 years agoRollup merge of #59930 - kornelski:first-robots, r=GuillaumeGomez
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:50 +0000 (00:23 +0200)]
Rollup merge of #59930 - kornelski:first-robots, r=GuillaumeGomez

Exclude some copies of old book editions from search engines

These are only stubs that confuse search engine users. There's no useful content in these locations.

5 years agoRollup merge of #59925 - solson:split_ascii_whitespace-docfix, r=Centril
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:49 +0000 (00:23 +0200)]
Rollup merge of #59925 - solson:split_ascii_whitespace-docfix, r=Centril

Fix paste error in split_ascii_whitespace docs.

It was accidentally still testing the unicode version, `split_whitespace`.

5 years agoRollup merge of #59912 - RalfJung:maybe-uninit, r=Centril
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:47 +0000 (00:23 +0200)]
Rollup merge of #59912 - RalfJung:maybe-uninit, r=Centril

MaybeUninit: remove deprecated functions

5 years agoRollup merge of #59899 - nnethercote:sort-enum-variants-by-size, r=pnkfelix
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:46 +0000 (00:23 +0200)]
Rollup merge of #59899 - nnethercote:sort-enum-variants-by-size, r=pnkfelix

In `-Zprint-type-size` output, sort enum variants by size.

It's useful to see the biggest variants first.

r? @pnkfelix

5 years agoRollup merge of #59858 - mark-i-m:dup-matcher-bindings-3, r=Centril
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:44 +0000 (00:23 +0200)]
Rollup merge of #59858 - mark-i-m:dup-matcher-bindings-3, r=Centril

Make duplicate matcher bindings a hard error

r? @Centril

Closes #57742

5 years agoRollup merge of #59855 - GuillaumeGomez:fix-attr-position-in-type-decl, r=QuietMisdreavus
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:42 +0000 (00:23 +0200)]
Rollup merge of #59855 - GuillaumeGomez:fix-attr-position-in-type-decl, r=QuietMisdreavus

Fix attributes position in type declaration

Fixes #59797.

r? @rust-lang/rustdoc

5 years agoRollup merge of #59852 - alexcrichton:more-vectored, r=sfackler
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:40 +0000 (00:23 +0200)]
Rollup merge of #59852 - alexcrichton:more-vectored, r=sfackler

std: Add `{read,write}_vectored` for more types

This commit implements the `{read,write}_vectored` methods on more types
in the standard library, namely:

* `std::fs::File`
* `std::process::ChildStd{in,out,err}`
* `std::io::Std{in,out,err}`
* `std::io::Std{in,out,err}Lock`
* `std::io::Std{in,out,err}Raw`

Where supported the OS implementations hook up to native support,
otherwise it falls back to the already-defaulted implementation.

5 years agoRollup merge of #59835 - lzutao:nonzero-signed, r=Mark-Simulacrum
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:39 +0000 (00:23 +0200)]
Rollup merge of #59835 - lzutao:nonzero-signed, r=Mark-Simulacrum

Re-export NonZero signed variant in std

Closes  #59834 .

5 years agoRollup merge of #59830 - ehuss:keyword-links, r=Mark-Simulacrum
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:37 +0000 (00:23 +0200)]
Rollup merge of #59830 - ehuss:keyword-links, r=Mark-Simulacrum

Fix links on keyword docs.

- Make links relative.
- Adjust links from old 2018-edition book.
- Fix broken link in `let` docs.

5 years agoRollup merge of #59818 - crlf0710:eliminate_libstd_fnbox, r=cramertj
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:35 +0000 (00:23 +0200)]
Rollup merge of #59818 - crlf0710:eliminate_libstd_fnbox, r=cramertj

Eliminate `FnBox` usages from libstd.

5 years agoRollup merge of #59804 - Zoxc:cleaner-jobserver, r=alexcrichton
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:34 +0000 (00:23 +0200)]
Rollup merge of #59804 - Zoxc:cleaner-jobserver, r=alexcrichton

Clean up jobserver integration

cc @alexcrichton

5 years agoRollup merge of #59796 - oli-obk:const_arg_ice, r=eddyb
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:32 +0000 (00:23 +0200)]
Rollup merge of #59796 - oli-obk:const_arg_ice, r=eddyb

Retire `IsNotConst` naming

This naming scheme caused a lot of confusion lately (including ICEs) due to misrefactored code. Also clean up the initialization code for said flag.

r? @eddyb

previous discussions: https://github.com/rust-lang/rust/pull/58784#issuecomment-468717439 https://github.com/rust-lang/rust/pull/58403#discussion_r265936336

5 years agoRollup merge of #59747 - gruberb:copy-book-toml-unstable-book, r=ehuss
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:30 +0000 (00:23 +0200)]
Rollup merge of #59747 - gruberb:copy-book-toml-unstable-book, r=ehuss

Copy book.toml unstable book generator

Solves https://github.com/rust-lang/rust/issues/59554 and adds a book title to the unstable book.

I assume that [copy_recursive](https://github.com/rust-lang/rust/blob/acd8dd6a50d505057a7d7ad8d0d7a4c2bd274200/src/tools/unstable-book-gen/src/main.rs#L105) will take files regardless of their type (`.md` or `.toml`).

Although I had a hard time time testing it. A second pair of eyes is definitely needed.

5 years agoRollup merge of #59735 - matklad:deadcode, r=sanxiyn
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:29 +0000 (00:23 +0200)]
Rollup merge of #59735 - matklad:deadcode, r=sanxiyn

remove lookup_char_pos_adj

It is now exactly equivalent to lookup_char_pos.

5 years agoRollup merge of #59708 - matthewjasper:double-closure-unused-mut, r=pnkfelix
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:27 +0000 (00:23 +0200)]
Rollup merge of #59708 - matthewjasper:double-closure-unused-mut, r=pnkfelix

Mark variables captured by reference as mutable correctly

Closes #59620

r? @pnkfelix

5 years agoRollup merge of #59675 - SimonSapin:stable-alloc, r=alexcrichton
Mazdak Farrokhzad [Sat, 13 Apr 2019 22:23:25 +0000 (00:23 +0200)]
Rollup merge of #59675 - SimonSapin:stable-alloc, r=alexcrichton

Stabilize the `alloc` crate.

This implements RFC 2480:

* https://github.com/rust-lang/rfcs/pull/2480
* https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md

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

5 years agoExpand note on mutable references
Chris Gregory [Sat, 13 Apr 2019 20:54:57 +0000 (15:54 -0500)]
Expand note on mutable references

5 years agoAuto merge of #59612 - matthewjasper:dataflow-usual-newtype-index, r=estebank
bors [Sat, 13 Apr 2019 16:42:51 +0000 (16:42 +0000)]
Auto merge of #59612 - matthewjasper:dataflow-usual-newtype-index, r=estebank

Use normal newtype_index macro for MIR dataflows

* Makes the definition of these structs contain `struct IndexName`
* Avoids having an offset by removing high values, rather than 0
* Implements some traits for us.

5 years agoAuto merge of #59515 - wesleywiser:measureme, r=michaelwoerister
bors [Sat, 13 Apr 2019 11:54:26 +0000 (11:54 +0000)]
Auto merge of #59515 - wesleywiser:measureme, r=michaelwoerister

Use measureme in self profiler

r? @michaelwoerister

~Changes are still very rough.~

~I'm not sure what the right way to add the `measureme` dependency is. Currently it's just added with a relative path which Works On My Machine ™️.~

I'm also not sure what to do with the category data.

5 years agoAuto merge of #59922 - Centril:rollup-0qmx4jg, r=Centril
bors [Sat, 13 Apr 2019 07:48:01 +0000 (07:48 +0000)]
Auto merge of #59922 - Centril:rollup-0qmx4jg, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #59781 (Remove check_match from const_eval)
 - #59820 (proc_macro: stop using LEB128 for RPC.)
 - #59846 (clarify what the item is in "not a module" error)
 - #59847 (Error when using `catch` after `try`)
 - #59859 (Suggest removing `?` to resolve type errors.)
 - #59862 (Tweak unstable diagnostic output)
 - #59866 (Recover from missing semicolon based on the found token)
 - #59892 (Impl RawFd conversion traits for WASI TcpListener, TcpStream and UdpSocket)

Failed merges:

r? @ghost

5 years agoUse measureme in self-profiler
Wesley Wiser [Thu, 4 Apr 2019 23:41:49 +0000 (19:41 -0400)]
Use measureme in self-profiler

Related to #58372
Related to #58967

5 years agoExclude some copies of old book editions from search engines
Kornel [Fri, 12 Apr 2019 23:38:46 +0000 (00:38 +0100)]
Exclude some copies of old book editions from search engines

5 years agoAuto merge of #59924 - Xanewok:subup, r=Xanewok
bors [Fri, 12 Apr 2019 21:08:14 +0000 (21:08 +0000)]
Auto merge of #59924 - Xanewok:subup, r=Xanewok

Update submodules (Clippy, RLS)

Basically https://github.com/rust-lang/rust/pull/59916 with one fix applied to make it build

5 years agoAdd test and fix dedup
Esteban Küber [Fri, 12 Apr 2019 18:42:52 +0000 (11:42 -0700)]
Add test and fix dedup

5 years agoFix paste error in split_ascii_whitespace docs.
Scott Olson [Fri, 12 Apr 2019 19:57:42 +0000 (13:57 -0600)]
Fix paste error in split_ascii_whitespace docs.

5 years agoUpdate rls
flip1995 [Fri, 12 Apr 2019 13:50:41 +0000 (15:50 +0200)]
Update rls

5 years agoUpdate Clippy
flip1995 [Fri, 12 Apr 2019 13:49:59 +0000 (15:49 +0200)]
Update Clippy

5 years agoRollup merge of #59892 - rylev:as-raw-fd, r=alexcrichton
Mazdak Farrokhzad [Fri, 12 Apr 2019 18:36:18 +0000 (20:36 +0200)]
Rollup merge of #59892 - rylev:as-raw-fd, r=alexcrichton

Impl RawFd conversion traits for WASI TcpListener, TcpStream and UdpSocket

r? @alexcrichton

5 years agoRollup merge of #59866 - estebank:recover-missing-semi, r=petrochenkov
Mazdak Farrokhzad [Fri, 12 Apr 2019 18:36:16 +0000 (20:36 +0200)]
Rollup merge of #59866 - estebank:recover-missing-semi, r=petrochenkov

Recover from missing semicolon based on the found token

When encountering one of a few keywords when a semicolon was
expected, suggest the semicolon and recover:

```
error: expected one of `.`, `;`, `?`, or an operator, found `let`
  --> $DIR/recover-missing-semi.rs:4:5
   |
LL |     let _: usize = ()
   |                      - help: missing semicolon here
LL |
LL |     let _ = 3;
   |     ^^^

error[E0308]: mismatched types
  --> $DIR/recover-missing-semi.rs:2:20
   |
LL |     let _: usize = ()
   |                    ^^ expected usize, found ()
   |
   = note: expected type `usize`
              found type `()`
```

5 years agoRollup merge of #59862 - estebank:tweak-unstable-diag, r=petrochenkov
Mazdak Farrokhzad [Fri, 12 Apr 2019 18:36:15 +0000 (20:36 +0200)]
Rollup merge of #59862 - estebank:tweak-unstable-diag, r=petrochenkov

Tweak unstable diagnostic output

5 years agoRollup merge of #59859 - davidtwco:issue-59756, r=cramertj
Mazdak Farrokhzad [Fri, 12 Apr 2019 18:36:13 +0000 (20:36 +0200)]
Rollup merge of #59859 - davidtwco:issue-59756, r=cramertj

Suggest removing `?` to resolve type errors.

Fixes #59756.

5 years agoRollup merge of #59847 - Kampfkarren:try-block-catch, r=estebank
Mazdak Farrokhzad [Fri, 12 Apr 2019 18:36:11 +0000 (20:36 +0200)]
Rollup merge of #59847 - Kampfkarren:try-block-catch, r=estebank

Error when using `catch` after `try`

Part of https://github.com/rust-lang/rust/issues/31436

5 years agoRollup merge of #59846 - euclio:not-a-module, r=davidtwco
Mazdak Farrokhzad [Fri, 12 Apr 2019 18:36:09 +0000 (20:36 +0200)]
Rollup merge of #59846 - euclio:not-a-module, r=davidtwco

clarify what the item is in "not a module" error

The motivation here was that I was trying to import an associated constant when I thought it was an enum variant, and got confused by this error.

Ideally I would like to add a note saying that associated constants, types, and methods cannot be imported, but I'm not sure that the associated items for a `Def` can be checked at resolve time.

5 years agoRollup merge of #59820 - eddyb:proc-macro-rpc-opt, r=nnethercote
Mazdak Farrokhzad [Fri, 12 Apr 2019 18:36:07 +0000 (20:36 +0200)]
Rollup merge of #59820 - eddyb:proc-macro-rpc-opt, r=nnethercote

proc_macro: stop using LEB128 for RPC.

I'm not sure how much of an improvement this creates, it's pretty tricky to measure.

5 years agoRollup merge of #59781 - whitfin:issue-59378, r=oli-obk
Mazdak Farrokhzad [Fri, 12 Apr 2019 18:36:05 +0000 (20:36 +0200)]
Rollup merge of #59781 - whitfin:issue-59378, r=oli-obk

Remove check_match from const_eval

This fixes #59378.

It seems that the `check_match` may be unnecessary, so this removes it per instructions provided in the issue. I re-ran the tests for `librustc_mir` and everything seemed fine!

5 years agoStabilize the `alloc` crate.
Simon Sapin [Wed, 3 Apr 2019 17:50:28 +0000 (19:50 +0200)]
Stabilize the `alloc` crate.

This implements RFC 2480:

* https://github.com/rust-lang/rfcs/pull/2480
* https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md

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

5 years agoApply resource-suffix to search-index and source-files scripts as well
Guillaume Gomez [Sun, 7 Apr 2019 16:09:28 +0000 (18:09 +0200)]
Apply resource-suffix to search-index and source-files scripts as well

5 years agoAuto merge of #59733 - cramertj:wake-by-ref, r=withoutboats
bors [Fri, 12 Apr 2019 17:24:01 +0000 (17:24 +0000)]
Auto merge of #59733 - cramertj:wake-by-ref, r=withoutboats

Final (one can only hope) futures_api adjustments

Based on https://github.com/rust-lang/rust/pull/59119 -- this change is only the latter two commits.
cc https://github.com/rust-lang/rust/issues/59725

r? @withoutboats

5 years agoDon't generate empty json variables
Guillaume Gomez [Thu, 11 Apr 2019 20:48:53 +0000 (22:48 +0200)]
Don't generate empty json variables

5 years agoadd the logic for when other_ty is FnDef
rchaser53 [Fri, 12 Apr 2019 13:59:30 +0000 (22:59 +0900)]
add the logic for when other_ty is FnDef

5 years agoAuto merge of #59651 - tmandry:discr-index, r=eddyb
bors [Fri, 12 Apr 2019 14:38:15 +0000 (14:38 +0000)]
Auto merge of #59651 - tmandry:discr-index, r=eddyb

 Add discr_index to multi-variant layouts

We remove the assumption that the discriminant is always field 0, in
preparations for layouts like generators where this is not (always) going to be
the case.

Specifically, upvars are going to go before the discriminant. In theory, it's possible to remove _that_ assumption instead and keep the discriminant at field index 0, but one assumption or the other had to go :)

There is one place I know of in the debuginfo code where we'll still need to remove assumptions that the discriminant is the _only_ field. I was planning on doing this along with the upcoming generator change, which will also include tests that exercise the code changing in this PR.

r? @eddyb
cc @oli-obk
cc @cramertj

5 years agoAuto merge of #59910 - Centril:rollup-yjv7b06, r=Centril
bors [Fri, 12 Apr 2019 11:46:01 +0000 (11:46 +0000)]
Auto merge of #59910 - Centril:rollup-yjv7b06, r=Centril

Rollup of 15 pull requests

Successful merges:

 - #59680 (Document the -Z flag to the rustc book)
 - #59711 (Add back the substring test)
 - #59806 (compiletest: Improve no_prefer_dynamic docs)
 - #59809 (Make trait_methods_not_found use a lock)
 - #59811 (Kill dead code dominator code.)
 - #59814 (Fix broken links on std::boxed doc page)
 - #59821 (improve unknown enum variant errors)
 - #59831 (Remove strange formatting in `Ordering` docs.)
 - #59836 (std::ops::Div examples: correct nominator to numerator)
 - #59857 (SGX target: fix cfg(test) build)
 - #59876 (Update TRPL to use mdbook 0.2)
 - #59880 (Remove note about transmute for float bitpatterns.)
 - #59889 (Update diagnostics.rs)
 - #59891 (Fix the link to sort_by_cached_key)
 - #59894 (save-analysis: Pull associated type definition using `qpath_def`)

Failed merges:

r? @ghost

5 years agoMaybeUninit: remove deprecated functions
Ralf Jung [Fri, 12 Apr 2019 10:41:17 +0000 (12:41 +0200)]
MaybeUninit: remove deprecated functions

5 years agoRevert PR #59401 to fix issue #59652 (a stable-to-beta regression).
Felix S. Klock II [Fri, 12 Apr 2019 10:30:21 +0000 (12:30 +0200)]
Revert PR #59401 to fix issue #59652 (a stable-to-beta regression).

This is result of squashing two revert commits:

Revert "compile all crates under test w/ -Zemit-stack-sizes"

This reverts commit 7d365cf27f4249fc9b61ba8abfc813abe43f1cb7.

Revert "bootstrap: build compiler-builtins with -Z emit-stack-sizes"

This reverts commit 8b8488ce8fc047282e7159343f30609417f9fa39.

5 years agoRollup merge of #59894 - Xanewok:save-assoc-ty-qpath, r=eddyb
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:18:11 +0000 (12:18 +0200)]
Rollup merge of #59894 - Xanewok:save-assoc-ty-qpath, r=eddyb

save-analysis: Pull associated type definition using `qpath_def`

Closes https://github.com/rust-lang/rls/issues/1390

This (probably?) fixes the case where we run the save-analysis code on the following snippet:
```rust
trait Test<'a> {
    type Thing: Test2;
}

trait Test2 {
    fn print();
}

#[allow(unused)]
fn example<T>(t: T)
    where T: for<'a> Test<'a>
{
    T::Thing::print(); //~ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
    // ^ only errors in save-analysis mode
}
```

The chain is as follows:
- culprit is `hir_ty_to_ty`
- which calls `ast_ty_to_ty` in the `ItemCtxt`
- which calls `associated_path_to_ty`
- which finally fails on `projected_ty_from_poly_trait_ref`
https://github.com/rust-lang/rust/blob/3de0106789468b211bcc3a25c09c0cf07119186d/src/librustc_typeck/collect.rs#L212-L224

I'm not exactly sure why `hir_ty_to_ty` fails - is it because it needs more setup from typeck to work correctly? I'm guessing the fix is okay since we just pull the already typeck'd data (we run save-analysis after all the analysis passes are complete) from the tables.

With this change we can 'go to def' on all segments in the `T::Thing::print()` path.

5 years agoRollup merge of #59891 - rust-lang:sort_by_cached_key, r=jonas-schievink
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:18:09 +0000 (12:18 +0200)]
Rollup merge of #59891 - rust-lang:sort_by_cached_key, r=jonas-schievink

Fix the link to sort_by_cached_key

It's a primitive slice method, not a standalone function.

5 years agoRollup merge of #59889 - andrewbanchich:minor-text-fixes, r=estebank
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:18:07 +0000 (12:18 +0200)]
Rollup merge of #59889 - andrewbanchich:minor-text-fixes, r=estebank

Update diagnostics.rs

Add `a` and other minor text improvements

5 years agoRollup merge of #59880 - solson:transmute-float, r=alexcrichton
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:18:05 +0000 (12:18 +0200)]
Rollup merge of #59880 - solson:transmute-float, r=alexcrichton

Remove note about transmute for float bitpatterns.

This particular usecase has been safely abstracted in these `std` functions: [f32::to_bits](https://doc.rust-lang.org/std/primitive.f32.html#method.to_bits), [f32::from_bits](https://doc.rust-lang.org/std/primitive.f32.html#method.from_bits), [f64::to_bits](https://doc.rust-lang.org/std/primitive.f64.html#method.to_bits), [f64::from_bits](https://doc.rust-lang.org/std/primitive.f64.html#method.from_bits). So, I think we shouldn't recommend an unnecessary use of `unsafe` here anymore.

5 years agoRollup merge of #59876 - integer32llc:update-trpl-to-mdbook-0.2, r=steveklabnik
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:18:02 +0000 (12:18 +0200)]
Rollup merge of #59876 - integer32llc:update-trpl-to-mdbook-0.2, r=steveklabnik

Update TRPL to use mdbook 0.2

I ran linkchecker locally and it passed. Let's see if I did it correctly...

5 years agoRollup merge of #59857 - jethrogb:jb/sgx-test, r=Centril
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:18:01 +0000 (12:18 +0200)]
Rollup merge of #59857 - jethrogb:jb/sgx-test, r=Centril

SGX target: fix cfg(test) build

5 years agoRollup merge of #59836 - andersk:nominator, r=Centril
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:59 +0000 (12:17 +0200)]
Rollup merge of #59836 - andersk:nominator, r=Centril

std::ops::Div examples: correct nominator to numerator

5 years agoRollup merge of #59831 - ehuss:ordering-docs, r=kennytm
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:58 +0000 (12:17 +0200)]
Rollup merge of #59831 - ehuss:ordering-docs, r=kennytm

Remove strange formatting in `Ordering` docs.

I can't really fathom what the intent of the brackets is. The [original PR](#12956) doesn't give any hints. I think it seems fine without them.

5 years agoRollup merge of #59821 - euclio:unknown-enum-variants, r=davidtwco
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:56 +0000 (12:17 +0200)]
Rollup merge of #59821 - euclio:unknown-enum-variants, r=davidtwco

improve unknown enum variant errors

Fixes #56517.

5 years agoRollup merge of #59814 - ollie27:dead_boxed_links, r=QuietMisdreavus
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:55 +0000 (12:17 +0200)]
Rollup merge of #59814 - ollie27:dead_boxed_links, r=QuietMisdreavus

Fix broken links on std::boxed doc page

r? @QuietMisdreavus

5 years agoRollup merge of #59811 - vext01:dead-dominator-code, r=oli-obk
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:54 +0000 (12:17 +0200)]
Rollup merge of #59811 - vext01:dead-dominator-code, r=oli-obk

Kill dead code dominator code.

Hi,

Whilst fiddling around in the dominator code, I found some (I think) unused code. This code *was* used at the time it was imported, but over time it seems to have become redundant.

I've tested a build up to stage 1 with no problems. Maybe the tests will turn up something though.

P.S.

There is a FIXME comment in `dominators/mod.rs`:
```
    pub fn is_dominated_by(&self, node: Node, dom: Node) -> bool {
        // FIXME -- could be optimized by using post-order-rank
        self.dominators(node).any(|n| n == dom)
    }
```

I'm not sure of the intention of this comment. The `Dominators` struct already operates over post-order rank nodes. Any ideas?

5 years agoRollup merge of #59809 - Zoxc:trait_methods_not_found, r=estebank
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:52 +0000 (12:17 +0200)]
Rollup merge of #59809 - Zoxc:trait_methods_not_found, r=estebank

Make trait_methods_not_found use a lock

r? @estebank

5 years agoRollup merge of #59806 - phansch:compiletest_docs2, r=oli-obk
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:51 +0000 (12:17 +0200)]
Rollup merge of #59806 - phansch:compiletest_docs2, r=oli-obk

compiletest: Improve no_prefer_dynamic docs

This adds some extra docs for the `no-prefer-dynamic` header.

And also a `s/must_compile_successfully/compile_pass`.

`must_compile_successfully` has been renamed to `compile_pass` at some
point in the past and this comment was still referring to the old name.

5 years agoRollup merge of #59711 - GuillaumeGomez:substring-test, r=QuietMisdreavus
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:49 +0000 (12:17 +0200)]
Rollup merge of #59711 - GuillaumeGomez:substring-test, r=QuietMisdreavus

Add back the substring test

Fixes #58331.

r? @QuietMisdreavus

5 years agoRollup merge of #59680 - DevQps:document-rustc-z-flag, r=cramertj
Mazdak Farrokhzad [Fri, 12 Apr 2019 10:17:48 +0000 (12:17 +0200)]
Rollup merge of #59680 - DevQps:document-rustc-z-flag, r=cramertj

Document the -Z flag to the rustc book

# Description

Changes:
- Added new documentation on the `-Z` flag of rustc in the command-line arguments section of the rustc book.

If I need to rephrase anything or if you have any improvements, please let me know! I deliberately did not create an exhaustive list of all options since they are likely to change over time and per toolchain version.

closes #41142

5 years agoAuto merge of #59622 - GuillaumeGomez:improve-one-char-search, r=QuietMisdreavus
bors [Fri, 12 Apr 2019 08:59:03 +0000 (08:59 +0000)]
Auto merge of #59622 - GuillaumeGomez:improve-one-char-search, r=QuietMisdreavus

Ensure that exact matches come first in rustdoc search

Fixes #59287.

cc @scottmcm

r? @QuietMisdreavus

5 years agoAdd comment that field projectin also works with mutable fields
Chris Gregory [Fri, 12 Apr 2019 06:29:30 +0000 (01:29 -0500)]
Add comment that field projectin also works with mutable fields

5 years agoAuto merge of #59536 - Zoxc:the-arena, r=eddyb
bors [Fri, 12 Apr 2019 06:10:19 +0000 (06:10 +0000)]
Auto merge of #59536 - Zoxc:the-arena, r=eddyb

Introduce an arena type which may be used to allocate a list of types with destructors

You can also specify that you want deserializers for `&'tcx [T]` and `&'tcx T` for a type in the list, which will allocate those using the arena.

Based on https://github.com/rust-lang/rust/pull/59517 and https://github.com/rust-lang/rust/pull/59533. Look at the last commit for the interesting changes.

An alternative to https://github.com/rust-lang/rust/pull/56448. cc @michaelwoerister @eddyb

r? @oli-obk

5 years agoMake BufWriter use get_mut instead of manipulating inner in Write implementation
Chris Gregory [Fri, 12 Apr 2019 04:57:29 +0000 (23:57 -0500)]
Make BufWriter use get_mut instead of manipulating inner in Write implementation

get_mut allows us to abstract over the implementation detail of inner being
optional.

5 years agoAuto merge of #59886 - mati865:musl_toolchain, r=alexcrichton
bors [Fri, 12 Apr 2019 02:24:16 +0000 (02:24 +0000)]
Auto merge of #59886 - mati865:musl_toolchain, r=alexcrichton

musl: do not compress debug section

This should be beta nominated.

Fixes https://github.com/rust-lang/rust/issues/59411 (this time for real).

Test with `DEPLOY=1 ./src/ci/docker/run.sh dist-x86_64-musl`, without `DEPLOY=1` libs are built without debuginfo.

r? @alexcrichton

5 years agoRemove [mut] syntax in pin docs
Chris Gregory [Fri, 12 Apr 2019 02:21:19 +0000 (21:21 -0500)]
Remove [mut] syntax in pin docs

5 years agoIn `-Zprint-type-size` output, sort enum variants by size.
Nicholas Nethercote [Fri, 12 Apr 2019 02:18:23 +0000 (12:18 +1000)]
In `-Zprint-type-size` output, sort enum variants by size.

It's useful to see the biggest variants first.

5 years agoAdd discr_index to multi-variant layouts
Tyler Mandry [Tue, 2 Apr 2019 22:57:50 +0000 (15:57 -0700)]
Add discr_index to multi-variant layouts

We relax the assumption that the discriminant is always field 0, in
preparations for layouts like generators where this is not going to be
the case.

5 years agodescribe_enum_variant: Reduce code duplication
Tyler Mandry [Tue, 2 Apr 2019 20:51:13 +0000 (13:51 -0700)]
describe_enum_variant: Reduce code duplication

5 years agoSwitch to multipart suggestions.
David Wood [Thu, 11 Apr 2019 23:53:32 +0000 (01:53 +0200)]
Switch to multipart suggestions.

This commit changes the suggestion so that it is split into multiple
parts in an effort to reduce the impact the applied suggestion could
have on formatting.

5 years agoImprove robustness of nested check.
David Wood [Thu, 11 Apr 2019 23:19:02 +0000 (01:19 +0200)]
Improve robustness of nested check.

This commit removes the assumption that the start of a use statement
will always be on one line with a single space - which was silly in the
first place.

5 years agoHandle edge cases.
David Wood [Sun, 7 Apr 2019 21:18:13 +0000 (23:18 +0200)]
Handle edge cases.

This commit introduces more dirty span manipulation into the compiler
in order to handle the various edge cases in moving/renaming the macro
import so it is at the root of the import.

5 years agoHandle renamed imports.
David Wood [Sun, 7 Apr 2019 18:34:21 +0000 (20:34 +0200)]
Handle renamed imports.

This commit extends the suggestion to handle imports that are aliased to
another name.

5 years agoSuggest macro import from crate root.
David Wood [Sun, 7 Apr 2019 17:56:41 +0000 (19:56 +0200)]
Suggest macro import from crate root.

This commit suggests importing a macro from the root of a crate as the
intent may have been to import a macro from the definition location that
was annotated with `#[macro_export]`.

5 years agoAuto merge of #59227 - Zoxc:fix-get, r=eddyb
bors [Thu, 11 Apr 2019 23:36:13 +0000 (23:36 +0000)]
Auto merge of #59227 - Zoxc:fix-get, r=eddyb

Fix lifetime on LocalInternedString::get function

cc @eddyb @nnethercote

5 years agoRemove duplicated redundant spans
Esteban Küber [Thu, 11 Apr 2019 23:15:48 +0000 (16:15 -0700)]
Remove duplicated redundant spans

5 years agosave-analysis: Simplify match arm for type node def
Igor Matuszewski [Thu, 11 Apr 2019 21:53:59 +0000 (23:53 +0200)]
save-analysis: Simplify match arm for type node def

5 years agoreview comments
Esteban Küber [Thu, 11 Apr 2019 21:24:31 +0000 (14:24 -0700)]
review comments

5 years agosave-analysis: use `qpath_def` for associated types
Igor Matuszewski [Thu, 11 Apr 2019 21:31:34 +0000 (23:31 +0200)]
save-analysis: use `qpath_def` for associated types

5 years agoFix ui-fulldeps test
Esteban Küber [Thu, 11 Apr 2019 21:18:38 +0000 (14:18 -0700)]
Fix ui-fulldeps test

5 years agoFix the link to sort_by_cached_key
Josh Stone [Thu, 11 Apr 2019 21:04:52 +0000 (14:04 -0700)]
Fix the link to sort_by_cached_key

It's a primitive slice method, not a standalone function.

5 years agoUpdate diagnostics.rs
Andrew Banchich [Thu, 11 Apr 2019 20:12:04 +0000 (16:12 -0400)]
Update diagnostics.rs

Add `a` and other minor text improvements