Commit graph

136457 commits

Author SHA1 Message Date
Aaron Hill
7afb32557d
Enforce that query results implement Debug 2021-01-16 17:53:02 -05:00
bors
492b83c697 Auto merge of #80290 - RalfJung:less-intrinsic-write, r=lcnr
implement ptr::write without dedicated intrinsic

This makes `ptr::write` more consistent with `ptr::write_unaligned`, `ptr::read`, `ptr::read_unaligned`, all of which are implemented in terms of `copy_nonoverlapping`.

This means we can also remove `move_val_init` implementations in codegen and Miri, and its special handling in the borrow checker.

Also see [this Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/ptr.3A.3Aread.20vs.20ptr.3A.3Awrite).
2021-01-16 17:28:32 +00:00
bors
63a83c5f55 Auto merge of #81077 - bugadani:shrink, r=Mark-Simulacrum
Remove unnecessary manual shrink_to_fit calls
2021-01-16 14:04:43 +00:00
Dániel Buga
dc932cdf88 Remove unnecessary manual shrink_to_fit calls 2021-01-16 14:02:36 +01:00
bors
410a546fc5 Auto merge of #77435 - hanmertens:binary_heap_append, r=scottmcm
Always use extend in BinaryHeap::append

This is faster, see #77433.

Fixes #77433
2021-01-16 11:10:13 +00:00
bors
efdb859dcd Auto merge of #80873 - ssomers:btree_cleanup_slices_4, r=Mark-Simulacrum
BTreeMap: tougher checks on code using raw into_kv_pointers

r? `@Mark-Simulacrum`
2021-01-16 07:12:12 +00:00
bors
635ccfe01c Auto merge of #77885 - erikdesjardins:probeasm, r=cuviper
Use probe-stack=inline-asm in LLVM 11+

Fixes (?) #74405, related to #43241

r? `@cuviper`
2021-01-16 03:10:52 +00:00
bors
6c869d34ae Auto merge of #81057 - GuillaumeGomez:rollup-yl2kqst, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #77693 (Add test for #59352)
 - #80515 (Improve JS performance by storing length before comparing to it in loops)
 - #81030 (Update mdbook)
 - #81033 (Remove useless `clean::Variant` struct)
 - #81049 (inline: Round word-size cost estimates up)
 - #81054 (Drop a few unneeded borrows)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-01-16 00:13:26 +00:00
Guillaume Gomez
f8b1baac11
Rollup merge of #81054 - LingMan:rem_as_ref, r=jyn514
Drop a few unneeded borrows

`@rustbot` modify labels +C-cleanup +T-compiler
2021-01-15 23:31:03 +01:00
Guillaume Gomez
1a194d90a2
Rollup merge of #81049 - tmiasko:layout-cost, r=oli-obk
inline: Round word-size cost estimates up
2021-01-15 23:31:01 +01:00
Guillaume Gomez
97b736c1a5
Rollup merge of #81033 - jyn514:nested-variant, r=CraftSpider
Remove useless `clean::Variant` struct

It had exactly one field and no special behavior, so there was no point in having it.

r? `@CraftSpider`
2021-01-15 23:31:00 +01:00
Guillaume Gomez
38772f1491
Rollup merge of #81030 - ehuss:update-mdbook, r=Mark-Simulacrum
Update mdbook

Just a few small fixes and changes, see https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-046 for a list.
2021-01-15 23:30:58 +01:00
Guillaume Gomez
033faf9499
Rollup merge of #80515 - GuillaumeGomez:js-for-loop-perf, r=Nemo157,jyn514
Improve JS performance by storing length before comparing to it in loops

Since https://github.com/rust-lang/rust/pull/79052 is quite complicated to review, I suggested to split into smaller parts. This first part is mostly about saving the array length into a variable (I tried to not change anything else as much as possible 😃 ).

r? `@jyn514`
2021-01-15 23:30:53 +01:00
Guillaume Gomez
b7a9d6a51f
Rollup merge of #77693 - bugadani:issue-59352, r=oli-obk
Add test for #59352

Issue #59352 reported an optimization regression with rustc 1.32.0+. That regression could be tracked to a change that caused a function to miss the size limit of llvm's inlining, which results in an unreachable panicing branch being generated.
Enabling mir inline solves the issue, but is currently only done for `mir-opt-level>=2`.

This PR adds a test that can serve as a regression test for #59352, if/when mir inlining gets mature enough for opt-level 1, or some other optimization can remove the panic.
2021-01-15 23:30:51 +01:00
Guillaume Gomez
e7276006ea Use Array.some instead of onEach to have better performance 2021-01-15 22:52:33 +01:00
Guillaume Gomez
7cd8128da3 Improve JS performance by storing length before comparing to it in loops 2021-01-15 22:52:33 +01:00
bors
fcbd305ee9 Auto merge of #80602 - tgnottingham:cratemetadata_you_aint_special, r=michaelwoerister
Remove DepKind::CrateMetadata and pre-allocation of DepNodes

Remove much of the special-case handling around crate metadata
dependency tracking by replacing `DepKind::CrateMetadata` and the
pre-allocation of corresponding `DepNodes` with on-demand invocation
of the `crate_hash` query.
2021-01-15 21:13:35 +00:00
Han Mertens
32a20f4433 Change rebuild heuristic in BinaryHeap::append
See #77433 for why the new heuristic was chosen.

Fixes #77433
2021-01-15 21:50:05 +01:00
LingMan
ba1f036c7a Drop a few unneeded borrows 2021-01-15 21:29:28 +01:00
Joshua Nelson
d11855a8ce Rename VariantKind -> Variant
There's no `Variant`, so it seems silly to have `Kind`.
2021-01-15 13:55:03 -05:00
Joshua Nelson
dd459a2be6 Remove useless clean::Variant struct
It had exactly one field and no special behavior, so there was no point.
2021-01-15 13:54:59 -05:00
bors
bc39d4d9c5 Auto merge of #81043 - hyd-dev:update-miri, r=RalfJung
Update Miri

Fixes #80907.

r? `@RalfJung`
2021-01-15 18:17:09 +00:00
Dániel Buga
a0c5857131 Add test for #59352 2021-01-15 18:44:50 +01:00
hyd-dev
f3a6cad625
Update Miri
Co-authored-by: Ralf Jung <post@ralfj.de>
2021-01-16 00:04:32 +08:00
bors
e48eb37b94 Auto merge of #80974 - ehuss:update-cargo, r=ehuss
Update cargo

10 commits in 329895f5b52a358e5d9ecb26215708b5cb31d906..a73e5b7d567c3036b296fc6b33ed52c5edcd882e
2021-01-06 00:01:52 +0000 to 2021-01-12 23:45:39 +0000
- Sort available binaries when multiple (rust-lang/cargo#9066)
- Fix misspelling of environment variable (rust-lang/cargo#9067)
- Remove statement that opt-level 0 turns on debug (rust-lang/cargo#9070)
- Fix `links` vars showing up for testing packages (rust-lang/cargo#9065)
- Fix unit_for computation on proc-macros in shared workspace. (rust-lang/cargo#9059)
- Document `could not find the github team` error on `cargo owner --add` (rust-lang/cargo#9000)
- Unstable section of cargo/config.toml takes bools (rust-lang/cargo#9057)
- [doc] add note about empty environment variables for missing manifest keys (rust-lang/cargo#9053)
- another round of clippy lint fixes (rust-lang/cargo#9051)
- Updated display message of cargo metadata --help (rust-lang/cargo#9050)
2021-01-15 15:26:05 +00:00
bors
18ec4a9a74 Auto merge of #80625 - jyn514:python-what-python, r=Mark-Simulacrum
Choose the version of python at runtime (portable version)

r? `@Mark-Simulacrum`

Fixed version of https://github.com/rust-lang/rust/pull/80585. The goal is to avoid giving 'error: python3 required' when downloading LLVM from CI and instead default to python3 where possible.

This has some minor overhead when you have `python` as python2, but almost nothing compared to actually running the build.
2021-01-15 12:26:09 +00:00
bors
4e208f6a3a Auto merge of #81035 - JohnTitor:rollup-9m03awf, r=JohnTitor
Rollup of 5 pull requests

Successful merges:

 - #80254 (Don't try to add nested predicate to Rustdoc auto-trait `ParamEnv`)
 - #80834 (Remove unreachable panics from VecDeque::{front/back}[_mut])
 - #80944 (Use Option::map_or instead of `.map(..).unwrap_or(..)`)
 - #81008 (Don't ICE when computing a layout of a generator tainted by errors)
 - #81023 (Remove doctree::Variant)

Failed merges:

 - #81033 (Remove useless `clean::Variant` struct)

r? `@ghost`
`@rustbot` modify labels: rollup
2021-01-15 09:27:21 +00:00
Yuki Okushi
7286be15fa
Rollup merge of #81023 - CraftSpider:rustdoc-remove-variant, r=jyn514
Remove doctree::Variant

This was easy, probably was missed when whatever used it was removed
2021-01-15 18:26:18 +09:00
Yuki Okushi
ce06df2e4a
Rollup merge of #81008 - tmiasko:generator-layout-err, r=tmandry
Don't ICE when computing a layout of a generator tainted by errors

Fixes #80998.
2021-01-15 18:26:16 +09:00
Yuki Okushi
a584d87417
Rollup merge of #80944 - LingMan:map_or, r=nagisa
Use Option::map_or instead of `.map(..).unwrap_or(..)`

``@rustbot`` modify labels +C-cleanup +T-compiler
2021-01-15 18:26:14 +09:00
Yuki Okushi
1b8fd02daa
Rollup merge of #80834 - bugadani:vecdeque, r=oli-obk
Remove unreachable panics from VecDeque::{front/back}[_mut]

`VecDeque`'s `front`, `front_mut`, `back` and `back_mut` methods are implemented in terms of the index operator, which causes these functions to contain [unreachable panic calls](https://rust.godbolt.org/z/MTnq1o).

This PR reimplements these methods in terms of `get[_mut]` instead.
2021-01-15 18:26:11 +09:00
Yuki Okushi
0dedc6c054
Rollup merge of #80254 - Aaron1011:rustdoc-auto-param-env, r=estebank
Don't try to add nested predicate to Rustdoc auto-trait `ParamEnv`

Fixes #80233

We already have logic in `evaluate_predicates` that tries to add
unimplemented predicates to our `ParamEnv`. Trying to add a predicate
that already holds can lead to errors later on, since projection
will prefer trait candidates from the `ParamEnv` to predicates from an
impl.
2021-01-15 18:26:04 +09:00
bors
dcf622eb70 Auto merge of #80993 - Aaron1011:collect-set-tokens, r=petrochenkov
Set tokens on AST node in `collect_tokens`

A new `HasTokens` trait is introduced, which is used to move logic from
the callers of `collect_tokens` into the body of `collect_tokens`.

In addition to reducing duplication, this paves the way for PR #80689,
which needs to perform additional logic during token collection.
2021-01-15 05:36:48 +00:00
Erik Desjardins
cd25807223 Use probe-stack=inline-asm in LLVM 11+ 2021-01-14 22:49:16 -05:00
bors
3419da89aa Auto merge of #81027 - Xanewok:update-rls, r=calebcartwright
Update RLS and Rustfmt

Fixes #80576

Updates Rustfmt to use `rustfmt-v1.4.31` branch. Both are updated (along with `racer`) in tandem to pull in the exact same version of rustc-ap-* libraries.

r? `@calebcartwright`
2021-01-15 02:11:37 +00:00
Joshua Nelson
c8cac2a2c1 Choose the version of python at runtime (portable version)
- Try `py -3` first for windows compatibility
- Fall back to `python3` if `py` doesn't work
2021-01-14 21:00:42 -05:00
Eric Huss
f1fa9e9a13 Update mdbook 2021-01-14 17:50:23 -08:00
Igor Matuszewski
3ac464fb5d ...and update Cargo.lock again 2021-01-15 02:26:55 +01:00
Igor Matuszewski
c4735063db Remove local patch in Cargo.toml for rls-* crates 2021-01-15 02:21:04 +01:00
Igor Matuszewski
d72ea1b129 Update RLS and Rustfmt 2021-01-15 01:50:59 +01:00
Tomasz Miąsko
a65c050333 inline: Round word-size cost estimates up 2021-01-15 00:00:00 +00:00
Rune Tynan
c54678ab2f
Remove doctree::Variant 2021-01-14 15:21:44 -05:00
bors
e38fb306b7 Auto merge of #81018 - m-ou-se:rollup-7202dc7, r=m-ou-se
Rollup of 17 pull requests

Successful merges:

 - #79982 (Add missing methods to unix ExitStatusExt)
 - #80017 (Suggest `_` and `..` if a pattern has too few fields)
 - #80169 (Recommend panic::resume_unwind instead of panicking.)
 - #80217 (Add a `std::io::read_to_string` function)
 - #80444 (Add as_ref and as_mut methods for Bound)
 - #80567 (Add Iterator::intersperse_with)
 - #80829 (Get rid of `DepConstructor`)
 - #80895 (Fix handling of malicious Readers in read_to_end)
 - #80966 (Deprecate atomic::spin_loop_hint in favour of hint::spin_loop)
 - #80969 (Use better ICE message when no MIR is available)
 - #80972 (Remove unstable deprecated Vec::remove_item)
 - #80973 (Update books)
 - #80980 (Fixed incorrect doc comment)
 - #80981 (Fix -Cpasses=list and llvm version print with -vV)
 - #80985 (Fix stabilisation version of slice_strip)
 - #80990 (llvm: Remove the unused context from CreateDebugLocation)
 - #80991 (Fix formatting specifiers doc links)

Failed merges:

 - #80944 (Use Option::map_or instead of `.map(..).unwrap_or(..)`)

r? `@ghost`
`@rustbot` modify labels: rollup
2021-01-14 20:21:20 +00:00
Dániel Buga
744f885e2a Remove unreachable panics from VecDeque 2021-01-14 19:31:56 +01:00
LingMan
a56bffb4f9 Use Option::map_or instead of .map(..).unwrap_or(..) 2021-01-14 19:23:59 +01:00
Mara Bos
9c75ee6b3b
Rollup merge of #80991 - calebsander:fix/fmt-link, r=m-ou-se
Fix formatting specifiers doc links

d36e3e23a8 seems to have inadvertently changed many of these links to point to `core::fmt` instead of `std::fmt`. The information about formatting specifiers is only documented in [`std::fmt`](https://doc.rust-lang.org/std/fmt/); [`core::fmt`](https://doc.rust-lang.org/core/fmt/) is empty. 3baf6a4a74 seems to have already fixed a couple of these links to point back to `std::fmt`.
2021-01-14 18:00:31 +00:00
Mara Bos
494cb3cc7c
Rollup merge of #80990 - cuviper:unused-debug-context, r=nagisa
llvm: Remove the unused context from CreateDebugLocation

This went unused in commit 88d874de63, part of #68965.
2021-01-14 18:00:29 +00:00
Mara Bos
c504e89bc7
Rollup merge of #80985 - ijackson:slice-strip-fix, r=jyn514
Fix stabilisation version of slice_strip

See https://github.com/rust-lang/rust/pull/77853#pullrequestreview-564921079

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-01-14 18:00:27 +00:00
Mara Bos
ce3bc76a86
Rollup merge of #80981 - bjorn3:bjorn3-patch-1, r=jonas-schievink
Fix -Cpasses=list and llvm version print with -vV

cc https://github.com/rust-lang/rust/pull/77975#issuecomment-759362933
2021-01-14 18:00:25 +00:00
Mara Bos
d5e55cee99
Rollup merge of #80980 - trevarj:patch-1, r=nagisa
Fixed incorrect doc comment

">" is right alignment, not left
2021-01-14 18:00:22 +00:00