Oliver Scherer [Fri, 27 Dec 2019 23:36:04 +0000 (00:36 +0100)]
Rollup merge of #67602 - xfix:use-issue-none-instead-of-0-in-intrinsics, r=Centril
Use issue = "none" instead of "0" in intrinsics
`issue = "0"` was incorrectly used in https://github.com/rust-lang/rust/commit/9ee16e14c51668309f446636e8960b7fbbac066d, the project is moving away from issue 0
Oliver Scherer [Fri, 27 Dec 2019 23:36:01 +0000 (00:36 +0100)]
Rollup merge of #67588 - Kixunil:nonnull-slice-iter, r=rkruppe
Use NonNull in slice::Iter and slice::IterMut.
`ptr` of `slice::Iter` and `slice::IterMut` can never be null, but this
fact wasn't exploited for layout optimizations. By changing `ptr` from
`*<mutability> T` to `NonNull<T>`, the compiler can now optimize layout
of `Option<Iter<'a, T>>`.
Oliver Scherer [Fri, 27 Dec 2019 23:35:58 +0000 (00:35 +0100)]
Rollup merge of #65244 - seanmonstar:into-future, r=seanmonstar
add IntoFuture trait and support for await
The [async-await RFC](https://rust-lang.github.io/rfcs/2394-async_await.html#the-await-compiler-built-in) mentions being able to `await` anything implementing `IntoFuture`. Somewhere along the way, it was left out.
bors [Fri, 27 Dec 2019 10:58:57 +0000 (10:58 +0000)]
Auto merge of #67437 - matthew-healy:skip-llvm-rebuild, r=Mark-Simulacrum
Add LLVM `skip-rebuild` option to `x.py`
This PR reimplements parts of @Walther's work from #65848, and closes #65612.
I decided not to implement the [arguments to override this setting](https://github.com/rust-lang/rust/issues/65612#issuecomment-544247546) in this PR. If there's strong feeling that this change shouldn't be merged without the overrides then I'm happy to close this until I've had a chance to add them in. Otherwise I'll aim to submit a second PR with those this weekend.
I'd have liked to have tested the change in `native.rs`, but there didn't seem to be any existing test infrastructure. I ran this a few times manually and it _worked on my machine_ though... 😬
bors [Fri, 27 Dec 2019 07:38:52 +0000 (07:38 +0000)]
Auto merge of #67192 - oli-obk:const_zst_addr, r=RalfJung,varkor
Various const eval and pattern matching ICE fixes
r? @RalfJung
cc @spastorino
This PR does not change existing behaviour anymore and just fixes a bunch of ICEs reachable from user code (sometimes even on stable via obscure union transmutes).
`ptr` of `slice::Iter` and `slice::IterMut` can never be null, but this
fact wasn't exploited for layout optimizations. By changing `ptr` from
`*<mutability> T` to `NonNull<T>`, the compiler can now optimize layout
of `Option<Iter<'a, T>>`.
bors [Thu, 26 Dec 2019 03:42:59 +0000 (03:42 +0000)]
Auto merge of #67268 - estebank:assoc-types, r=oli-obk
Tweak errors for missing associated types and type parameters
* On `dyn Trait` missing associated types, provide a structured suggestion for them
* On missing type parameters, provide structured suggestion for them
* Point at trait definition when missing required type parameter
* Tweak output of E0658
* Tweak wording of E0719
* Account for `Trait1 + Trait2` case
bors [Wed, 25 Dec 2019 21:10:49 +0000 (21:10 +0000)]
Auto merge of #66919 - dtolnay:description, r=KodrAus
Deprecate Error::description for real
`description` has been documented as soft-deprecated since 1.27.0 (17 months ago). There is no longer any reason to call it or implement it.
This PR:
- adds `#[rustc_deprecated(since = "1.41.0")]` to `Error::description`;
- moves `description` (and `cause`, which is also deprecated) below the `source` and `backtrace` methods in the Error trait;
- reduces documentation of `description` and `cause` to take up much less vertical real estate in rustdocs, while preserving the example that shows how to render errors without needing to call `description`;
- removes the description function of all *currently unstable* Error impls in the standard library;
- marks `#[allow(deprecated)]` the description function of all *stable* Error impls in the standard library;
- replaces miscellaneous uses of `description` in example code and the compiler.
bors [Wed, 25 Dec 2019 10:20:48 +0000 (10:20 +0000)]
Auto merge of #67524 - LukasKalbertodt:improve-into-iter-lint, r=matthewjasper
Generalize `array_into_iter` lint to also lint for boxed arrays
`Box` is special in that a method call on a box can move the value out
of the box. Thus, the same backwards-compatibility problem can arise
for boxed arrays as for simple arrays.
---
CC #66145
r? @matthewjasper (as you reviewed the first PR)
David Tolnay [Sun, 1 Dec 2019 04:01:48 +0000 (20:01 -0800)]
Deprecate Error::description for real
`description` has been documented as soft-deprecated since 1.27.0 (17
months ago). There is no longer any reason to call it or implement it.
This commit:
- adds #[rustc_deprecated(since = "1.41.0")] to Error::description;
- moves description (and cause, which is also deprecated) below the
source and backtrace methods in the Error trait;
- reduces documentation of description and cause to take up much less
vertical real estate in rustdocs, while preserving the example that
shows how to render errors without needing to call description;
- removes the description function of all *currently unstable* Error
impls in the standard library;
- marks #[allow(deprecated)] the description function of all *stable*
Error impls in the standard library;
- replaces miscellaneous uses of description in example code and the
compiler.
Esteban Küber [Thu, 12 Dec 2019 23:22:46 +0000 (15:22 -0800)]
Fix case in `associated-type-projection-from-multiple-supertraits.rs`
This still doesn't handle the case entirely correctly, requiring a more
targeted approach with a better suggestion, but at least now the
suggested syntax makes *some* sense.
bors [Wed, 25 Dec 2019 00:41:55 +0000 (00:41 +0000)]
Auto merge of #67596 - Mark-Simulacrum:tidy-silence-rustfmt, r=Centril
(Mostly) finish formatting the repository
Silences tidy line length warnings on rustfmt-controlled files.
This leaves two things out of formatting: CloudABI (mostly because it's not really ours to control, it's upstream code that's mostly generated), and tests. The latter is a hard problem and maybe not one to worry too much about, we rarely edit old tests and reformatting them as we go if possible isn't too bad (they're generally small).
bors [Tue, 24 Dec 2019 18:02:10 +0000 (18:02 +0000)]
Auto merge of #67241 - mark-i-m:simplify-borrow_check-3, r=matthewjasper
Refactorings to borrowck region diagnostic reporting
This PR is a followup to #66886 and #67404
EDIT: updated
In this PR: Clean up how errors are collected from NLL: introduce `borrow_check::diagnostics::RegionErrors` to collect errors. This is later passed to `MirBorrowckCtx::report_region_errors` after the `MirBorrowckCtx` is created. This will allow us to refactor away some of the extra context structs floating around (but we don't do it in this PR). `borrow_check::region_infer` is now mostly free of diagnostic generating code. The signatures of most of the functions in `region_infer` lose somewhere between 4 and 7 arguments :)
Left for future (feedback appreciated):
- Merge `ErrorRegionCtx` with `MirBorrowckCtx`, as suggested by @matthewjasper in https://github.com/rust-lang/rust/pull/66886#issuecomment-559949499
- Maybe move the contents of `borrow_check::nll` into `borrow_check` and remove the `nll` submodule altogether.
- Find a way to make `borrow_check::diagnostics::region_errors` less of a strange appendage to `RegionInferenceContext`. I'm not really sure how to do this yet. Ideas welcome.
Lukas Kalbertodt [Sun, 22 Dec 2019 13:26:28 +0000 (14:26 +0100)]
Generalize `array_into_iter` lint to also lint for boxed arrays
`Box` is special in that a method call on a box can move the value out
of the box. Thus, the same backwards-compatibility problem can arise
for boxed arrays as for simple arrays.