]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #61248 - spastorino:use-place-local-fn, r=oli-obk
Mazdak Farrokhzad [Tue, 28 May 2019 09:49:09 +0000 (11:49 +0200)]
Rollup merge of #61248 - spastorino:use-place-local-fn, r=oli-obk

Use Place::local

r? @oli-obk

5 years agoRollup merge of #61247 - spastorino:eval-place-iterate, r=wesleywiser
Mazdak Farrokhzad [Tue, 28 May 2019 09:49:08 +0000 (11:49 +0200)]
Rollup merge of #61247 - spastorino:eval-place-iterate, r=wesleywiser

Make eval_place iterate instead of recurse

r? @oli-obk

5 years agoRollup merge of #61242 - spastorino:dest-needs-borrow-iterate, r=oli-obk
Mazdak Farrokhzad [Tue, 28 May 2019 09:49:04 +0000 (11:49 +0200)]
Rollup merge of #61242 - spastorino:dest-needs-borrow-iterate, r=oli-obk

Make dest_needs_borrow iterate instead of recurse

r? @oli-obk

5 years agoRollup merge of #61241 - spastorino:check-place-iterative, r=oli-obk
Mazdak Farrokhzad [Tue, 28 May 2019 09:49:02 +0000 (11:49 +0200)]
Rollup merge of #61241 - spastorino:check-place-iterative, r=oli-obk

Check place iterative

r? @oli-obk

5 years agoRollup merge of #61237 - DevQps:expand-iterator-docs, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 28 May 2019 09:49:00 +0000 (11:49 +0200)]
Rollup merge of #61237 - DevQps:expand-iterator-docs, r=Mark-Simulacrum

Updated the Iterator docs with information about overriding methods.

# Description

Updated the Iterator docs with information about overriding methods.

closes #60223

5 years agoRollup merge of #61230 - matklad:ub-comment, r=RalfJung
Mazdak Farrokhzad [Tue, 28 May 2019 09:48:58 +0000 (11:48 +0200)]
Rollup merge of #61230 - matklad:ub-comment, r=RalfJung

avoid creating Boxes of uninitalized values in RawVec

`RawVec<bool>::into_box` is definitely instant UB, if not all values are initialized.

See https://gankro.github.io/blah/initialize-me-maybe/

5 years agoRollup merge of #61227 - diwic:patch-2, r=Centril
Mazdak Farrokhzad [Tue, 28 May 2019 09:48:56 +0000 (11:48 +0200)]
Rollup merge of #61227 - diwic:patch-2, r=Centril

Use .await syntax instead of await!

Tiny doc fix.

5 years agoRollup merge of #61220 - imbrem:error_explanations, r=estebank
Mazdak Farrokhzad [Tue, 28 May 2019 09:48:55 +0000 (11:48 +0200)]
Rollup merge of #61220 - imbrem:error_explanations, r=estebank

Added error message for E0284

Work on #61137

5 years agoRollup merge of #61084 - blkerby:unreachable_doc, r=KodrAus
Mazdak Farrokhzad [Tue, 28 May 2019 09:48:53 +0000 (11:48 +0200)]
Rollup merge of #61084 - blkerby:unreachable_doc, r=KodrAus

Clarify docs for unreachable! macro

Fixes #60754.

5 years agoAuto merge of #60955 - agnxy:rename-assoc, r=oli-obk,Centril
bors [Tue, 28 May 2019 05:28:13 +0000 (05:28 +0000)]
Auto merge of #60955 - agnxy:rename-assoc, r=oli-obk,Centril

Rename "Associated*" to "Assoc*"

This change is for #60163.

r? @oli-obk

5 years agoAuto merge of #61036 - michaelwoerister:pgo-xlto-test, r=alexcrichton
bors [Tue, 28 May 2019 01:56:44 +0000 (01:56 +0000)]
Auto merge of #61036 - michaelwoerister:pgo-xlto-test, r=alexcrichton

PGO - Add a smoketest for combining PGO with cross-language LTO.

This PR

- Adds a test making sure that PGO can be combined with cross-language LTO.
- Does a little cleanup on how the `pgo-use` flag is handled internally.
- Makes the compiler error if the `pgo-use` file given to `rustc` doesn't actually exist. LLVM only gives a warning and then just doesn't do PGO. Clang, on the other hand, does give an error in this case.
- Makes the build system also build `compiler-rt` when building LLDB. This way the Clang compiler that we get from building LLDB can perform PGO, which is something that the new test case wants to do. CI compile times shouldn't be affected too much.

5 years agoIncorporated suggested changes
Jad Ghalayini [Mon, 27 May 2019 23:37:20 +0000 (19:37 -0400)]
Incorporated suggested changes

5 years agoAuto merge of #61078 - pietroalbini:nightly-next, r=Centril
bors [Mon, 27 May 2019 23:04:54 +0000 (23:04 +0000)]
Auto merge of #61078 - pietroalbini:nightly-next, r=Centril

Bump nightly to 1.37.0

r? @Mark-Simulacrum

5 years agoUse Place::local
Santiago Pastorino [Mon, 27 May 2019 21:03:38 +0000 (23:03 +0200)]
Use Place::local

5 years agoMake eval_place iterate instead of recurse
Santiago Pastorino [Mon, 27 May 2019 20:47:30 +0000 (22:47 +0200)]
Make eval_place iterate instead of recurse

5 years agoMake check_place iterate instead of recurse
Santiago Pastorino [Mon, 27 May 2019 19:47:24 +0000 (21:47 +0200)]
Make check_place iterate instead of recurse

5 years agoMake dest_needs_borrow iterate instead of recurse
Santiago Pastorino [Mon, 27 May 2019 20:00:44 +0000 (22:00 +0200)]
Make dest_needs_borrow iterate instead of recurse

5 years agoAuto merge of #61140 - estebank:attr-diagnostics, r=michaelwoerister
bors [Mon, 27 May 2019 20:12:14 +0000 (20:12 +0000)]
Auto merge of #61140 - estebank:attr-diagnostics, r=michaelwoerister

Reword malformed attribute input diagnostics

- Handle empty `cfg_attr` attribute
- Reword empty `derive` attribute error
- Use consistend error message: "malformed `attrname` attribute input"
- Provide suggestions when possible
- Move note/help to label/suggestion
- Use consistent wording "ill-formed" -> "malformed"
- Move diagnostic logic out of parser

Split up from https://github.com/rust-lang/rust/pull/61026, where there's prior conversation.

5 years agoRemove unused tcx and mir params
Santiago Pastorino [Mon, 27 May 2019 19:40:22 +0000 (21:40 +0200)]
Remove unused tcx and mir params

5 years agoUpdate src/liballoc/boxed.rs
Aleksey Kladov [Mon, 27 May 2019 19:42:50 +0000 (22:42 +0300)]
Update src/liballoc/boxed.rs

Co-Authored-By: Ralf Jung <post@ralfj.de>
5 years agomake Box<str>::clone simpler & safer
Aleksey Kladov [Mon, 27 May 2019 06:43:20 +0000 (09:43 +0300)]
make Box<str>::clone simpler & safer

5 years agoAuto merge of #60827 - oli-obk:late_symbol, r=nnethercote
bors [Mon, 27 May 2019 15:36:32 +0000 (15:36 +0000)]
Auto merge of #60827 - oli-obk:late_symbol, r=nnethercote

Use `Symbol` more in lint APIs

r? @nnethercote

This will cause clippy breakage, but super trivial to fix since we can then remove the hacky `match_def_path` function that I added and go back to calling rustc's `match_def_path` method.

5 years agoOnly build clang_rt when RUSTBUILD_FORCE_CLANG_BASED_TESTS is set.
Michael Woerister [Mon, 27 May 2019 13:09:26 +0000 (15:09 +0200)]
Only build clang_rt when RUSTBUILD_FORCE_CLANG_BASED_TESTS is set.

5 years agoUpdated the Iterator docs with information about overriding methods.
Christian [Mon, 27 May 2019 14:17:39 +0000 (16:17 +0200)]
Updated the Iterator docs with information about overriding methods.

5 years agoAuto merge of #59627 - LooMaclin:issue_57128_improve_miri_error_reporting_in_check_in...
bors [Mon, 27 May 2019 12:46:12 +0000 (12:46 +0000)]
Auto merge of #59627 - LooMaclin:issue_57128_improve_miri_error_reporting_in_check_in_alloc, r=RalfJung

Improve miri error reporting in check_in_alloc

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

r? @RalfJung @oli-obk

5 years agoFix unit test after pgo-use change.
Michael Woerister [Wed, 22 May 2019 13:41:56 +0000 (15:41 +0200)]
Fix unit test after pgo-use change.

5 years agoAdd a smoketest for combining PGO with xLTO.
Michael Woerister [Mon, 20 May 2019 09:43:38 +0000 (11:43 +0200)]
Add a smoketest for combining PGO with xLTO.

5 years agorustbuild: Also build compiler-rt when building LLDB. This allows clang-based run...
Michael Woerister [Wed, 22 May 2019 11:01:12 +0000 (13:01 +0200)]
rustbuild: Also build compiler-rt when building LLDB. This allows clang-based run-make tests to use PGO.

5 years agoPGO: Check that pgo-use file actually exists. LLVM seems to only emit an easy-to...
Michael Woerister [Wed, 22 May 2019 11:00:09 +0000 (13:00 +0200)]
PGO: Check that pgo-use file actually exists. LLVM seems to only emit an easy-to-overlook warning otherwise.

5 years agoUse a PathBuf instead of String for representing the pgo-use path internally.
Michael Woerister [Wed, 22 May 2019 10:58:56 +0000 (12:58 +0200)]
Use a PathBuf instead of String for representing the pgo-use path internally.

5 years agoUse `Symbol` more in lint APIs
Oliver Scherer [Tue, 14 May 2019 13:58:22 +0000 (15:58 +0200)]
Use `Symbol` more in lint APIs

5 years agoAuto merge of #60967 - Zoxc:fix-syntax-sync, r=michaelwoerister
bors [Mon, 27 May 2019 09:49:18 +0000 (09:49 +0000)]
Auto merge of #60967 - Zoxc:fix-syntax-sync, r=michaelwoerister

Short circuit Send and Sync impls for TokenTree

Workaround to make the parallel compiler build after https://github.com/rust-lang/rust/pull/60444.

r? @nikomatsakis

5 years agoavoid materializing unintialized Boxes in RawVec
Aleksey Kladov [Mon, 27 May 2019 06:43:20 +0000 (09:43 +0300)]
avoid materializing unintialized Boxes in RawVec

5 years agoShort circuit Send and Sync impls for TokenTree
John Kåre Alsaker [Sun, 19 May 2019 18:44:06 +0000 (20:44 +0200)]
Short circuit Send and Sync impls for TokenTree

5 years agoAuto merge of #61035 - nnethercote:avoid-more-symbol-interning, r=petrochenkov
bors [Mon, 27 May 2019 06:53:53 +0000 (06:53 +0000)]
Auto merge of #61035 - nnethercote:avoid-more-symbol-interning, r=petrochenkov

Avoid more symbol interning

r? @petrochenkov

5 years agoUse .await syntax instead of await!
diwic [Mon, 27 May 2019 05:27:13 +0000 (07:27 +0200)]
Use .await syntax instead of await!

5 years agoUse `Symbol` equality in `may_begin_with` and `parse_nt`.
Nicholas Nethercote [Thu, 23 May 2019 06:23:11 +0000 (16:23 +1000)]
Use `Symbol` equality in `may_begin_with` and `parse_nt`.

5 years agoUse `Symbol` equality in `check_ident_token`.
Nicholas Nethercote [Thu, 23 May 2019 06:11:52 +0000 (16:11 +1000)]
Use `Symbol` equality in `check_ident_token`.

5 years agoUse `Symbol` equality in `is_ident_named`.
Nicholas Nethercote [Thu, 23 May 2019 05:31:43 +0000 (15:31 +1000)]
Use `Symbol` equality in `is_ident_named`.

5 years agoAvoid some re-interning in `to_lit_token`.
Nicholas Nethercote [Thu, 23 May 2019 02:34:38 +0000 (12:34 +1000)]
Avoid some re-interning in `to_lit_token`.

5 years agoAdd `to_symbol` methods.
Nicholas Nethercote [Thu, 23 May 2019 02:22:43 +0000 (12:22 +1000)]
Add `to_symbol` methods.

5 years agoAuto merge of #61215 - paoloteti:armebv7r, r=alexcrichton
bors [Mon, 27 May 2019 03:58:56 +0000 (03:58 +0000)]
Auto merge of #61215 - paoloteti:armebv7r, r=alexcrichton

Docker: remove environment variable `CC_armebv7r_none_eabi`

`cc-rs` take care of selecting the tool-chain, so this `ENV` variable can be safely removed.

5 years agoPre-intern "0", "1", ..., "9", and use where appropriate.
Nicholas Nethercote [Wed, 22 May 2019 09:25:39 +0000 (19:25 +1000)]
Pre-intern "0", "1", ..., "9", and use where appropriate.

5 years agoPass symbols to `ExtCtxt::std_path` instead of strings.
Nicholas Nethercote [Wed, 22 May 2019 04:41:15 +0000 (14:41 +1000)]
Pass symbols to `ExtCtxt::std_path` instead of strings.

Because this function is hot.

Also remove the dead `ty_option` function.

5 years agoAvoid unnecessary internings.
Nicholas Nethercote [Wed, 22 May 2019 02:42:23 +0000 (12:42 +1000)]
Avoid unnecessary internings.

Most involving `Symbol::intern` on string literals.

5 years agoAvoid interning in `resolve_place_op`.
Nicholas Nethercote [Wed, 22 May 2019 00:15:32 +0000 (10:15 +1000)]
Avoid interning in `resolve_place_op`.

This function is hot for `keccak`.

5 years agoAuto merge of #61147 - estebank:suggest-as-ref, r=oli-obk
bors [Mon, 27 May 2019 01:10:22 +0000 (01:10 +0000)]
Auto merge of #61147 - estebank:suggest-as-ref, r=oli-obk

When encountering move error on an `Option`, suggest using `as_ref`

Fix #61109, cc #15457.

5 years agoAuto merge of #61214 - oli-obk:clippy, r=Manishearth
bors [Sun, 26 May 2019 21:38:04 +0000 (21:38 +0000)]
Auto merge of #61214 - oli-obk:clippy, r=Manishearth

Update clippy submodule

r? @Manishearth

5 years agoAdded error message for E0284
Jad Ghalayini [Sun, 26 May 2019 20:48:02 +0000 (16:48 -0400)]
Added error message for E0284

5 years agoAuto merge of #61213 - pietroalbini:fix-azure-multiple-checkouts, r=alexcrichton
bors [Sun, 26 May 2019 18:48:12 +0000 (18:48 +0000)]
Auto merge of #61213 - pietroalbini:fix-azure-multiple-checkouts, r=alexcrichton

azure: fix multiple checkouts on azure

We were checking out the rustc repo multiple times on auto macOS, and
that was causing an error on the Azure side since multiple checkouts are
apparently not supported. This removes the extra checkout.

r? @alexcrichton
fixes #61170

5 years agoDocker: remove environment variable `CC_armebv7r_none_eabi`
Paolo Teti [Sun, 26 May 2019 17:31:40 +0000 (19:31 +0200)]
Docker: remove environment variable `CC_armebv7r_none_eabi`

`cc-rs` take care of selecting the tool-chain, so this ENV variable
can be safely removed.

5 years agoUpdate cargo lockfile
Oliver Scherer [Sun, 26 May 2019 17:21:54 +0000 (19:21 +0200)]
Update cargo lockfile

5 years agoUpdate clippy submodule
Oliver Scherer [Sun, 26 May 2019 16:59:51 +0000 (18:59 +0200)]
Update clippy submodule

5 years agoci: increase timeout on the auto branch in azure
Pietro Albini [Sun, 26 May 2019 16:35:32 +0000 (18:35 +0200)]
ci: increase timeout on the auto branch in azure

5 years agoci: fix multiple checkouts on azure
Pietro Albini [Sun, 26 May 2019 15:12:13 +0000 (17:12 +0200)]
ci: fix multiple checkouts on azure

We were checking out the rustc repo multiple times on auto macOS, and
that was causing an error on the Azure side since multiple checkouts are
apparently not supported. This removes the extra checkout.

5 years agoAuto merge of #61210 - Centril:rollup-ofr6h5b, r=Centril
bors [Sun, 26 May 2019 12:24:25 +0000 (12:24 +0000)]
Auto merge of #61210 - Centril:rollup-ofr6h5b, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #61077 (Don't arena-allocate static symbols.)
 - #61102 (Move path for iterate)
 - #61120 (Make eval_place iterate instead of recurse)
 - #61205 (docs: fix typo #61197)

Failed merges:

r? @ghost

5 years agoImprove miri's error reporting in check_in_alloc
Rust [Sun, 26 May 2019 11:44:58 +0000 (14:44 +0300)]
Improve miri's error reporting in check_in_alloc

Co-Authored-By: Ralf Jung <post@ralfj.de>
5 years agoRollup merge of #61205 - airt:docs-fix-typo-#61197, r=Centril
Mazdak Farrokhzad [Sun, 26 May 2019 11:37:59 +0000 (13:37 +0200)]
Rollup merge of #61205 - airt:docs-fix-typo-#61197, r=Centril

docs: fix typo #61197

Fixes #61197

Change `#[doc(inline)}` to `#[doc(inline)]` in the [#[doc]](https://doc.rust-lang.org/rustdoc/the-doc-attribute.html) documentation.

5 years agoRollup merge of #61120 - spastorino:eval-place-iterate, r=oli-obk
Mazdak Farrokhzad [Sun, 26 May 2019 11:37:57 +0000 (13:37 +0200)]
Rollup merge of #61120 - spastorino:eval-place-iterate, r=oli-obk

Make eval_place iterate instead of recurse

r? @oli-obk

5 years agoRollup merge of #61102 - spastorino:move-path-for-iterate, r=oli-obk
Mazdak Farrokhzad [Sun, 26 May 2019 11:37:56 +0000 (13:37 +0200)]
Rollup merge of #61102 - spastorino:move-path-for-iterate, r=oli-obk

Move path for iterate

r? @oli-obk

5 years agoRollup merge of #61077 - nnethercote:tweak-prefill, r=petrochenkov
Mazdak Farrokhzad [Sun, 26 May 2019 11:37:55 +0000 (13:37 +0200)]
Rollup merge of #61077 - nnethercote:tweak-prefill, r=petrochenkov

Don't arena-allocate static symbols.

It's just a waste of memory. This also gets rid of the special case for
"".

r? @petrochenkov

5 years agoImprove miri's error reporting in check_in_alloc
loomaclin [Sun, 26 May 2019 10:26:24 +0000 (13:26 +0300)]
Improve miri's error reporting in check_in_alloc

5 years agoRename "Associated*" to "Assoc*"
Andrew Xu [Sun, 26 May 2019 03:23:50 +0000 (11:23 +0800)]
Rename "Associated*" to "Assoc*"

modify pretty.rs which recently added "Associated*"

5 years agoRename "Associated*" to "Assoc*"
Andrew Xu [Sun, 19 May 2019 08:26:08 +0000 (16:26 +0800)]
Rename "Associated*" to "Assoc*"

We are going to uniform the terminology of all associated items.
Methods that may or may not have `self` are called "associated
functions". Because `AssociatedFn` is a bit long, we rename `Associated`
to `Assoc`.

5 years agoAuto merge of #61080 - mati865:mingw_pgo, r=sanxiyn
bors [Sun, 26 May 2019 09:40:11 +0000 (09:40 +0000)]
Auto merge of #61080 - mati865:mingw_pgo, r=sanxiyn

Ship profiler with windows-gnu

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

I don't know if we can enable it for testing, windows-gnu jobs are already taking too long: https://github.com/rust-lang/rust/issues/59637.

r? @michaelwoerister

P.S.
I have tested only x86_64 build.

5 years agoAuto merge of #61201 - Centril:rollup-975knrk, r=Centril
bors [Sun, 26 May 2019 06:09:08 +0000 (06:09 +0000)]
Auto merge of #61201 - Centril:rollup-975knrk, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #61087 (Tweak `self` arg not as first argument of a method diagnostic)
 - #61114 (Vec: avoid creating slices to the elements)
 - #61144 (Suggest borrowing for loop head on move error)
 - #61149 (Fix spelling in release notes)
 - #61161 (MaybeUninit doctest: remove unnecessary type ascription)
 - #61173 (Auto-derive Encode and Decode implementations of DefPathTable)
 - #61184 (Add additional trace statements to the const propagator)
 - #61189 (Turn turbo 🐟 🍨 into an error)
 - #61193 (Add comment to explain why we change the layout for Projection)

Failed merges:

r? @ghost

5 years agodocs: fix typo #61197
airt [Sun, 26 May 2019 04:17:33 +0000 (12:17 +0800)]
docs: fix typo #61197

5 years agoAuto merge of #60852 - alexcrichton:std-backtrace, r=sfackler
bors [Sun, 26 May 2019 03:26:10 +0000 (03:26 +0000)]
Auto merge of #60852 - alexcrichton:std-backtrace, r=sfackler

std: Depend on `backtrace` crate from crates.io

This commit removes all in-tree support for generating backtraces in
favor of depending on the `backtrace` crate on crates.io. This resolves
a very longstanding piece of duplication where the standard library has
long contained the ability to generate a backtrace on panics, but the
code was later extracted and duplicated on crates.io with the
`backtrace` crate. Since that fork each implementation has seen various
improvements one way or another, but typically `backtrace`-the-crate has
lagged behind libstd in one way or another.

The goal here is to remove this duplication of a fairly critical piece
of code and ensure that there's only one source of truth for generating
backtraces between the standard library and the crate on crates.io.
Recently I've been working to bring the `backtrace` crate on crates.io
up to speed with the support in the standard library which includes:

* Support for `StackWalkEx` on MSVC to recover inline frames with
  debuginfo.
* Using `libbacktrace` by default on MinGW targets.
* Supporting `libbacktrace` on OSX as an option.
* Ensuring all the requisite support in `backtrace`-the-crate compiles
  with `#![no_std]`.
* Updating the `libbacktrace` implementation in `backtrace`-the-crate to
  initialize the global state with the correct filename where necessary.

After reviewing the code in libstd the `backtrace` crate should be at
exact feature parity with libstd today. The backtraces generated should
have the same symbols and same number of frames in general, and there's
not known divergence from libstd currently.

Note that one major difference between libstd's backtrace support and
the `backtrace` crate is that on OSX the crates.io crate enables the
`coresymbolication` feature by default. This feature, however, uses
private internal APIs that aren't published for OSX. While they provide
more accurate backtraces this isn't appropriate for libstd distributed
as a binary, so libstd's dependency on the `backtrace` crate explicitly
disables this feature and forces OSX to use `libbacktrace` as a
symbolication strategy.

The long-term goal of this refactoring is to eventually move us towards
a world where we can drop `libbacktrace` entirely and simply use Gimli
and the surrounding crates for backtrace support. That's still aways off
but hopefully will much more easily enabled by having the source of
truth for backtraces live in crates.io!

Procedurally if we go forward with this I'd like to transfer the
`backtrace-rs` crate to the rust-lang GitHub organization as well, but I
figured I'd hold off on that until we get closer to merging.

5 years agoRollup merge of #61193 - spastorino:add-comment, r=RalfJung
Mazdak Farrokhzad [Sun, 26 May 2019 00:13:35 +0000 (02:13 +0200)]
Rollup merge of #61193 - spastorino:add-comment, r=RalfJung

Add comment to explain why we change the layout for Projection

r? @RalfJung

Addresses the comment in https://github.com/rust-lang/rust/pull/61104/files#r287556257

5 years agoRollup merge of #61189 - oli-obk:turbofish_ice, r=varkor
Mazdak Farrokhzad [Sun, 26 May 2019 00:13:33 +0000 (02:13 +0200)]
Rollup merge of #61189 - oli-obk:turbofish_ice, r=varkor

Turn turbo 🐟 🍨 into an error

Master branch part of #60989

r? @varkor

5 years agoRollup merge of #61184 - wesleywiser:const_prop_tracing, r=oli-obk
Mazdak Farrokhzad [Sun, 26 May 2019 00:13:32 +0000 (02:13 +0200)]
Rollup merge of #61184 - wesleywiser:const_prop_tracing, r=oli-obk

Add additional trace statements to the const propagator

This makes it easier to figure out when const propagation fails.

5 years agoRollup merge of #61173 - fabric-and-ink:minor-cleanup, r=varkor
Mazdak Farrokhzad [Sun, 26 May 2019 00:13:31 +0000 (02:13 +0200)]
Rollup merge of #61173 - fabric-and-ink:minor-cleanup, r=varkor

Auto-derive Encode and Decode implementations of DefPathTable

See https://github.com/rust-lang/rust/pull/60647#discussion_r283394682

5 years agoRollup merge of #61161 - RalfJung:maybe-uninit, r=Centril
Mazdak Farrokhzad [Sun, 26 May 2019 00:13:29 +0000 (02:13 +0200)]
Rollup merge of #61161 - RalfJung:maybe-uninit, r=Centril

MaybeUninit doctest: remove unnecessary type ascription

5 years agoRollup merge of #61149 - vishalsodani:master, r=Centril
Mazdak Farrokhzad [Sun, 26 May 2019 00:13:28 +0000 (02:13 +0200)]
Rollup merge of #61149 - vishalsodani:master, r=Centril

Fix spelling in release notes

5 years agoRollup merge of #61144 - estebank:issue-61108, r=matthewjasper
Mazdak Farrokhzad [Sun, 26 May 2019 00:13:27 +0000 (02:13 +0200)]
Rollup merge of #61144 - estebank:issue-61108, r=matthewjasper

Suggest borrowing for loop head on move error

Fix #61108.

5 years agoRollup merge of #61114 - RalfJung:vec, r=Gankro
Mazdak Farrokhzad [Sun, 26 May 2019 00:13:25 +0000 (02:13 +0200)]
Rollup merge of #61114 - RalfJung:vec, r=Gankro

Vec: avoid creating slices to the elements

Instead of `self.deref_mut().as_mut_ptr()` to get a raw pointer to the buffer, use `self.buf.ptr_mut()`. This (a) avoids creating a unique reference to all existing elements without any need, and (b) creates a pointer that can actually be used for the *entire* buffer, and not just for the part of it covered by `self.deref_mut()`.

I also got worried about `RawVec::ptr` returning a `*mut T` from an `&self`, so I added both a mutable and an immutable version.

Cc @Gankro in particular for the `assume` changes -- I don't know why that is not in `Unique`, but I moved it up from `Vec::deref` to `RawVec::ptr` to avoid having to repeat it everywhere.

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

5 years agoRollup merge of #61087 - estebank:parsepalooza, r=Centril
Mazdak Farrokhzad [Sun, 26 May 2019 00:13:24 +0000 (02:13 +0200)]
Rollup merge of #61087 - estebank:parsepalooza, r=Centril

Tweak `self` arg not as first argument of a method diagnostic

Mention that `self` is only valid on "associated functions"
```
error: unexpected `self` argument in function
  --> $DIR/self-in-function-arg.rs:1:15
   |
LL | fn foo(x:i32, self: i32) -> i32 { self }
   |               ^^^^ not valid as function argument
   |
   = note: `self` is only valid as the first argument of an associated function
```

When it is a method, mention it must be first
```
error: unexpected `self` argument in function
  --> $DIR/trait-fn.rs:4:20
   |
LL |     fn c(foo: u32, self) {}
   |                    ^^^^ must be the first associated function argument
```

Move a bunch of error recovery methods to `diagnostics.rs` away from `parser.rs`.

Fix #51547. CC #60015.

5 years agostd: Depend on `backtrace` crate from crates.io
Alex Crichton [Wed, 15 May 2019 14:30:15 +0000 (07:30 -0700)]
std: Depend on `backtrace` crate from crates.io

This commit removes all in-tree support for generating backtraces in
favor of depending on the `backtrace` crate on crates.io. This resolves
a very longstanding piece of duplication where the standard library has
long contained the ability to generate a backtrace on panics, but the
code was later extracted and duplicated on crates.io with the
`backtrace` crate. Since that fork each implementation has seen various
improvements one way or another, but typically `backtrace`-the-crate has
lagged behind libstd in one way or another.

The goal here is to remove this duplication of a fairly critical piece
of code and ensure that there's only one source of truth for generating
backtraces between the standard library and the crate on crates.io.
Recently I've been working to bring the `backtrace` crate on crates.io
up to speed with the support in the standard library which includes:

* Support for `StackWalkEx` on MSVC to recover inline frames with
  debuginfo.
* Using `libbacktrace` by default on MinGW targets.
* Supporting `libbacktrace` on OSX as an option.
* Ensuring all the requisite support in `backtrace`-the-crate compiles
  with `#![no_std]`.
* Updating the `libbacktrace` implementation in `backtrace`-the-crate to
  initialize the global state with the correct filename where necessary.

After reviewing the code in libstd the `backtrace` crate should be at
exact feature parity with libstd today. The backtraces generated should
have the same symbols and same number of frames in general, and there's
not known divergence from libstd currently.

Note that one major difference between libstd's backtrace support and
the `backtrace` crate is that on OSX the crates.io crate enables the
`coresymbolication` feature by default. This feature, however, uses
private internal APIs that aren't published for OSX. While they provide
more accurate backtraces this isn't appropriate for libstd distributed
as a binary, so libstd's dependency on the `backtrace` crate explicitly
disables this feature and forces OSX to use `libbacktrace` as a
symbolication strategy.

The long-term goal of this refactoring is to eventually move us towards
a world where we can drop `libbacktrace` entirely and simply use Gimli
and the surrounding crates for backtrace support. That's still aways off
but hopefully will much more easily enabled by having the source of
truth for backtraces live in crates.io!

Procedurally if we go forward with this I'd like to transfer the
`backtrace-rs` crate to the rust-lang GitHub organization as well, but I
figured I'd hold off on that until we get closer to merging.

5 years agoMake move_path_for iterate instead of recurse
Santiago Pastorino [Thu, 23 May 2019 22:52:10 +0000 (00:52 +0200)]
Make move_path_for iterate instead of recurse

5 years agoAuto merge of #56595 - ljedrz:x_py_clippy_fix, r=oli-obk
bors [Sat, 25 May 2019 22:42:12 +0000 (22:42 +0000)]
Auto merge of #56595 - ljedrz:x_py_clippy_fix, r=oli-obk

Add clippy and fix commands to x.py

Since they are kind of similar in nature, I have used the same approach as for `cargo check`. At least some of the boilerplate could probably be shared, but I'd prefer to gather some feedback before I decide to merge them more aggressively.

This works reasonably well for `clippy`; with `-A clippy::all` and some extra `#![feature(rustc_private)]`s almost the whole codebase can be processed. There are some concerns, though:
- unlike `check`, in order to be able to traverse all the crates, some of them need to be marked with the `#![feature(rustc_private)]` attribute
- `-W clippy::all` breaks on any error. Is there a way to produce errors but not have them break the progress?
- I'm not sure how to redirect the errors in a way that would show colors; for now I was able to de-jsonize and print them (something not needed for `check`)

`cargo fix` is much more stubborn; it refuses to acknowledge crates like `core` and `std`, so it doesn't progress much at all.

Since this is a bit more tricky than I have envisioned, I need some guidance:
- is this the right approach or am I doing something very wrong ^^?
- why are the extra `rustc_private` features necessary? I was hoping for the same treatment as `check`
- are changes in `clippy` and `cargo fix` needed e.g. in order to produce errors in the same manner as `check` or did I miss something?
- do we need this level of file granularity (e.g. for futureproofing) or can `check`, `clippy` and `fix` files be condensed?

Hopes-to-fix: https://github.com/rust-lang/rust/issues/53896

Cc @alexcrichton, @zackmdavis

5 years agoInline move_path_for_projection inside move_path_for
Santiago Pastorino [Thu, 23 May 2019 22:40:41 +0000 (00:40 +0200)]
Inline move_path_for_projection inside move_path_for

5 years agoMake eval_place iterate instead of recurse
Santiago Pastorino [Fri, 24 May 2019 13:38:42 +0000 (15:38 +0200)]
Make eval_place iterate instead of recurse

5 years agoAdd comment to explain why we change the layout for Projection
Santiago Pastorino [Sat, 25 May 2019 20:28:15 +0000 (22:28 +0200)]
Add comment to explain why we change the layout for Projection

5 years agoTurn ICE on type arguments on variables into an error
Oliver Scherer [Sat, 25 May 2019 19:16:27 +0000 (21:16 +0200)]
Turn ICE on type arguments on variables into an error

5 years agoreview comments: move back some methods and clean up wording
Esteban Küber [Thu, 23 May 2019 20:10:24 +0000 (13:10 -0700)]
review comments: move back some methods and clean up wording

5 years agoMove some methods to `diagnostics.rs` away from `parser.rs`
Esteban Küber [Thu, 23 May 2019 19:55:26 +0000 (12:55 -0700)]
Move some methods to `diagnostics.rs` away from `parser.rs`

Move a bunch of error recovery methods to `diagnostics.rs` away from
`parser.rs`.

5 years agoTweak `self` arg not as first argument of a method diagnostic
Esteban Küber [Thu, 23 May 2019 19:54:27 +0000 (12:54 -0700)]
Tweak `self` arg not as first argument of a method diagnostic

Mention that `self` is only valid on "associated functions"
```
error: unexpected `self` argument in function
  --> $DIR/self-in-function-arg.rs:1:15
   |
LL | fn foo(x:i32, self: i32) -> i32 { self }
   |               ^^^^ not valid as function argument
   |
   = note: `self` is only valid as the first argument of an associated function
```

When it is a method, mention it must be first
```
error: unexpected `self` argument in function
  --> $DIR/trait-fn.rs:4:20
   |
LL |     fn c(foo: u32, self) {}
   |                    ^^^^ must be the first associated function argument
```

5 years agoReword malformed attribute input diagnostics
Esteban Küber [Wed, 22 May 2019 00:47:23 +0000 (17:47 -0700)]
Reword malformed attribute input diagnostics

- Handle empty `cfg_attr` attribute
- Reword empty `derive` attribute error
- Use consistend error message: "malformed `attrname` attribute input"
- Provide suggestions when possible
- Move note/help to label/suggestion
- Use consistent wording "ill-formed" -> "malformed"
- Move diagnostic logic out of parser

5 years agoAdd support for suggesting as_ref to Result accesses
Esteban Küber [Sat, 25 May 2019 02:30:25 +0000 (19:30 -0700)]
Add support for suggesting as_ref to Result accesses

5 years agoAuto merge of #59276 - oli-obk:cleanups, r=eddyb
bors [Sat, 25 May 2019 16:08:11 +0000 (16:08 +0000)]
Auto merge of #59276 - oli-obk:cleanups, r=eddyb

Cleanup (pretty) printing of `ty::Const`

r? @eddyb

addresses https://github.com/rust-lang/rust/pull/59178/files/5cd28066214a4a255bac6655c20bf05cb95730fd#r266243236 and https://github.com/rust-lang/rust/pull/59178/files/5cd28066214a4a255bac6655c20bf05cb95730fd#r266243336

5 years agoUpdate nll ui tests
Oliver Scherer [Sat, 25 May 2019 15:21:29 +0000 (17:21 +0200)]
Update nll ui tests

5 years agoAdd additional trace statements to the const propagator
Wesley Wiser [Sat, 25 May 2019 14:59:05 +0000 (10:59 -0400)]
Add additional trace statements to the const propagator

This makes it easier to figure out when const propagation fails.

5 years agoAdd clippy and fix commands to x.py
ljedrz [Tue, 4 Dec 2018 18:26:54 +0000 (19:26 +0100)]
Add clippy and fix commands to x.py

5 years agoAuto-derive Encode and Decode implementations
Fabian Drinck [Sat, 25 May 2019 09:40:06 +0000 (11:40 +0200)]
Auto-derive Encode and Decode implementations

5 years agoAuto merge of #61151 - Centril:rollup-5rpyhfo, r=Centril
bors [Sat, 25 May 2019 09:30:02 +0000 (09:30 +0000)]
Auto merge of #61151 - Centril:rollup-5rpyhfo, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #61092 (Make sanitize_place iterate instead of recurse)
 - #61093 (Make borrow_of_local_data iterate instead of recurse)
 - #61094 (Make find_local iterate instead of recurse)
 - #61099 (Make ignore_borrow iterate instead of recurse)
 - #61103 (Make find iterate instead of recurse)
 - #61104 (Make eval_place_to_op iterate instead of recurse)

Failed merges:

r? @ghost

5 years agoshadow as_ptr as as_mut_ptr in Vec to avoid going through Deref
Ralf Jung [Sat, 25 May 2019 08:36:07 +0000 (10:36 +0200)]
shadow as_ptr as as_mut_ptr in Vec to avoid going through Deref

5 years agoadd test checking that Vec push/pop does not invalidate pointers
Ralf Jung [Sat, 25 May 2019 08:11:00 +0000 (10:11 +0200)]
add test checking that Vec push/pop does not invalidate pointers

5 years agoFix missing tcx
varkor [Fri, 24 May 2019 19:47:39 +0000 (20:47 +0100)]
Fix missing tcx

5 years agoOnly print integers in symbol path's constants
Oliver Scherer [Sat, 11 May 2019 14:04:14 +0000 (16:04 +0200)]
Only print integers in symbol path's constants

5 years agoUpdate ui tests
Oliver Scherer [Sat, 11 May 2019 13:48:57 +0000 (15:48 +0200)]
Update ui tests