Commit Graph

120262 Commits

Author SHA1 Message Date
Matthias Krüger
438877380a deps: remove unused regex dependency from root crate 2020-05-09 01:27:30 +02:00
Elinvynia
05fc7faacb Better documentation for io::Read::read() return value 2020-05-09 01:17:20 +02:00
Matthias Krüger
737338e2a5 submodules: update cargo from f534844c2 to cb06cb269
Changes:
````
more clippy fixes
Document that bench is unstable in the man page.
Update assertions in LTO calculations
Updated comments in resolve.rs to reflect actual data strcture used.
Try to remove secrets from http.debug.
Revert always computing filename Metadata.
clean -p: call `get_many` once.
Implement new `clean -p` using globs.
Rework how Cargo computes the rustc file outputs.
Add CrateType to replace LibKind.
````
2020-05-09 00:47:00 +02:00
Mark Rousskov
54b7d45564 Use CDN for ci-caches on download
This will reduce costs, as well as lays the groundwork for developers to be able
to locally pull the published docker images without needing AWS credentials.
2020-05-08 17:36:44 -04:00
bors
7ebd87a7a1 Auto merge of #72021 - Dylan-DPC:rollup-1w61ihk, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #71581 (Unify lints handling in rustdoc)
 - #71710 (Test for zero-sized function items not ICEing)
 - #71970 (Improve bitcode generation for Apple platforms)
 - #71975 (Reduce `TypedArena` creations in `check_match`.)
 - #72003 (allow wasm target for rustc-ap-rustc_span)
 - #72017 (Work around ICEs during cross-compilation for target, ast, & attr)

Failed merges:

r? @ghost
2020-05-08 20:03:23 +00:00
Oliver Scherer
b07a44d5c4 Document global_alloc 2020-05-08 21:59:17 +02:00
Dylan DPC
827ec49c23
Rollup merge of #72017 - ctaggart:wasm2, r=ecstatic-morse
Work around ICEs during cross-compilation for target, ast, & attr

This applies the fix for #72003 to work around #56935 to three more libraries. With these additional fixes, I'm able to use rustfmt_lib from wasm (https://github.com/rust-lang/rustfmt/issues/4132#issuecomment-616587989), which was my goal.

To get it working locally and to test, I copied the `.cargo/registry/src` and applied the fix and replaced the reference in my project:
``` toml
[replace]
"rustc-ap-rustc_span:656.0.0" = { path = "../rustc-ap-rustc_span" }
"rustc-ap-rustc_target:656.0.0" = { path = "../rustc-ap-rustc_target" }
"rustc-ap-rustc_ast:656.0.0" = { path = "../rustc-ap-rustc_ast" }
"rustc-ap-rustc_attr:656.0.0" = { path = "../rustc-ap-rustc_attr" }
```
2020-05-08 18:48:33 +02:00
Dylan DPC
b750ee4964
Rollup merge of #72003 - ctaggart:wasm, r=jonas-schievink
allow wasm target for rustc-ap-rustc_span

This fixes #71998 by applying the work-a-round. The root cause is probably #56935, as @petrochenkov pointed out.

I reproduced the bug by:
```
cd ~/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_span-657.0.0/
cargo build --target wasm32-unknown-unknown
```

Adding this line fixes it.
2020-05-08 18:48:31 +02:00
Dylan DPC
0c8ef4772a
Rollup merge of #71975 - nnethercote:reduce-TypedArena-creations-in-check_match, r=oli-obk
Reduce `TypedArena` creations in `check_match`.

`check_match` creates a new `TypedArena` for every call to
`create_and_enter`. DHAT tells me that each `TypedArena` typically is
barely used, with typically a single allocation per arena.

This commit moves the `TypedArena` creation outwards a bit, into
`check_match`, and then passes it into `create_and_enter`. This reduces
the number of arenas created by about 4-5x, for a very small perf win.
(Moving the arena creation further outwards is hard because
`check_match` is a query.)

r? @oli-obk
2020-05-08 18:48:29 +02:00
Dylan DPC
e3a4ff0d76
Rollup merge of #71970 - thombles:ios-bitcode-improvements, r=alexcrichton
Improve bitcode generation for Apple platforms

Some improvements for iOS bitcode support suggested by Alex over at https://github.com/getditto/rust-bitcode/issues/9. r? @alexcrichton

This improves Rust's bitcode generation so that provided you have a compatible LLVM version, Rust targeting iOS should work out of the box when compiled into bitcode-enabled apps, and when submitted to the App Store. I've tested these changes using Xcode 11.4.1 and Apple's vendored LLVM, [tag `swift-5.2.3-RELEASE`](https://github.com/apple/llvm-project/releases/tag/swift-5.2.3-RELEASE).

1. Force `aarch64-apple-ios` and `aarch64-apple-tvos` targets to always emit full bitcode sections, even when cargo is trying to optimise by invoking `rustc` with `-Cembed-bitcode=no`. Since Apple recommends bitcode on iOS and requires it on tvOS it is likely that this is what developers intend. Currently you need to override the codegen options with `RUSTFLAGS`, which is far from obvious.
2. Provide an LLVM cmdline in the target spec. Apple's bitcode verification process looks for some arguments. For Rust modules to be accepted we must pretend they were produced similarly. A suitable default is provided in `TargetOptions` for iOS, copied directly from the a clang equivalent section.

In the context of Apple platforms, the predominant purpose of bitcode is App Store submissions, so simulator and 32-bit targets are not relevant. I'm hoping that the cmdline strings will not be a maintenance burden to keep up-to-date. If the event of any future incompatibilities, hopefully a custom target config would offer enough flexibility to work around it. It's impossible to say for sure.

Due to unrelated build errors I haven't been able to build and test a full tvOS toolchain. I've stopped short of providing a similar `bitcode_llvm_cmdline` until I can actually test it.
2020-05-08 18:48:28 +02:00
Dylan DPC
a9eb01ae03
Rollup merge of #71710 - workingjubilee:jubilee-readd-test, r=nikomatsakis
Test for zero-sized function items not ICEing

Closes #30276.
Again.
Please give rustcake with no icing!
2020-05-08 18:48:23 +02:00
Dylan DPC
807e8b80dc
Rollup merge of #71581 - GuillaumeGomez:unify-lints-handling, r=kinnison
Unify lints handling in rustdoc

This is a small cleanup. The goal is to unify a bit things to make the reading simpler.

r? @kinnison

cc @rust-lang/rustdoc
2020-05-08 18:48:19 +02:00
Matthew Jasper
619c6055e7 Fix debug assertion in error code 2020-05-08 17:25:44 +01:00
mibac138
bbda107436 Add test for strikethrough in rustdoc 2020-05-08 18:14:57 +02:00
mark
9dabea1a29 fix canonicalization links 2020-05-08 11:06:25 -05:00
Cameron Taggart
0d60c46faa Work around ICEs during cross-compilation 2020-05-08 09:38:18 -06:00
Cameron Taggart
732eaf81b7 FIXME comment 2020-05-08 07:56:53 -06:00
Guillaume Gomez
9d8310856b Add test for deprecated emoji 2020-05-08 15:27:08 +02:00
Guillaume Gomez
abbc7365a7 Add emoji for deprecated messages 2020-05-08 15:19:14 +02:00
bors
7b805396bf Auto merge of #72010 - Dylan-DPC:rollup-prdj0pk, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #71989 (Use a single enum for the kind of a const context)
 - #71993 (Remove old `util/liveness.rs` module)
 - #71999 (Add myself to mailmap.)
 - #72001 (Adjust cfg(version) to lang team decision)
 - #72007 (Fix some tests failing in `--pass check` mode)
 - #72008 (Add const-generics test)

Failed merges:

r? @ghost
2020-05-08 13:11:43 +00:00
Dylan DPC
678954000a
Rollup merge of #72008 - lcnr:patch-3, r=varkor
Add const-generics test

Taken from #71973 as this apparently already compiles.

r? @varkor
2020-05-08 14:11:52 +02:00
Dylan DPC
c4c634034a
Rollup merge of #72007 - petrochenkov:passcheck3, r=RalfJung
Fix some tests failing in `--pass check` mode

r? @RalfJung
2020-05-08 14:11:51 +02:00
Dylan DPC
5cef212dca
Rollup merge of #72001 - mibac138:cfg-version, r=petrochenkov
Adjust cfg(version) to lang team decision

See https://github.com/rust-lang/rust/issues/64796#issuecomment-625474439 for details

r? @petrochenkov who reviewed the original PR (#71314)
2020-05-08 14:11:49 +02:00
Dylan DPC
8f247c1804
Rollup merge of #71999 - crlf0710:mailmap, r=Dylan-DPC
Add myself to mailmap.
2020-05-08 14:11:47 +02:00
Dylan DPC
681d747b65
Rollup merge of #71993 - ecstatic-morse:cleanup-old-liveness, r=jonas-schievink
Remove old `util/liveness.rs` module

The liveness dataflow analysis now lives in the `dataflow` module, so this one is no longer necessary. I've copied the relevant bits of the module docs for `util::liveness` to `MaybeLiveLocals`. The example in the docs is now a `mir-dataflow` test: a08c47310c/src/test/ui/mir-dataflow/liveness-ptr.rs (L6-L26)

The borrow-checker used the same notion of "defs" and "uses", so I've moved it into a submodule. I would have moved it to `util/def_use.rs`, since it seems generally useful, but there's already a slightly [different version](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/util/def_use.rs) of the same abstraction needed for copy propagation.
2020-05-08 14:11:45 +02:00
Dylan DPC
1e6c199653
Rollup merge of #71989 - ecstatic-morse:const-context-enum, r=oli-obk
Use a single enum for the kind of a const context

This adds a `ConstContext` enum to the `rustc_hir` crate and method that can be called via `tcx.hir()` to get the `ConstContext` for a given body owner. This arose from discussion in #71824.

r? @oli-obk
2020-05-08 14:11:44 +02:00
Camille GILLOT
32507d6910 Fix tests 2020-05-08 13:57:08 +02:00
Camille GILLOT
31c84e5077 Fix clippy. 2020-05-08 13:57:01 +02:00
Camille GILLOT
7bf21d4838 Fix clippy. 2020-05-08 13:57:01 +02:00
Bastian Kauschke
4fd70e4ed9
add const-generics test 2020-05-08 13:42:17 +02:00
Vadim Petrochenkov
13c93120cf Fix some tests failing in --pass check mode 2020-05-08 14:27:36 +03:00
Camille GILLOT
d4e143ed2f Remove ast::{Ident, Name} reexports. 2020-05-08 13:13:15 +02:00
bors
ceddf34b2e Auto merge of #5541 - DarkEld3r:patch-1, r=flip1995
Extend example for the `unneeded_field_pattern` lint

Current example is incorrect (or pseudo-code) because a struct name is omitted. I have used the code from the tests instead. Perhaps this example can be made less verbose, but I think it is more convenient to see a "real" code as an example.

---

changelog: extend example for the `unneeded_field_pattern` lint
2020-05-08 10:34:50 +00:00
Oliver Scherer
43fcd7d55e Create a convenience wrapper for get_global_alloc(id).unwrap() 2020-05-08 10:59:09 +02:00
Oliver Scherer
4572d32810 Shrink visibility of the AllocMap and its methods 2020-05-08 10:59:08 +02:00
Oliver Scherer
1037f403ea Move unwrap_fn and unwrap_memory to GlobalAlloc 2020-05-08 10:59:08 +02:00
Oliver Scherer
38ae8f3286 Simplify the tcx.alloc_map API 2020-05-08 10:59:08 +02:00
bors
a51e004e1b Auto merge of #71917 - RalfJung:miri, r=RalfJung
update miri

In particular this includes the change to yield on `spin_loop_hint`, which is needed for https://github.com/rust-lang/rust/pull/71737.
r? @ghost Cc @rust-lang/miri

Fixes https://github.com/rust-lang/rust/issues/71963
2020-05-08 07:29:42 +00:00
Cameron Taggart
74f00e2f63 #[allow(unused)] 2020-05-07 22:30:14 -06:00
Cameron Taggart
60c66e3f82 allow wasm target for rustc-ap-rustc_span 2020-05-07 22:13:50 -06:00
bors
78b7d4944c Auto merge of #5576 - ebroto:manual_async_fn, r=flip1995
Add the manual_async_fn lint

changelog: Added the `manual_async_fn` lint to warn on functions that can be simplified using async syntax

Closes #5503
2020-05-08 01:50:28 +00:00
bors
29630cea47 Auto merge of #71992 - Dylan-DPC:rollup-29qjvpe, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #70733 (Add Arc::{incr,decr}_strong_count)
 - #71598 (improve Drop documentation)
 - #71783 (Detect errors caused by `async` block in 2015 edition)
 - #71903 (reword "possible candidate" import suggestion)
 - #71960 (Fix E0284 to not use incorrect wording)

Failed merges:

r? @ghost
2020-05-08 01:19:24 +00:00
Charles Lew
4c032d496b Add myself to mailmap. 2020-05-08 08:26:29 +08:00
Tom Karpiniec
4fea9cdd24 Simplify bitcode embedding - either None or Full 2020-05-08 09:48:30 +10:00
mibac138
cd291b8e51 Adjust cfg(version) to lang team decision 2020-05-08 01:07:03 +02:00
Nicholas Nethercote
d26d187ff8 Replace MatchVisitor::check_in_cx with MatchVisitor::new_cx.
The closure isn't necessary.
2020-05-08 08:57:25 +10:00
Ralf Jung
e583a5c7dc update miri 2020-05-08 00:28:51 +02:00
bors
1eefa6783c Auto merge of #71995 - pietroalbini:ci-windows-detect-latest-python, r=Mark-Simulacrum
[CI] Use the latest Python available on Windows

This PR changes our Windows CI to always use the latest Python interpreter available in the GHA tool cache instead of hardcoding Python 3.7.6. This is needed because occasionally GitHub bumps the installed version, deleting the previous one.

This fixes the current GHA outage we're having. I fully expect the outage to propagate to Azure Pipelines in the coming days if we don't merge this, as both GHA and Azure use the same underlying image. Once the PR is merged we can re-enabled the double-gating.

r? @Mark-Simulacrum
2020-05-07 21:52:39 +00:00
Jack Huey
0e2f5c9862 Fix nit and cargo.lock 2020-05-07 17:46:31 -04:00
Jack Huey
5fa4c63be0 Fix nit and cargo.lock 2020-05-07 17:46:31 -04:00