Commit Graph

94326 Commits

Author SHA1 Message Date
Oliver Scherer
dcd46d6b67 Don't allow using const fn arguments as "args_required_const" 2019-06-05 09:49:04 +02:00
bors
acda261de8 Auto merge of #61437 - christianpoveda:const-eval-indirects, r=wesleywiser,oli-obk
Add const-eval support for indirects

r? @wesleywiser
2019-06-04 12:37:44 +00:00
Wesley Wiser
b2536781af Whitespace fixes 2019-06-04 06:30:36 -04:00
bors
021a503309 Auto merge of #61136 - matthewjasper:cannot-move-errors, r=pnkfelix
Make cannot move errors more consistent with other borrowck errors

* Note the type of the place being moved in all cases.
* Note the place being moved from.
* Simplify the search for overloaded place operators
* Extend the note for move from overloaded deref apply to all types.
* Add a note for moves from overloaded index.
* Special case moves for closure captures.

r? @pnkfelix
2019-06-04 08:31:53 +00:00
bors
c22ce2806c Auto merge of #61510 - Centril:rollup-bvi95y2, r=Centril
Rollup of 13 pull requests

Successful merges:

 - #61135 (Fix documentation of `Rc::make_mut` regarding `rc::Weak`.)
 - #61404 (miri unsizing: fix projecting into a field of an operand)
 - #61409 (Fix an ICE with a const argument in a trait)
 - #61413 (Re-implement async fn drop order lowering )
 - #61419 (Add an unusual-conversion example to to_uppercase)
 - #61420 (Succinctify splice docs)
 - #61444 (Suggest using `as_ref` on `*const T`)
 - #61446 (On TerminatorKind::DropAndReplace still handle unused_mut correctly)
 - #61485 (azure: retry s3 upload if it fails)
 - #61489 (ci: Reenable step timings on AppVeyor)
 - #61496 (Do not panic in tidy on unbalanced parentheses in cfg's)
 - #61497 (Treat 0 as special value for codegen-units-std)
 - #61499 (Add regression test for existential type ICE #53457)

Failed merges:

r? @ghost
2019-06-04 05:37:44 +00:00
Christian Poveda
31ab573052 Add const-eval support for indirects 2019-06-03 23:53:46 -05:00
Mazdak Farrokhzad
5baa58ea5f
Rollup merge of #61499 - varkor:issue-53457, r=oli-obk
Add regression test for existential type ICE #53457

Closes #53457.
2019-06-04 04:48:31 +02:00
Mazdak Farrokhzad
5deaa0af41
Rollup merge of #61497 - Mark-Simulacrum:codegen-units-std-num-cpus, r=alexcrichton
Treat 0 as special value for codegen-units-std

Fixes #57669
2019-06-04 04:48:29 +02:00
Mazdak Farrokhzad
6ad6ef2355
Rollup merge of #61496 - Mark-Simulacrum:tidy-unbalanced-parens, r=varkor
Do not panic in tidy on unbalanced parentheses in cfg's

Fixes #60505
2019-06-04 04:48:27 +02:00
Mazdak Farrokhzad
cb2feb6460
Rollup merge of #61489 - alexcrichton:appveyor-timings, r=pietroalbini
ci: Reenable step timings on AppVeyor

This was accidentally regressed in #60777 by accident, and we've stopped
printing out step timings on AppVeyor recently reducing the ability for
us to track build times over time!
2019-06-04 04:48:25 +02:00
Mazdak Farrokhzad
31d7aa48b4
Rollup merge of #61485 - pietroalbini:retry-azure-upload, r=alexcrichton
azure: retry s3 upload if it fails

We had some cases (like [this](https://dev.azure.com/rust-lang/e71b0ddf-dd27-435a-873c-e30f86eea377/_apis/build/builds/370/logs/734) a few hours ago) when uploading to S3 fails with a network error. This retries the upload if it fails.

r? @alexcrichton
2019-06-04 04:48:23 +02:00
Mazdak Farrokhzad
f8a236394c
Rollup merge of #61446 - czipperz:nll-unused_mut, r=matthewjasper
On TerminatorKind::DropAndReplace still handle unused_mut correctly

Closes #61424

- [x] Todo add regression test
2019-06-04 04:48:21 +02:00
Mazdak Farrokhzad
28ce2b1fdb
Rollup merge of #61444 - estebank:const-pt-as-ref, r=matthewjasper
Suggest using `as_ref` on `*const T`

Fix #21596.
2019-06-04 04:48:19 +02:00
Mazdak Farrokhzad
1ae4727f3f
Rollup merge of #61420 - felixrabe:patch-2, r=dtolnay
Succinctify splice docs
2019-06-04 04:48:16 +02:00
Mazdak Farrokhzad
5d1d2992ef
Rollup merge of #61419 - scottmcm:casing-is-on-strings, r=cramertj
Add an unusual-conversion example to to_uppercase

Like how to_lowercase has ὈΔΥΣΣΕΎΣ.
2019-06-04 04:48:13 +02:00
Mazdak Farrokhzad
3a06a93f59
Rollup merge of #61413 - davidtwco:async-argument-order-in-a-sane-way, r=eddyb
Re-implement async fn drop order lowering

This PR re-implements the async fn drop order lowering changes so
that it all takes place in HIR lowering, building atop the work done by
@eddyb to refactor `Res::Upvar`.

Previously, this types involved in the lowering were constructed in
libsyntax as they had to be used during name resolution and HIR
lowering. This was awful because none of that logic should have existed
in libsyntax.

This commit also changes `ArgSource` to keep a `HirId` to the original
argument pattern rather than a cloned copy of the pattern.

Only b7aa4ed and 71fb8fa should be reviewed, any other commits
are from #61276 (though 447e336 might end up staying in this PR).

As a nice side effect, it also fixes #61187 (cc #61192).

r? @eddyb
cc @cramertj
2019-06-04 04:48:11 +02:00
Mazdak Farrokhzad
1563514196
Rollup merge of #61409 - varkor:condition-trait-param-ice, r=oli-obk
Fix an ICE with a const argument in a trait

This goes some way towards fixing https://github.com/rust-lang/rust/issues/61383 (the reduced test case is fixed).
2019-06-04 04:48:08 +02:00
Mazdak Farrokhzad
fb4652e85f
Rollup merge of #61404 - RalfJung:miri-unsize, r=oli-obk
miri unsizing: fix projecting into a field of an operand

I don't know why this open-coded an operand field projection. Probably this code predates one or more of my refactorings.

Fixes https://github.com/rust-lang/miri/issues/754

r? @oli-obk
2019-06-04 04:48:06 +02:00
Mazdak Farrokhzad
45cdc6d578
Rollup merge of #61135 - czipperz:rc-make_mut-weak-doc, r=Mark-Simulacrum
Fix documentation of `Rc::make_mut` regarding `rc::Weak`.

Closes #60961
2019-06-04 04:48:03 +02:00
bors
dc7c4aa804 Auto merge of #61467 - Manishearth:clippyup, r=Manishearth
Update clippy

r? @ghost
2019-06-04 02:42:13 +00:00
Manish Goregaokar
8704947ad2 Update clippy 2019-06-03 16:00:38 -07:00
bors
e22b7a3eef Auto merge of #59148 - lcnr:unchecked_maths, r=eddyb
add support for unchecked math

add compiler support for
```rust
/// Returns the result of an unchecked addition, resulting in
/// undefined behavior when `x + y > T::max_value()` or `x + y < T::min_value()`.
pub fn unchecked_add<T>(x: T, y: T) -> T;

/// Returns the result of an unchecked substraction, resulting in
/// undefined behavior when `x - y > T::max_value()` or `x - y < T::min_value()`.
pub fn unchecked_sub<T>(x: T, y: T) -> T;

/// Returns the result of an unchecked multiplication, resulting in
/// undefined behavior when `x * y > T::max_value()` or `x * y < T::min_value()`.
pub fn unchecked_mul<T>(x: T, y: T) -> T;
```

cc https://github.com/rust-lang/rfcs/issues/2508
2019-06-03 22:05:55 +00:00
lcnr/Bastian Kauschke
d7e0834c5f add ui tests for unchecked math 2019-06-03 21:30:25 +02:00
bors
6ffb8f53ee Auto merge of #61100 - varkor:must_use-tuple-expr, r=cramertj
Apply #[must_use] lint to components of tuples

Fixes https://github.com/rust-lang/rust/issues/61061.
2019-06-03 19:12:17 +00:00
Mark Rousskov
5ce3c8137b Treat 0 as special value for codegen-units-std
Fixes #57669
2019-06-03 12:57:29 -06:00
varkor
1c6dce8b6d Add ui/impl-trait/issues folder 2019-06-03 19:57:13 +01:00
varkor
41dd21a9bc Add a regression test for #53457 2019-06-03 19:54:28 +01:00
Mark Rousskov
242056cadf Do not panic in tidy on unbalanced parentheses in cfg's 2019-06-03 11:53:09 -06:00
varkor
de2bf3a761 Add nested must_use variant 2019-06-03 18:50:32 +01:00
varkor
81fa794af9 Specify tuple element in lint message 2019-06-03 18:19:29 +01:00
varkor
058551c4fd Add function call to test 2019-06-03 18:19:29 +01:00
varkor
3c768ade4d Fix issue with recursively encountering uninhabited type 2019-06-03 18:19:29 +01:00
varkor
e121d9671a Use precise span for must_use tuple components 2019-06-03 18:19:29 +01:00
varkor
fd36b5fd52 Add test for #[must_use] in tuples 2019-06-03 18:19:29 +01:00
varkor
bbac81a0f1 Warn for #[must_use] in tuples 2019-06-03 18:19:29 +01:00
Alex Crichton
b87bad7e36 ci: Reenable step timings on AppVeyor
This was accidentally regressed in #60777 by accident, and we've stopped
printing out step timings on AppVeyor recently reducing the ability for
us to track build times over time!
2019-06-03 07:50:03 -07:00
bors
61d286e9d0 Auto merge of #59033 - GuillaumeGomez:duplicated-bounds, r=Dylan-DPC
Fix duplicated bounds printing in rustdoc

Fixes #56331.

Once again, I couldn't find out how to reproduce it with a small code so no test... :-/

r? @QuietMisdreavus
2019-06-03 14:02:15 +00:00
Matthew Jasper
8ffa408059 Update tests for changes to cannot move errors 2019-06-03 14:55:29 +01:00
Matthew Jasper
9336b3d3d0 Use UseSpans in cannot move errors 2019-06-03 14:55:29 +01:00
Matthew Jasper
f7e86a5a49 Improve cannot move errors
* Show the place and type being moved
* Give a special error for variables in match guard
* Simplify search for overloaded deref
* Search for overloaded index
2019-06-03 14:55:29 +01:00
David Wood
2bb92aa02f
rustc: remove ArgSource
`ArgSource` is no longer used anywhere, so it can be removed.
2019-06-03 14:02:21 +01:00
David Wood
3c7e0eb547
rustc: construct statement vector directly
This commit simplifies the previous logic to construct the statement
vector directly rather than constructing a `Vec` of
`(hir::Stmt, Option<hir::Stmt>)` first.
2019-06-03 14:02:21 +01:00
David Wood
3ebe9ab5e7
rustc: use lowering helpers
This commit changes the lowering to stop creating HIR statements,
expressions and patterns directly and instead uses the pre-existing
helper functions.
2019-06-03 14:02:21 +01:00
David Wood
5e3b41e0cb
rustc: remove HirId from ArgSource::AsyncFn
This commit removes the `HirId` from `ArgSource::AsyncFn`, relying on
the fact that only `simple_ident` is used in each of the locations that
previously took the original pattern from the `ArgSource::AsyncFn`.
2019-06-03 14:02:21 +01:00
Matthew Jasper
f309f917c2 Add method to note types don't implement Copy 2019-06-03 12:59:08 +01:00
Matthew Jasper
5cfa70f760 Add is_ref_for_guard method 2019-06-03 12:59:08 +01:00
bors
7096ff0ce1 Auto merge of #57214 - Zoxc:no-local-interners, r=eddyb
Store CtxtInterners for local values in AllArenas

r? @eddyb
2019-06-03 11:10:45 +00:00
lcnr/Bastian Kauschke
8a25fdb409 add codegen test for unchecked math 2019-06-03 13:00:44 +02:00
lcnr/Bastian Kauschke
4e7319cd3f add unchecked math intrinsics 2019-06-03 12:59:48 +02:00
lcnr/Bastian Kauschke
d6266a7666 add support for unchecked math 2019-06-03 12:59:17 +02:00