Commit graph

132095 commits

Author SHA1 Message Date
Ralf Jung c90ef979de fix a comment in validity check 2020-10-28 10:39:21 +01:00
bors 56d288fa46 Auto merge of #78227 - SergioBenitez:test-stdout-threading, r=m-ou-se
Capture output from threads spawned in tests

This is revival of #75172.

Original text:
> Fixes #42474.
>
> r? `@​dtolnay` since you expressed interest in this, but feel free to redirect if you aren't the right person anymore.

---

Closes #75172.
2020-10-27 11:43:18 +00:00
bors 20b1e05a8d Auto merge of #77502 - varkor:const-generics-suggest-enclosing-braces, r=petrochenkov
Suggest that expressions that look like const generic arguments should be enclosed in brackets

I pulled out the changes for const expressions from https://github.com/rust-lang/rust/pull/71592 (without the trait object diagnostic changes) and made some small changes; the implementation is `@estebank's.`

We're also going to want to make some changes separately to account for trait objects (they result in poor diagnostics, as is evident from one of the test cases here), such as an adaption of https://github.com/rust-lang/rust/pull/72273.

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

r? `@petrochenkov`
2020-10-27 09:25:54 +00:00
bors 824f900a96 Auto merge of #77317 - varkor:break-diverging-value, r=nikomatsakis
Fix control flow check for breaking with diverging values

Fixes https://github.com/rust-lang/rust/issues/77156.
2020-10-27 07:10:55 +00:00
bors c9b606ed67 Auto merge of #78359 - ssomers:btree_cleanup_mem, r=Mark-Simulacrum
BTreeMap: move generic support functions out of navigate.rs

A preparatory step chipped off #78104, useful in general (if at all).

r? `@Mark-Simulacrum`
2020-10-27 04:01:52 +00:00
bors 28f03ac4c0 Auto merge of #78421 - JohnTitor:rollup-bq2d7fo, r=JohnTitor
Rollup of 16 pull requests

Successful merges:

 - #76635 (Add [T]::as_chunks(_mut))
 - #77703 (add system-llvm-libunwind config option)
 - #78219 (Prefer to use `print_def_path`)
 - #78298 (Add test for bad NLL higher-ranked subtype)
 - #78332 (Update description for error E0308)
 - #78342 (Use check-pass in single-use-lifetime ui tests)
 - #78347 (Add lexicographical comparison doc)
 - #78348 (Make some functions private that don't have to be public)
 - #78349 (Use its own `TypeckResults` to avoid ICE)
 - #78375 (Use ? in core/std macros)
 - #78377 (Fix typo in debug statement)
 - #78388 (Add some regression tests)
 - #78394 (fix(docs): typo in BufWriter documentation)
 - #78396 (Add compiler support for LLVM's x86_64 ERMSB feature)
 - #78405 (Fix typo in lint description)
 - #78412 (Improve formatting of hash collections docs)

Failed merges:

r? `@ghost`
2020-10-27 01:36:12 +00:00
Yuki Okushi 4236d27c9b
Rollup merge of #78412 - camelid:cleanup-hash-docs, r=jonas-schievink
Improve formatting of hash collections docs
2020-10-27 08:45:30 +09:00
Yuki Okushi 7824d9abbd
Rollup merge of #78405 - notriddle:patch-3, r=lcnr
Fix typo in lint description
2020-10-27 08:45:27 +09:00
Yuki Okushi 46b8e46fe1
Rollup merge of #78396 - josephlr:ermsb, r=petrochenkov
Add compiler support for LLVM's x86_64 ERMSB feature

This change is needed for compiler-builtins to check for this feature
when implementing memcpy/memset. See:
  https://github.com/rust-lang/compiler-builtins/pull/365

Without this change, the following code compiles, but does nothing:
```rust
#[cfg(target_feature = "ermsb")]
pub unsafe fn ermsb_memcpy() { ... }
```

The change just does compile-time detection. I think that runtime
detection will have to come in a follow-up CL to std-detect.

Like all the CPU feature flags, this just references #44839

Signed-off-by: Joe Richey <joerichey@google.com>
2020-10-27 08:45:24 +09:00
Yuki Okushi f6f8764b25
Rollup merge of #78394 - rubik:master, r=m-ou-se
fix(docs): typo in BufWriter documentation

This PR fixes a small typo in the BufWriter documentation. The current documentation looks like this:

![2020-10-26-111501_438x83_scrot](https://user-images.githubusercontent.com/238549/97160357-83d3a000-177c-11eb-8a35-3cdd3a7d89de.png)

The `<u8>` at the end is mangled by Markdown. This PR makes the `BufWriter` documentation like the `BufReader` one:

https://github.com/rust-lang/rust/blob/master/library/std/src/io/buffered/bufreader.rs#L16

I'm tagging Steve as per the Rustc dev guide.

r? @steveklabnik
2020-10-27 08:45:20 +09:00
Yuki Okushi 98e2a9564f
Rollup merge of #78388 - camelid:regression-tests, r=lcnr
Add some regression tests

Closes #75763.
Closes #76179.
2020-10-27 08:45:17 +09:00
Yuki Okushi b72d70ef61
Rollup merge of #78377 - LeSeulArtichaut:patch-docs, r=jonas-schievink
Fix typo in debug statement
2020-10-27 08:45:14 +09:00
Yuki Okushi 5a33fa5179
Rollup merge of #78375 - taiki-e:question-in-macros, r=kennytm
Use ? in core/std macros
2020-10-27 08:45:10 +09:00
Yuki Okushi 6abd2a59e7
Rollup merge of #78349 - JohnTitor:issue-75962, r=davidtwco
Use its own `TypeckResults` to avoid ICE

Fixes #75962
2020-10-27 08:45:07 +09:00
Yuki Okushi ae5442582d
Rollup merge of #78348 - jyn514:pub-crate, r=GuillaumeGomez
Make some functions private that don't have to be public

r? @GuillaumeGomez
2020-10-27 08:45:04 +09:00
Yuki Okushi 727e93dc74
Rollup merge of #78347 - Rustin-Liu:rustin-patch-doc, r=kennytm
Add lexicographical comparison doc

close https://github.com/rust-lang/rust/issues/72255
2020-10-27 08:45:01 +09:00
Yuki Okushi afdd148c03
Rollup merge of #78342 - oliviacrain:checkmate-pass, r=Mark-Simulacrum
Use check-pass in single-use-lifetime ui tests

Rationale: the `single_use_lifetimes` lint is used during late name resolution, which is within the scope of `check-pass` and does not require codegen or linking.

Helps remove some FIXMES associated with #62277. Additionally tidies touched test files.
2020-10-27 08:44:57 +09:00
Yuki Okushi 0b72ca6ea6
Rollup merge of #78332 - PoignardAzur:doc_E0308, r=camelid
Update description for error E0308

Fixes #76462

r? @camelid
2020-10-27 08:44:54 +09:00
Yuki Okushi 9d7db4891b
Rollup merge of #78298 - Aaron1011:fix/nll-ranked-test, r=Mark-Simulacrum
Add test for bad NLL higher-ranked subtype

Fixes #57642
2020-10-27 08:44:51 +09:00
Yuki Okushi f3c94374b9
Rollup merge of #78219 - JohnTitor:print-def-path, r=estebank
Prefer to use `print_def_path`

Follow-up of https://github.com/rust-lang/rust/pull/71310#discussion_r415438577
2020-10-27 08:44:47 +09:00
Yuki Okushi 2c307fab49
Rollup merge of #77703 - Keruspe:system-libunwind, r=Mark-Simulacrum
add system-llvm-libunwind config option

allows using the system-wide llvm-libunwind as the unwinder

Workaround for #76020
2020-10-27 08:44:44 +09:00
Yuki Okushi 13e88d6366
Rollup merge of #76635 - scottmcm:slice-as-chunks, r=LukasKalbertodt
Add [T]::as_chunks(_mut)

Allows getting the slices directly, rather than just through an iterator as in `array_chunks(_mut)`.  The constructors for those iterators are then written in terms of these methods, so the iterator constructors no longer have any `unsafe` of their own.

Unstable, of course. #74985
2020-10-27 08:44:41 +09:00
bors a4d30a7b49 Auto merge of #77876 - tmiasko:simplify-locals, r=wesleywiser
Remove unused set-discriminant statements and assignments regardless of rvalue

* Represent use counts with u32
* Unify use count visitors
* Change RemoveStatements visitor into a function
* Remove unused set-discriminant statements
* Use exhaustive match to clarify what is being optimized
* Remove unused assignments regardless of rvalue kind
2020-10-26 23:22:39 +00:00
varkor ac1454001c Suggest expressions that look like const generic arguments should be enclosed in brackets
Co-Authored-By: Esteban Kuber <github@kuber.com.ar>
2020-10-26 21:54:45 +00:00
Sergio Benitez 7c4fe00213 Ignore threaded capture tests on WASM w/o threads 2020-10-26 14:35:38 -07:00
bors fd542592f0 Auto merge of #77187 - TimDiekmann:box-alloc, r=Amanieu
Support custom allocators in `Box`

r? `@Amanieu`

This pull request requires a crater run.

### Prior work:
- #71873
- #58457
- [`alloc-wg`](https://github.com/TimDiekmann/alloc-wg)-crate

Currently blocked on:
- ~#77118~
- ~https://github.com/rust-lang/chalk/issues/615 (#77515)~
2020-10-26 21:16:33 +00:00
Camelid 59f108885e Improve formatting of hash collections docs 2020-10-26 14:05:06 -07:00
Camelid 4641d2e6aa
Add FIXME note to const generics test
Co-authored-by: lcnr <bastian_kauschke@hotmail.de>
2020-10-26 13:56:31 -07:00
Camelid 94ed9455e8 Add some regression tests 2020-10-26 13:55:37 -07:00
bors 0da6d42f29 Auto merge of #68965 - eddyb:mir-inline-scope, r=nagisa,oli-obk
rustc_mir: track inlined callees in SourceScopeData.

We now record which MIR scopes are the roots of *other* (inlined) functions's scope trees, which allows us to generate the correct debuginfo in codegen, similar to what LLVM inlining generates.
This PR makes the `ui` test `backtrace-debuginfo` pass, if the MIR inliner is turned on by default.

Also, `#[track_caller]` is now correct in the face of MIR inlining (cc `@anp).`

Fixes #76997.

r? `@rust-lang/wg-mir-opt`
2020-10-26 18:50:22 +00:00
Michael Howell 74a9891235
Fix typo in lint description 2020-10-26 11:46:11 -07:00
bors 35debd4c11 Auto merge of #77975 - bjorn3:cg_clif_subtree3, r=Mark-Simulacrum
Add cg_clif as optional codegen backend

Rustc_codegen_cranelift is an alternative codegen backend for rustc based on Cranelift. It has the potential to improve compilation times in debug mode. In my experience the compile time improvements over debug mode LLVM for a clean build are about 20-30% in most cases.

This PR adds cg_clif as optional codegen backend. By default it is only enabled for `./x.py check`. It can be enabled for `./x.py build` too by adding `cranelift` to the `rust.codegen-backends` array in `config.toml`.

MCP: https://github.com/rust-lang/compiler-team/issues/270

r? `@Mark-Simulacrum`
2020-10-26 16:31:38 +00:00
Rustin-Liu 42844ed2cf Add lexicographical comparison doc
Add links

Fix typo

Use `sequence`

Fix typo

Fix broken link

Fix broken link

Fix broken link

Fix broken links

Fix broken links
2020-10-26 22:39:43 +08:00
bors c96e11c781 Auto merge of #78395 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/78339
Cc `@rust-lang/miri` r? `@ghost`
2020-10-26 14:13:37 +00:00
oli 2b3f00928c Ignore long lines in test 2020-10-26 14:09:27 +00:00
oli 7ae8bc3957 Add an inlining debuginfo test 2020-10-26 13:18:12 +00:00
oli 7101ce9127 Deduplicate span and dbg_scope adjustment 2020-10-26 13:04:52 +00:00
oli f8aae50469 Prefer bug! over unwrap() 2020-10-26 12:49:49 +00:00
bors 9f6c670c4b Auto merge of #78196 - pietroalbini:shipped-files, r=Mark-Simulacrum
Allow creating a list of files shipped in a release

This PR adds the `BUILD_MANIFEST_SHIPPED_FILES_PATH` environment variable to `build-manifest`, which writes a list of all the files referenced in the manifest to the path defined in the variable. The use for this is for `promote-release` to prune files unused files before publishing a release.

This PR **does not implement any pruning**, it just adds support for it to be implemented in the future on `promote-release`'s side.

r? `@Mark-Simulacrum`
2020-10-26 11:56:59 +00:00
Ralf Jung 3573333208 update Miri 2020-10-26 12:44:41 +01:00
Joe Richey ad552bc17e
Add compiler support for LLVM's x86 ERMSB feature
This change is needed for compiler-builtins to check for this feature
when implementing memcpy/memset. See:
  https://github.com/rust-lang/compiler-builtins/pull/365

The change just does compile-time detection. I think that runtime
detection will have to come in a follow-up CL to std-detect.

Like all the CPU feature flags, this just references #44839

Signed-off-by: Joe Richey <joerichey@google.com>
2020-10-26 03:46:54 -07:00
Michele Lacchia a4ba179bdd
fix(docs): typo in BufWriter documentation 2020-10-26 11:13:47 +01:00
Tomasz Miąsko 4c3e06a0ba simplify-locals: Remove unused assignments regardless of rvalue kind 2020-10-26 10:48:28 +01:00
Pietro Albini 0ee1e91c11
build-manifest: allow creating a list of files shipped in a release 2020-10-26 10:47:45 +01:00
Tomasz Miąsko 52d3782685 simplify-locals: Remove unused set-discriminant statements
Update affected ui & incremental tests to use a user declared variable
bindings instead of temporaries. The former are preserved because of
debuginfo, the latter are not.
2020-10-26 10:41:44 +01:00
Tomasz Miąsko e1e48ae29b simplify-locals: Change RemoveStatements visitor into a function
No functionl changes intended.
2020-10-26 10:33:45 +01:00
Tomasz Miąsko a6b64be8b5 simplify-locals: Unify use count visitors
The simplify locals implementation uses two different visitors to update
the locals use counts. The DeclMarker calculates the initial use counts.
The StatementDeclMarker updates the use counts as statements are being
removed from the block.

Replace them with a single visitor that can operate in either mode,
ensuring consistency of behaviour.

Additionally use exhaustive match to clarify what is being optimized.

No functional changes intended.
2020-10-26 10:33:39 +01:00
Tomasz Miąsko 11269536e2 simplify-locals: Represent use counts with u32 2020-10-26 10:33:31 +01:00
bors b9a94c919b Auto merge of #78324 - RalfJung:uninhabited-statics, r=oli-obk
ensure that statics are inhabited

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

r? `@oli-obk`
2020-10-26 09:11:34 +00:00
bjorn3 ac4f7deb2f Add 'compiler/rustc_codegen_cranelift/' from commit '793d26047f994e23415f8f6bb5686ff25d3dda92'
git-subtree-dir: compiler/rustc_codegen_cranelift
git-subtree-mainline: cf798c1ec6
git-subtree-split: 793d26047f
2020-10-26 09:53:27 +01:00