]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 `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 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 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 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

5 years agoPrint types for unevaluated constants
Oliver Scherer [Sat, 11 May 2019 13:48:47 +0000 (15:48 +0200)]
Print types for unevaluated constants

5 years agoFix rebase fallout
Oliver Scherer [Tue, 7 May 2019 15:47:52 +0000 (17:47 +0200)]
Fix rebase fallout

5 years agoBreak cycle during array length printing
Oliver Scherer [Fri, 3 May 2019 08:59:04 +0000 (10:59 +0200)]
Break cycle during array length printing

5 years agorustc: integrate ty::Const into ty::print as print_const.
Eduard-Mihai Burtescu [Mon, 18 Mar 2019 10:50:57 +0000 (12:50 +0200)]
rustc: integrate ty::Const into ty::print as print_const.

5 years agoUpdate ui tests
Oliver Scherer [Wed, 24 Apr 2019 14:12:53 +0000 (16:12 +0200)]
Update ui tests

5 years agoPrint unevaluted constants as `_` or as their source representation
Oliver Scherer [Wed, 24 Apr 2019 12:10:52 +0000 (14:10 +0200)]
Print unevaluted constants as `_` or as their source representation

5 years agoUse `write_char` to skip the formatting infrastructure
Oliver Scherer [Wed, 24 Apr 2019 12:10:31 +0000 (14:10 +0200)]
Use `write_char` to skip the formatting infrastructure

5 years agoFix tidy
Oliver Scherer [Wed, 24 Apr 2019 12:10:05 +0000 (14:10 +0200)]
Fix tidy

5 years agoPrint generic args in function calls in MIR
Oliver Scherer [Wed, 17 Apr 2019 16:19:59 +0000 (18:19 +0200)]
Print generic args in function calls in MIR

5 years agoGroup common printing code during constant pretty printing
Oliver Scherer [Wed, 17 Apr 2019 15:50:47 +0000 (17:50 +0200)]
Group common printing code during constant pretty printing

5 years agoRender unresolved anon consts like closures
Oliver Scherer [Wed, 17 Apr 2019 15:29:38 +0000 (17:29 +0200)]
Render unresolved anon consts like closures

5 years ago`u8` is printed as a number, not a character
Oliver Scherer [Mon, 15 Apr 2019 09:00:55 +0000 (11:00 +0200)]
`u8` is printed as a number, not a character

5 years agoRender const byte slices in MIR
Oliver Scherer [Thu, 11 Apr 2019 20:04:04 +0000 (22:04 +0200)]
Render const byte slices in MIR

5 years agoMake `ConstValue::Slice` solely take `[u8]` and `str`
Oliver Scherer [Thu, 11 Apr 2019 13:06:42 +0000 (15:06 +0200)]
Make `ConstValue::Slice` solely take `[u8]` and `str`

5 years agoRefactor string constant printing to prep for byte string printing
Oliver Scherer [Thu, 11 Apr 2019 09:12:47 +0000 (11:12 +0200)]
Refactor string constant printing to prep for byte string printing

5 years agoAdd test showing how byte slices are printed in MIR
Oliver Scherer [Thu, 11 Apr 2019 09:11:11 +0000 (11:11 +0200)]
Add test showing how byte slices are printed in MIR

5 years agoDon't use `ty::Const` without immediately interning
Oliver Scherer [Wed, 3 Apr 2019 13:29:31 +0000 (15:29 +0200)]
Don't use `ty::Const` without immediately interning

5 years agoPrint const chars escaped with surrounding quotes
Oliver Scherer [Tue, 2 Apr 2019 12:26:56 +0000 (14:26 +0200)]
Print const chars escaped with surrounding quotes

5 years agoMerge the string printing paths of ty::Const
Oliver Scherer [Tue, 2 Apr 2019 12:26:28 +0000 (14:26 +0200)]
Merge the string printing paths of ty::Const

5 years agoThere's a tcx in scope, don't use the tls one
Oliver Scherer [Tue, 2 Apr 2019 12:23:23 +0000 (14:23 +0200)]
There's a tcx in scope, don't use the tls one

5 years agoReuse the pretty printing architecture for printing of constants
Oliver Scherer [Fri, 29 Mar 2019 09:52:09 +0000 (10:52 +0100)]
Reuse the pretty printing architecture for printing of constants

5 years agoIgnore .vscode even if it is a symlink
Oliver Scherer [Tue, 26 Mar 2019 16:57:13 +0000 (17:57 +0100)]
Ignore .vscode even if it is a symlink

5 years agoRemove unnecessary secondary recursion
Oliver Scherer [Mon, 18 Mar 2019 13:21:41 +0000 (14:21 +0100)]
Remove unnecessary secondary recursion

5 years agoMaybeUninit doctest: remove unnecessary type ascription
Ralf Jung [Sat, 25 May 2019 07:11:20 +0000 (09:11 +0200)]
MaybeUninit doctest: remove unnecessary type ascription

5 years agoAuto merge of #61150 - Centril:rollup-wmm7qga, r=Centril
bors [Sat, 25 May 2019 04:10:07 +0000 (04:10 +0000)]
Auto merge of #61150 - Centril:rollup-wmm7qga, r=Centril

Rollup of 13 pull requests

Successful merges:

 - #61026 (Tweak macro parse errors when reaching EOF during macro call parse)
 - #61095 (Update cargo)
 - #61096 (tidy: don't short-circuit on license error)
 - #61107 (Fix a couple docs typos)
 - #61110 (Revert edition-guide toolstate override)
 - #61111 (Fixed type-alias-bounds lint doc)
 - #61113 (Deprecate `FnBox`. `Box<dyn FnOnce()>` can be called directly, since 1.35)
 - #61116 (Remove the incorrect warning from README.md)
 - #61118 (Dont ICE on an attempt to use GAT without feature gate)
 - #61121 (improve debug-printing of scalars)
 - #61125 (Updated my mailmap entry)
 - #61134 (Annotate each `reverse_bits` with `#[must_use]`)
 - #61138 (Move async/await tests to their own folder)

Failed merges:

r? @ghost

5 years agoRollup merge of #61104 - spastorino:eval-place-to-op-iterate, r=oli-obk
Mazdak Farrokhzad [Sat, 25 May 2019 02:57:38 +0000 (04:57 +0200)]
Rollup merge of #61104 - spastorino:eval-place-to-op-iterate, r=oli-obk

Make eval_place_to_op iterate instead of recurse

r? @oli-obk

5 years agoRollup merge of #61103 - spastorino:find-iterate, r=oli-obk
Mazdak Farrokhzad [Sat, 25 May 2019 02:57:37 +0000 (04:57 +0200)]
Rollup merge of #61103 - spastorino:find-iterate, r=oli-obk

Make find iterate instead of recurse

r? @oli-obk

5 years agoRollup merge of #61099 - spastorino:ignore-borrow-iterate, r=oli-obk
Mazdak Farrokhzad [Sat, 25 May 2019 02:57:36 +0000 (04:57 +0200)]
Rollup merge of #61099 - spastorino:ignore-borrow-iterate, r=oli-obk

Make ignore_borrow iterate instead of recurse

r? @oli-obk

5 years agoRollup merge of #61094 - spastorino:find-local-iterate, r=oli-obk
Mazdak Farrokhzad [Sat, 25 May 2019 02:57:34 +0000 (04:57 +0200)]
Rollup merge of #61094 - spastorino:find-local-iterate, r=oli-obk

Make find_local iterate instead of recurse

r? @oli-obk

5 years agoRollup merge of #61093 - spastorino:borrow-of-local-data-iterate, r=oli-obk
Mazdak Farrokhzad [Sat, 25 May 2019 02:57:33 +0000 (04:57 +0200)]
Rollup merge of #61093 - spastorino:borrow-of-local-data-iterate, r=oli-obk

Make borrow_of_local_data iterate instead of recurse

r? @oli-obk

5 years agoRollup merge of #61092 - spastorino:sanitize-place-iterative, r=oli-obk
Mazdak Farrokhzad [Sat, 25 May 2019 02:57:32 +0000 (04:57 +0200)]
Rollup merge of #61092 - spastorino:sanitize-place-iterative, r=oli-obk

Make sanitize_place iterate instead of recurse

r? @oli-obk

5 years agoRollup merge of #61138 - varkor:async-await-tests, r=cramertj
Mazdak Farrokhzad [Sat, 25 May 2019 02:55:45 +0000 (04:55 +0200)]
Rollup merge of #61138 - varkor:async-await-tests, r=cramertj

Move async/await tests to their own folder

This moves run-pass and ui async/await tests to their own folder `src/test/ui/async-await` and organises some into subfolders. (It does not move rustdoc tests for async/await.)

I also did some drive-by cleaning up of issues/error code tests into their own folders (which already existed). These are in separate commits, so easy to separate out if that's more desirable.

r? @cramertj

5 years agoRollup merge of #61134 - nvzqz:reverse_bits-must_use, r=varkor
Mazdak Farrokhzad [Sat, 25 May 2019 02:55:43 +0000 (04:55 +0200)]
Rollup merge of #61134 - nvzqz:reverse_bits-must_use, r=varkor

Annotate each `reverse_bits` with `#[must_use]`

Because the name sounds like an in-place mutation like `[T]::reverse(&mut self)`, it may be confused for one.

This change was requested at https://github.com/rust-lang/rust/issues/48763#issuecomment-493743741.

5 years agoRollup merge of #61125 - XAMPPRocky:master, r=jonas-schievink
Mazdak Farrokhzad [Sat, 25 May 2019 02:55:41 +0000 (04:55 +0200)]
Rollup merge of #61125 - XAMPPRocky:master, r=jonas-schievink

Updated my mailmap entry

5 years agoRollup merge of #61121 - RalfJung:miri-value-printing, r=oli-obk
Mazdak Farrokhzad [Sat, 25 May 2019 02:55:40 +0000 (04:55 +0200)]
Rollup merge of #61121 - RalfJung:miri-value-printing, r=oli-obk

improve debug-printing of scalars

* Prettier printing for `Pointer` and `Bits`.
* Don't print the `ScalarMaybeUndef(...)` around `Scalar`.

Before: `Immediate(ScalarMaybeUndef(Scalar(Ptr(Pointer { alloc_id: AllocId(3401), offset: Size { raw: 4 }, tag: Tagged(7723) }))))`
After: `Immediate(Scalar(AllocId(3401).0x4[<7723>]))`

Before: `Immediate(ScalarMaybeUndef(Scalar(Bits { size: 8, bits: 10 })))`
After: `Immediate(Scalar(0x000000000000000A))`

Before: `Immediate(ScalarMaybeUndef(Scalar(Bits { size: 1, bits: 1 })))`
After: `Immediate(Scalar(0x01))`

r? @oli-obk

5 years agoRollup merge of #61118 - pnkfelix:issue-60654-dont-ice-on-gat, r=varkor
Mazdak Farrokhzad [Sat, 25 May 2019 02:55:39 +0000 (04:55 +0200)]
Rollup merge of #61118 - pnkfelix:issue-60654-dont-ice-on-gat, r=varkor

Dont ICE on an attempt to use GAT without feature gate

Fix #60654