]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #71591 - hermitcore:thread_create, r=hanna-kruppe
Dylan DPC [Wed, 6 May 2020 14:58:53 +0000 (16:58 +0200)]
Rollup merge of #71591 - hermitcore:thread_create, r=hanna-kruppe

use new interface to create threads on HermitCore

- the new interface allows to define the stack size
- increase the default stack size to 1 MByte

4 years agoRollup merge of #71269 - Mark-Simulacrum:sat-float-casts, r=nikic
Dylan DPC [Wed, 6 May 2020 14:58:50 +0000 (16:58 +0200)]
Rollup merge of #71269 - Mark-Simulacrum:sat-float-casts, r=nikic

Define UB in float-to-int casts to saturate

This closes #10184 by defining the behavior there to saturate infinities and values exceeding the integral range (on the lower or upper end). `NaN` is sent to zero.

4 years agoRemove warning about UB
Mark Rousskov [Tue, 21 Apr 2020 13:00:36 +0000 (09:00 -0400)]
Remove warning about UB

4 years agoFixup tests to test both const-eval and runtime
Mark Rousskov [Sun, 19 Apr 2020 15:53:51 +0000 (11:53 -0400)]
Fixup tests to test both const-eval and runtime

4 years agoPull in miri test cases
Mark Rousskov [Sat, 18 Apr 2020 22:43:08 +0000 (18:43 -0400)]
Pull in miri test cases

4 years agoDefine UB in float-to-int casts to saturate
Mark Rousskov [Sat, 18 Apr 2020 01:42:22 +0000 (21:42 -0400)]
Define UB in float-to-int casts to saturate

- Round to zero, and representable values cast directly.
- `NaN` goes to 0
- Values beyond the limits of the type are saturated to the "nearest value"
  (essentially rounding to zero, in some sense) in the integral type, so e.g.
  `f32::INFINITY` would go to `{u,i}N::MAX.`

4 years agoAuto merge of #71949 - Dylan-DPC:rollup-0gg02wd, r=Dylan-DPC
bors [Wed, 6 May 2020 11:24:13 +0000 (11:24 +0000)]
Auto merge of #71949 - Dylan-DPC:rollup-0gg02wd, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #71510 (Btreemap iter intertwined)
 - #71727 (SipHasher with keys initialized to 0 should just use new())
 - #71889 (Explain our RwLock implementation)
 - #71905 (Add command aliases from Cargo to x.py commands)
 - #71914 (Backport 1.43.1 release notes to master)
 - #71921 (explain the types used in the open64 call)

Failed merges:

r? @ghost

4 years agoRollup merge of #71921 - RalfJung:open-mode, r=hanna-kruppe
Dylan DPC [Wed, 6 May 2020 11:22:22 +0000 (13:22 +0200)]
Rollup merge of #71921 - RalfJung:open-mode, r=hanna-kruppe

explain the types used in the open64 call

Fixes https://github.com/rust-lang/rust/issues/71915, where I learned about this quirk. I don't actually know what I am talking about here. ;)

4 years agoRollup merge of #71914 - pietroalbini:relnotes-1.43.1, r=Mark-Simulacrum
Dylan DPC [Wed, 6 May 2020 11:22:21 +0000 (13:22 +0200)]
Rollup merge of #71914 - pietroalbini:relnotes-1.43.1, r=Mark-Simulacrum

Backport 1.43.1 release notes to master

r? @Mark-Simulacrum

4 years agoRollup merge of #71905 - mibac138:x-cmd-alias, r=Mark-Simulacrum
Dylan DPC [Wed, 6 May 2020 11:22:19 +0000 (13:22 +0200)]
Rollup merge of #71905 - mibac138:x-cmd-alias, r=Mark-Simulacrum

Add command aliases from Cargo to x.py commands

Fixes #71357

4 years agoRollup merge of #71889 - RalfJung:rwlock, r=Amanieu
Dylan DPC [Wed, 6 May 2020 11:22:17 +0000 (13:22 +0200)]
Rollup merge of #71889 - RalfJung:rwlock, r=Amanieu

Explain our RwLock implementation

Turns out that [with the latest POSIX docs](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_wrlock.html), our `RwLock` implementation is actually correct. However, we cannot fully rely on that due to bugs in older glibc (fix released in 2016). Update the comments to explain that.

I also clarified our Mutex docs a bit and fixed another instance of https://github.com/rust-lang/rust/pull/55865.

r? @Amanieu
Fixes https://github.com/rust-lang/rust/issues/53127

4 years agoRollup merge of #71727 - hbina:simplified_usage, r=Mark-Simulacrum
Dylan DPC [Wed, 6 May 2020 11:22:13 +0000 (13:22 +0200)]
Rollup merge of #71727 - hbina:simplified_usage, r=Mark-Simulacrum

SipHasher with keys initialized to 0 should just use new()

I believe that is what the `new()` is for, for good reasons.

4 years agoRollup merge of #71510 - ssomers:btreemap_iter_intertwined, r=Mark-Simulacrum
Dylan DPC [Wed, 6 May 2020 11:22:05 +0000 (13:22 +0200)]
Rollup merge of #71510 - ssomers:btreemap_iter_intertwined, r=Mark-Simulacrum

Btreemap iter intertwined

3 commits:

1. Introduced benchmarks for `BTreeMap::iter()`. Benchmarks named `iter_20` were of the whole iteration process, so I renamed them. Also the benchmarks of `range` that I wrote earlier weren't very good. I included an (awkwardly named) one that compares `iter()` to `range(..)` on the same set, because the contrast is surprising:
```
 name                                           ns/iter
 btree::map::range_unbounded_unbounded          28,176
 btree::map::range_unbounded_vs_iter            89,369
```
Both dig up the same pair of leaf edges. `range(..)` also checks that some keys are correctly ordered, the only thing `iter()` does more is to copy the map's length.

2. Slightly refactoring the code to what I find more readable (not in chronological order of discovery), boosts performance:
```
>cargo-benchcmp.exe benchcmp a1 a2 --threshold 5
 name                                   a1 ns/iter  a2 ns/iter  diff ns/iter   diff %  speedup
 btree::map::find_rand_100              18          17                    -1   -5.56%   x 1.06
 btree::map::first_and_last_10k         64          71                     7   10.94%   x 0.90
 btree::map::iter_0                     2,939       2,209               -730  -24.84%   x 1.33
 btree::map::iter_1                     6,845       2,696             -4,149  -60.61%   x 2.54
 btree::map::iter_100                   8,556       3,672             -4,884  -57.08%   x 2.33
 btree::map::iter_10k                   9,292       5,884             -3,408  -36.68%   x 1.58
 btree::map::iter_1m                    10,268      6,510             -3,758  -36.60%   x 1.58
 btree::map::iteration_mut_100000       478,575     453,050          -25,525   -5.33%   x 1.06
 btree::map::range_unbounded_unbounded  28,176      36,169             7,993   28.37%   x 0.78
 btree::map::range_unbounded_vs_iter    89,369      38,290           -51,079  -57.16%   x 2.33
 btree::set::clone_100_and_remove_all   4,801       4,245               -556  -11.58%   x 1.13
 btree::set::clone_10k_and_remove_all   529,450     496,030          -33,420   -6.31%   x 1.07
```
But you can tell from the `range_unbounded_*` lines that, despite an unwarranted, vengeful attack on the range_unbounded_unbounded benchmark, this change still doesn't allow `iter()` to catch up with `range(..)`.

3. I guess that `range(..)` copes so well because it intertwines the leftmost and rightmost descend towards leaf edges, doing the two root node accesses close together, perhaps exploiting a CPU's internal pipelining? So the third commit distils a version of `range_search` (which we can't use directly because of the `Ord` bound), and we get another boost:
```
cargo-benchcmp.exe benchcmp a2 a3 --threshold 5
 name                                   a2 ns/iter  a3 ns/iter  diff ns/iter   diff %  speedup
 btree::map::first_and_last_100         40          43                     3    7.50%   x 0.93
 btree::map::first_and_last_10k         71          64                    -7   -9.86%   x 1.11
 btree::map::iter_0                     2,209       1,719               -490  -22.18%   x 1.29
 btree::map::iter_1                     2,696       2,205               -491  -18.21%   x 1.22
 btree::map::iter_100                   3,672       2,943               -729  -19.85%   x 1.25
 btree::map::iter_10k                   5,884       3,929             -1,955  -33.23%   x 1.50
 btree::map::iter_1m                    6,510       5,532               -978  -15.02%   x 1.18
 btree::map::iteration_mut_100000       453,050     476,667           23,617    5.21%   x 0.95
 btree::map::range_included_excluded    405,075     371,297          -33,778   -8.34%   x 1.09
 btree::map::range_included_included    427,577     397,440          -30,137   -7.05%   x 1.08
 btree::map::range_unbounded_unbounded  36,169      28,175            -7,994  -22.10%   x 1.28
 btree::map::range_unbounded_vs_iter    38,290      30,838            -7,452  -19.46%   x 1.24
```
But I think this is just fake news from the microbenchmarking media. `iter()` is still trying to catch up with `range(..)`. And we can sure do without another function. So I would skip this 3rd commit.

r? @Mark-Simulacrum

4 years agoAuto merge of #69464 - Marwes:detach_undo_log, r=nikomatsakis
bors [Wed, 6 May 2020 07:03:31 +0000 (07:03 +0000)]
Auto merge of #69464 - Marwes:detach_undo_log, r=nikomatsakis

perf: Unify the undo log of all snapshot types

Extracted from #69218 and extended to all the current snapshot types.

Since snapshotting is such a frequent action in the compiler and many of the scopes execute so little work, the act of creating the snapshot and rolling back empty/small snapshots end up showing in perf. By unifying all the logs into one the creation of snapshots becomes significantly cheaper at the cost of some complexity when combining the log with the specific data structures that are being mutated.

Depends on https://github.com/rust-lang-nursery/ena/pull/29

4 years agoAuto merge of #71875 - Xanewok:update-rls, r=tmandry
bors [Tue, 5 May 2020 23:52:56 +0000 (23:52 +0000)]
Auto merge of #71875 - Xanewok:update-rls, r=tmandry

Update RLS

In addition to fixing the toolstate, this also changes the default
compilation model to the out-of-process one, which should hopefully
target considerable memory usage for long-running instances of the RLS.

Fixes #71753

r? @ghost

4 years agoUnify winapi features for tools
Tyler Mandry [Tue, 5 May 2020 19:50:58 +0000 (12:50 -0700)]
Unify winapi features for tools

4 years agoexplain the types used in the open64 call
Ralf Jung [Tue, 5 May 2020 14:43:57 +0000 (16:43 +0200)]
explain the types used in the open64 call

4 years agoUnify some syn 1.0 et al. features for tools
Igor Matuszewski [Tue, 5 May 2020 12:16:15 +0000 (14:16 +0200)]
Unify some syn 1.0 et al. features for tools

4 years agoUpdate RLS
Igor Matuszewski [Mon, 4 May 2020 12:51:31 +0000 (14:51 +0200)]
Update RLS

In addition to fixing the toolstate, this also changes the default
compilation model to the out-of-process one, which should hopefully
target considerable memory usage for long-running instances of the RLS.

4 years agoAuto merge of #71916 - Dylan-DPC:rollup-luj7zx3, r=Dylan-DPC
bors [Tue, 5 May 2020 11:05:18 +0000 (11:05 +0000)]
Auto merge of #71916 - Dylan-DPC:rollup-luj7zx3, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #69984 (Add Option to Force Unwind Tables)
 - #71830 (Remove clippy from some leftover lists of "possibly failing" tools)
 - #71894 (Suggest removing semicolon in last expression only if it's type is known)
 - #71897 (Improve docs for embed-bitcode and linker-plugin-lto)

Failed merges:

r? @ghost

4 years agoRollup merge of #71897 - alexcrichton:embed-bitcode-docs, r=nnethercote
Dylan DPC [Tue, 5 May 2020 10:55:13 +0000 (12:55 +0200)]
Rollup merge of #71897 - alexcrichton:embed-bitcode-docs, r=nnethercote

Improve docs for embed-bitcode and linker-plugin-lto

Follow-up from #71716 I wasn't able to add in time.

4 years agoRollup merge of #71894 - mibac138:semicolon-not-always-helpful, r=estebank
Dylan DPC [Tue, 5 May 2020 10:55:11 +0000 (12:55 +0200)]
Rollup merge of #71894 - mibac138:semicolon-not-always-helpful, r=estebank

Suggest removing semicolon in last expression only if it's type is known

Fixes #67971

Is there a syntax for explicitly checking if a note doesn't exist in test output? Something like `//~ !NOTE ...`

I believe r? @estebank deals with diagnostics.

4 years agoRollup merge of #71830 - oli-obk:subrepo_funness, r=Mark-Simulacrum
Dylan DPC [Tue, 5 May 2020 10:55:09 +0000 (12:55 +0200)]
Rollup merge of #71830 - oli-obk:subrepo_funness, r=Mark-Simulacrum

Remove clippy from some leftover lists of "possibly failing" tools

https://github.com/rust-lang/rust/pull/70655 successfully made clippy get built and tested on CI on every merge, but the lack of emitted toolstate info caused the toolstate to get updated to test-fail. We should remove clippy entirely from toolstate, as it now is always test-pass.

The changes made in this PR reflect what we do for `rustdoc`, which is our preexisting tool that is gated on CI.

r? @Mark-Simulacrum

4 years agoRollup merge of #69984 - lenary:lenary/force-uwtables, r=hanna-kruppe
Dylan DPC [Tue, 5 May 2020 10:55:08 +0000 (12:55 +0200)]
Rollup merge of #69984 - lenary:lenary/force-uwtables, r=hanna-kruppe

Add Option to Force Unwind Tables

When panic != unwind, `nounwind` is added to all functions for a target.
This can cause issues when a panic happens with RUST_BACKTRACE=1, as
there needs to be a way to reconstruct the backtrace. There are three
possible sources of this information: forcing frame pointers (for which
an option exists already), debug info (for which an option exists), or
unwind tables.

Especially for embedded devices, forcing frame pointers can have code
size overheads (RISC-V sees ~10% overheads, ARM sees ~2-3% overheads).
In production code, it can be the case that debug info is not kept, so it is useful
to provide this third option, unwind tables, that users can use to
reconstruct the call stack. Reconstructing this stack is harder than
with frame pointers, but it is still possible.

---

This came up in discussion on #69890, and turned out to be a fairly simple addition.

r? @hanna-kruppe

4 years agobackport 1.43.1 release notes
Josh Stone [Fri, 1 May 2020 20:18:15 +0000 (13:18 -0700)]
backport 1.43.1 release notes

4 years agoRestore the snapshot/rollback optimization for region constraints
Markus Westerlind [Tue, 28 Apr 2020 19:05:12 +0000 (21:05 +0200)]
Restore the snapshot/rollback optimization for region constraints

4 years agorefactor: Replace probe_fudge by an explict call for the lengths
Markus Westerlind [Tue, 28 Apr 2020 18:59:34 +0000 (20:59 +0200)]
refactor: Replace probe_fudge by an explict call for the lengths

4 years agorefactor: Move probe_fudge into fudge.rs
Markus Westerlind [Tue, 28 Apr 2020 18:46:02 +0000 (20:46 +0200)]
refactor: Move probe_fudge into fudge.rs

4 years agoImprove naming
Markus Westerlind [Fri, 17 Apr 2020 07:15:28 +0000 (09:15 +0200)]
Improve naming

4 years agoGenerate the UndoLog upcasts with a macro
Markus Westerlind [Fri, 17 Apr 2020 07:00:02 +0000 (09:00 +0200)]
Generate the UndoLog upcasts with a macro

4 years agoFix review comments
Markus Westerlind [Fri, 17 Apr 2020 06:54:28 +0000 (08:54 +0200)]
Fix review comments

4 years agoRebase and use ena 0.14
Markus Westerlind [Mon, 16 Mar 2020 15:43:03 +0000 (16:43 +0100)]
Rebase and use ena 0.14

4 years agorefactor: simplify
Markus Westerlind [Tue, 3 Mar 2020 09:23:04 +0000 (10:23 +0100)]
refactor: simplify

4 years agoPrevent modifications without an undo log
Markus Westerlind [Wed, 26 Feb 2020 09:43:24 +0000 (10:43 +0100)]
Prevent modifications without an undo log

4 years agoFix import
Markus Westerlind [Tue, 25 Feb 2020 22:08:29 +0000 (23:08 +0100)]
Fix import

4 years agorefactor: Extract the undo log to its own modules
Markus Westerlind [Tue, 25 Feb 2020 16:09:01 +0000 (17:09 +0100)]
refactor: Extract the undo log to its own modules

4 years agorefactor: Rename Logs to InferCtxtUndoLogs
Markus Westerlind [Tue, 25 Feb 2020 15:41:29 +0000 (16:41 +0100)]
refactor: Rename Logs to InferCtxtUndoLogs

4 years agosimplify
Markus Westerlind [Tue, 25 Feb 2020 14:39:01 +0000 (15:39 +0100)]
simplify

4 years agoperf: Merge region_obligations snapshotting into the undo log
Markus Westerlind [Tue, 25 Feb 2020 13:45:07 +0000 (14:45 +0100)]
perf: Merge region_obligations snapshotting into the undo log

4 years agoperf: Limit leak check snapshotting to probe_maybe_skip_leak_check
Markus Westerlind [Tue, 25 Feb 2020 13:31:07 +0000 (14:31 +0100)]
perf: Limit leak check snapshotting to probe_maybe_skip_leak_check

4 years agoperf: Lazily recive the Rollback argument in rollback_to
Markus Westerlind [Tue, 25 Feb 2020 13:08:34 +0000 (14:08 +0100)]
perf: Lazily recive the Rollback argument in rollback_to

4 years agoperf: Separate CombinedSnapshot into a FullSnapshot for probing
Markus Westerlind [Tue, 25 Feb 2020 12:32:58 +0000 (13:32 +0100)]
perf: Separate CombinedSnapshot into a FullSnapshot for probing

4 years agoMove projection_cache into the combined undo log
Markus Westerlind [Tue, 25 Feb 2020 12:08:38 +0000 (13:08 +0100)]
Move projection_cache into the combined undo log

4 years agoAllow SnapshotMap to have a separate undo_log
Markus Westerlind [Tue, 25 Feb 2020 09:29:47 +0000 (10:29 +0100)]
Allow SnapshotMap to have a separate undo_log

4 years agoMove region_constraint to the unified undo log
Markus Westerlind [Tue, 25 Feb 2020 08:47:07 +0000 (09:47 +0100)]
Move region_constraint to the unified undo log

4 years agoperf: Reduce snapshot/rollback overhead
Markus Westerlind [Mon, 24 Feb 2020 09:40:36 +0000 (10:40 +0100)]
perf: Reduce snapshot/rollback overhead

By merging the undo_log of all structures part of the snapshot the cost
of creating a snapshot becomes much cheaper. Since snapshots with no or
few changes are so frequent this ends up mattering more than the slight
overhead of dispatching on the variants that map to each field.

4 years agoAllow `hir().find` to return `None`
John Kåre Alsaker [Mon, 16 Mar 2020 18:17:40 +0000 (19:17 +0100)]
Allow `hir().find` to return `None`

4 years agorely on rdlock/wrlock not returning anything but the specified error codes
Ralf Jung [Tue, 5 May 2020 07:08:00 +0000 (09:08 +0200)]
rely on rdlock/wrlock not returning anything but the specified error codes

4 years agoAuto merge of #71846 - petrochenkov:fresh2, r=davidtwco
bors [Tue, 5 May 2020 06:01:08 +0000 (06:01 +0000)]
Auto merge of #71846 - petrochenkov:fresh2, r=davidtwco

resolve: Relax fresh binding disambiguation slightly to fix regression

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

4 years agoAuto merge of #71907 - Dylan-DPC:rollup-z8iaqlv, r=Dylan-DPC
bors [Tue, 5 May 2020 02:51:41 +0000 (02:51 +0000)]
Auto merge of #71907 - Dylan-DPC:rollup-z8iaqlv, r=Dylan-DPC

Rollup of 10 pull requests

Successful merges:

 - #71587 (Report cannot move errors in promoted MIR)
 - #71711 (Updates to some ignored tests)
 - #71845 (Add const examples)
 - #71878 (Add remove_current_as_list to LinkedList's CursorMut)
 - #71881 (Correctly handle UEFI targets as Windows-like when emitting sections for LLVM bitcode)
 - #71883 (add a missing "at" in a comment)
 - #71891 (¬∃x. ¬y => ∀x. y)
 - #71892 (Update btree_map::VacantEntry::insert docs to actually call insert)
 - #71902 (Suggest to add missing feature when using gated const features)
 - #71904 (fix typo in function name)

Failed merges:

r? @ghost

4 years agoSuggest removing semicolon in last expression only if it's type is known
mibac138 [Mon, 4 May 2020 16:33:05 +0000 (18:33 +0200)]
Suggest removing semicolon in last expression only if it's type is known

4 years agoRollup merge of #71904 - euclio:function-typo, r=jonas-schievink
Dylan DPC [Mon, 4 May 2020 23:49:52 +0000 (01:49 +0200)]
Rollup merge of #71904 - euclio:function-typo, r=jonas-schievink

fix typo in function name

Drive-by fix.

4 years agoRollup merge of #71902 - mibac138:const-feature-diag, r=varkor
Dylan DPC [Mon, 4 May 2020 23:49:51 +0000 (01:49 +0200)]
Rollup merge of #71902 - mibac138:const-feature-diag, r=varkor

Suggest to add missing feature when using gated const features

Fixes #71797

4 years agoRollup merge of #71892 - integer32llc:btreemap-entry-vacant-docs, r=jonas-schievink
Dylan DPC [Mon, 4 May 2020 23:49:49 +0000 (01:49 +0200)]
Rollup merge of #71892 - integer32llc:btreemap-entry-vacant-docs, r=jonas-schievink

Update btree_map::VacantEntry::insert docs to actually call insert

It looks like they were copied from the `or_insert` docs. This change
makes the example more like the hash_map::VacantEntry::insert docs.

4 years agoRollup merge of #71891 - lcnr:not-iter-any, r=Dylan-DPC
Dylan DPC [Mon, 4 May 2020 23:49:48 +0000 (01:49 +0200)]
Rollup merge of #71891 - lcnr:not-iter-any, r=Dylan-DPC

¬∃x. ¬y => ∀x. y

4 years agoRollup merge of #71883 - Dante-Broggi:patch-1, r=Dylan-DPC
Dylan DPC [Mon, 4 May 2020 23:49:46 +0000 (01:49 +0200)]
Rollup merge of #71883 - Dante-Broggi:patch-1, r=Dylan-DPC

add a missing "at" in a comment

4 years agoRollup merge of #71881 - IsaacWoods:master, r=petrochenkov
Dylan DPC [Mon, 4 May 2020 23:49:44 +0000 (01:49 +0200)]
Rollup merge of #71881 - IsaacWoods:master, r=petrochenkov

Correctly handle UEFI targets as Windows-like when emitting sections for LLVM bitcode

This handles UEFI handles when emitting inline assembly for sections containing LLVM bitcode. See details in #71880. I have locally confirmed that this change fixes compilation of projects using the `x86_64-unknown-uefi` target compiling with `cargo-xbuild`, but I am not very familiar with LLVM bitcode so this may not be the correct approach.

r? @alexcrichton as they wrote the initial LLVM bitcode emitting code?

4 years agoRollup merge of #71878 - main--:patch-2, r=Amanieu
Dylan DPC [Mon, 4 May 2020 23:49:43 +0000 (01:49 +0200)]
Rollup merge of #71878 - main--:patch-2, r=Amanieu

Add remove_current_as_list to LinkedList's CursorMut

The `remove_current` method only returns the inner `T` and deallocates the list node. This is unnecessary for move operations, where the element is going to be linked back into this (or even a different) `LinkedList`. The `remove_current_as_list` method avoids this by returning the unlinked list node as a new single-element `LinkedList` structure.

(per https://github.com/rust-lang/rust/issues/58533#issuecomment-623010157)

4 years agoRollup merge of #71845 - steveklabnik:add-const-examples, r=dtolnay
Dylan DPC [Mon, 4 May 2020 23:49:41 +0000 (01:49 +0200)]
Rollup merge of #71845 - steveklabnik:add-const-examples, r=dtolnay

Add const examples

I only added them to `std::f32` to get feedback on this approach before adding the other constants.

When looking at https://github.com/rust-lang/rust/pull/68952, I found the docs a little confusing. Unless you're intimately aware of what's going on here, I don't think it's super clear what is deprecated and what you're supposed to do instead. I think short examples really clarify what's meant here, so that's what I did.

4 years agoRollup merge of #71711 - Mark-Simulacrum:deignore-tests, r=nikomatsakis
Dylan DPC [Mon, 4 May 2020 23:49:37 +0000 (01:49 +0200)]
Rollup merge of #71711 - Mark-Simulacrum:deignore-tests, r=nikomatsakis

Updates to some ignored tests

This removes or fixes some ignored test cases.

cc #13745

4 years agoRollup merge of #71587 - matthewjasper:promoted-move-errors, r=nikomatsakis
Dylan DPC [Mon, 4 May 2020 23:49:32 +0000 (01:49 +0200)]
Rollup merge of #71587 - matthewjasper:promoted-move-errors, r=nikomatsakis

Report cannot move errors in promoted MIR

Closes #70934

4 years agoAdd command aliases from Cargo to x.py commands
mibac138 [Mon, 4 May 2020 22:31:37 +0000 (00:31 +0200)]
Add command aliases from Cargo to x.py commands

4 years agofix typo in function name
Andy Russell [Mon, 4 May 2020 22:27:23 +0000 (18:27 -0400)]
fix typo in function name

4 years agoSuggest to add missing feature when using gated const features
mibac138 [Mon, 4 May 2020 21:33:10 +0000 (23:33 +0200)]
Suggest to add missing feature when using gated const features

4 years agoImprove docs for embed-bitcode and linker-plugin-lto
Alex Crichton [Mon, 4 May 2020 20:45:06 +0000 (13:45 -0700)]
Improve docs for embed-bitcode and linker-plugin-lto

Follow-up from #71716 I wasn't able to add in time.

4 years agoUpdate btree_map::VacantEntry::insert docs to actually call insert
Carol (Nichols || Goulding) [Mon, 4 May 2020 19:49:11 +0000 (15:49 -0400)]
Update btree_map::VacantEntry::insert docs to actually call insert

It looks like they were copied from the `or_insert` docs. This change
makes the example more like the hash_map::VacantEntry::insert docs.

4 years agodouble neg
Bastian Kauschke [Mon, 4 May 2020 19:04:11 +0000 (21:04 +0200)]
double neg

4 years agoedit Mutex comment
Ralf Jung [Mon, 4 May 2020 18:47:46 +0000 (20:47 +0200)]
edit Mutex comment

4 years agoexplain our rwlock implementation (and fix a potential data race)
Ralf Jung [Mon, 4 May 2020 17:37:55 +0000 (19:37 +0200)]
explain our rwlock implementation (and fix a potential data race)

4 years agoAuto merge of #71879 - Dylan-DPC:rollup-n05awny, r=Dylan-DPC
bors [Mon, 4 May 2020 17:34:51 +0000 (17:34 +0000)]
Auto merge of #71879 - Dylan-DPC:rollup-n05awny, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #71038 (forbid `dyn Trait` in patterns)
 - #71697 (Added MIR constant propagation of Scalars into function call arguments)
 - #71773 (doc: misc rustdoc things)
 - #71810 (Do not try to find binop method on RHS `TyErr`)
 - #71877 (Use f64 in f64 examples)

Failed merges:

r? @ghost

4 years agoexpand comment on default mutex behavior
Ralf Jung [Mon, 4 May 2020 17:17:58 +0000 (19:17 +0200)]
expand comment on default mutex behavior

4 years agoadd a missing word
Dante Broggi [Mon, 4 May 2020 15:42:57 +0000 (11:42 -0400)]
add a missing word

4 years agoCorrectly handle UEFI targets as Windows-like when emitting sections for LLVM bitcode
Isaac Woods [Mon, 4 May 2020 15:27:46 +0000 (16:27 +0100)]
Correctly handle UEFI targets as Windows-like when emitting sections for LLVM bitcode

4 years agoRollup merge of #71877 - steveklabnik:small-example-fix, r=Mark-Simulacrum
Dylan DPC [Mon, 4 May 2020 14:15:41 +0000 (16:15 +0200)]
Rollup merge of #71877 - steveklabnik:small-example-fix, r=Mark-Simulacrum

Use f64 in f64 examples

I believe that this is a copy/paste error; this example was using f32,
but it's the docs for f64.

4 years agoRollup merge of #71810 - estebank:issue-71798, r=davidtwco
Dylan DPC [Mon, 4 May 2020 14:15:37 +0000 (16:15 +0200)]
Rollup merge of #71810 - estebank:issue-71798, r=davidtwco

Do not try to find binop method on RHS `TyErr`

Fix #71798.

4 years agoRollup merge of #71773 - tshepang:links, r=davidtwco
Dylan DPC [Mon, 4 May 2020 14:15:32 +0000 (16:15 +0200)]
Rollup merge of #71773 - tshepang:links, r=davidtwco

doc: misc rustdoc things

4 years agoRollup merge of #71697 - felix91gr:new_prop_into_fn_call, r=wesleywiser
Dylan DPC [Mon, 4 May 2020 14:15:28 +0000 (16:15 +0200)]
Rollup merge of #71697 - felix91gr:new_prop_into_fn_call, r=wesleywiser

Added MIR constant propagation of Scalars into function call arguments

Now for the function call arguments!

Caveats:
1. It's only being enabled at `mir-opt-2` or higher, because currently codegen gives performance regressions with this optimization.
2. Only propagates Scalars. Tuples and references (references are `Indirect`, right??) are not being propagated into as of this PR.
3. Maybe more tests would be nice?
4. I need (shamefully) to ask @wesleywiser to write in his words (or explain to me, and then I can write it down) why we want to ignore propagation into `ScalarPairs` and `Indirect` arguments.

r? @wesleywiser

4 years agoRollup merge of #71038 - lcnr:dyn_trait_structural_match, r=pnkfelix
Dylan DPC [Mon, 4 May 2020 14:15:24 +0000 (16:15 +0200)]
Rollup merge of #71038 - lcnr:dyn_trait_structural_match, r=pnkfelix

forbid `dyn Trait` in patterns

Do not allow `&dyn Trait` as a generic const parameters.
This also changes dyn trait in pattern from ICE to error.

closes #63322
closes #70972

r? @eddyb

4 years agoAuto merge of #71754 - alexcrichton:no-bitcode-in-cache, r=nnethercote
bors [Mon, 4 May 2020 14:14:55 +0000 (14:14 +0000)]
Auto merge of #71754 - alexcrichton:no-bitcode-in-cache, r=nnethercote

Don't copy bytecode files into the incr. comp. cache.

It's no longer necessary now that bitcode is embedded into object files.

This change meant that `WorkProductFileKind::Bytecode` is no longer
necessary, which means that type is no longer necessary, which allowed
several places in the code to become simpler.

This commit was written by @nnethercote in https://github.com/rust-lang/rust/pull/70458 but that didn't land. In the meantime though we managed to land it in https://github.com/rust-lang/rust/pull/71528 and that doesn't seem to be causing too many fires, so I'm re-sending this patch!

4 years agowhoops
main() [Mon, 4 May 2020 14:10:59 +0000 (16:10 +0200)]
whoops

4 years agoAdd remove_current_as_list to LinkedList's CursorMut
main() [Mon, 4 May 2020 13:53:02 +0000 (15:53 +0200)]
Add remove_current_as_list to LinkedList's CursorMut

The `remove_current` method only returns the inner `T` and deallocates the list node. This is unnecessary for move operations, where the element is going to be linked back into this (or even a different) `LinkedList`. The `remove_current_as_list` method avoids this by returning the unlinked list node as a new single-element `LinkedList` structure .

4 years agoUse f64 in f64 examples
Steve Klabnik [Mon, 4 May 2020 13:28:53 +0000 (08:28 -0500)]
Use f64 in f64 examples

I believe that this is a copy/paste error; this example was using f32,
but it's the docs for f64.

4 years agoAdd examples to int macros
Steve Klabnik [Mon, 4 May 2020 13:26:39 +0000 (08:26 -0500)]
Add examples to int macros

4 years agof64 examples
Steve Klabnik [Mon, 4 May 2020 13:14:38 +0000 (08:14 -0500)]
f64 examples

4 years agocorrect -> intended
Steve Klabnik [Mon, 4 May 2020 13:07:20 +0000 (08:07 -0500)]
correct -> intended

4 years agoadd some whitespace
Steve Klabnik [Sun, 3 May 2020 14:02:58 +0000 (09:02 -0500)]
add some whitespace

4 years agoAdd examples for std::f32 constants.
Steve Klabnik [Sun, 3 May 2020 14:01:14 +0000 (09:01 -0500)]
Add examples for std::f32 constants.

And also point people to use the associated constants of f32 instead.

4 years agoAdd Option to Force Unwind Tables
Sam Elliott [Mon, 4 May 2020 11:08:35 +0000 (12:08 +0100)]
Add Option to Force Unwind Tables

When panic != unwind, `nounwind` is added to all functions for a target.
This can cause issues when a panic happens with RUST_BACKTRACE=1, as
there needs to be a way to reconstruct the backtrace. There are three
possible sources of this information: forcing frame pointers (for which
an option exists already), debug info (for which an option exists), or
unwind tables.

Especially for embedded devices, forcing frame pointers can have code
size overheads (RISC-V sees ~10% overheads, ARM sees ~2-3% overheads).
In code, it can be the case that debug info is not kept, so it is useful
to provide this third option, unwind tables, that users can use to
reconstruct the call stack. Reconstructing this stack is harder than
with frame pointers, but it is still possible.

This commit adds a compiler option which allows a user to force the
addition of unwind tables. Unwind tables cannot be disabled on targets
that require them for correctness, or when using `-C panic=unwind`.

4 years agoAuto merge of #71751 - oli-obk:const_ice, r=RalfJung
bors [Mon, 4 May 2020 09:39:53 +0000 (09:39 +0000)]
Auto merge of #71751 - oli-obk:const_ice, r=RalfJung

Move recursion check for zsts back to read site instead of access check site

Reverts https://github.com/rust-lang/rust/pull/71140#discussion_r413709446

Fix #71612
Fix #71709

r? @RalfJung

4 years agoAuto merge of #71108 - estebank:suggest-proj-type-mismatch-constraint, r=oli-obk
bors [Mon, 4 May 2020 06:32:49 +0000 (06:32 +0000)]
Auto merge of #71108 - estebank:suggest-proj-type-mismatch-constraint, r=oli-obk

On type mismatch involving associated type, suggest constraint

When an associated type is found when a specific type was expected, if
possible provide a structured suggestion constraining the associated
type in a bound.

```
error[E0271]: type mismatch resolving `<T as Foo>::Y == i32`
  --> $DIR/associated-types-multiple-types-one-trait.rs:13:5
   |
LL |     want_y(t);
   |     ^^^^^^ expected `i32`, found associated type
...
LL | fn want_y<T:Foo<Y=i32>>(t: &T) { }
   |                 ----- required by this bound in `want_y`
   |
   = note:         expected type `i32`
           found associated type `<T as Foo>::Y`
help: consider constraining the associated type `<T as Foo>::Y` to `i32`
   |
LL | fn have_x_want_y<T:Foo<X=u32, Y = i32>>(t: &T)
   |                             ^^^^^^^^^
```

```
error[E0308]: mismatched types
  --> $DIR/trait-with-missing-associated-type-restriction.rs:12:9
   |
LL |     qux(x.func())
   |         ^^^^^^^^ expected `usize`, found associated type
   |
   = note:         expected type `usize`
           found associated type `<impl Trait as Trait>::A`
help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
   |
LL | fn foo(x: impl Trait<A = usize>) {
   |                     ^^^^^^^^^^
```

Fix #71035. Related to #70908.

4 years agoAuto merge of #71866 - Dylan-DPC:rollup-g9xqc8k, r=Dylan-DPC
bors [Mon, 4 May 2020 01:48:07 +0000 (01:48 +0000)]
Auto merge of #71866 - Dylan-DPC:rollup-g9xqc8k, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #71645 (Direct contributors to try stage 0 rustdoc first)
 - #71801 (Correctly check comparison operator in MIR typeck)
 - #71844 (List Clippy as a subtree, instead of a submodule)
 - #71864 (Update link in contributing.md)

Failed merges:

r? @ghost

4 years agoreview comment: use early return
Esteban Küber [Mon, 4 May 2020 01:20:53 +0000 (18:20 -0700)]
review comment: use early return

4 years agoRollup merge of #71864 - mibac138:patch-1, r=jonas-schievink
Dylan DPC [Mon, 4 May 2020 01:15:03 +0000 (03:15 +0200)]
Rollup merge of #71864 - mibac138:patch-1, r=jonas-schievink

Update link in contributing.md

4 years agoRollup merge of #71844 - flip1995:subtree_clippy_doc, r=oli-obk
Dylan DPC [Mon, 4 May 2020 01:15:01 +0000 (03:15 +0200)]
Rollup merge of #71844 - flip1995:subtree_clippy_doc, r=oli-obk

List Clippy as a subtree, instead of a submodule

r? @oli-obk

4 years agoRollup merge of #71801 - matthewjasper:operator-subtyping, r=varkor
Dylan DPC [Mon, 4 May 2020 01:14:57 +0000 (03:14 +0200)]
Rollup merge of #71801 - matthewjasper:operator-subtyping, r=varkor

Correctly check comparison operator in MIR typeck

The subtyping for comparisons between pointers was reversed in MIR typeck.
There also wasn't a check that comparisons between numeric types had matching types.

4 years agoRollup merge of #71645 - ecstatic-morse:readme-build-doc, r=Mark-Simulacrum
Dylan DPC [Mon, 4 May 2020 01:14:53 +0000 (03:14 +0200)]
Rollup merge of #71645 - ecstatic-morse:readme-build-doc, r=Mark-Simulacrum

Direct contributors to try stage 0 rustdoc first

After #71458, `./x.py doc --stage 0 src/libstd` is (empirically) able to build the standard library docs using the `rustdoc` packaged with the bootstrap compiler. This means that new contributors don't need to build the compiler to locally inspect small documentation fixes. This was a roadblock for me when I first started contributing to rust and something that still regularly annoys people. We should recommend that contributors give bootstrap `rustdoc` a try before building the whole compiler.

4 years agoreview comments: move logic to their own methods
Esteban Küber [Sun, 3 May 2020 23:42:54 +0000 (16:42 -0700)]
review comments: move logic to their own methods

4 years agoAuto merge of #71631 - RalfJung:miri-unleash-the-gates, r=oli-obk
bors [Sun, 3 May 2020 22:54:55 +0000 (22:54 +0000)]
Auto merge of #71631 - RalfJung:miri-unleash-the-gates, r=oli-obk

Miri: unleash all feature gates

IMO it is silly to unleash features that do not even have a feature gate yet, but not unleash features that do. The only thing this achieves is making unleashed mode annoying to use as we have to figure out the feature flags to enable (and not always do the error messages say what that flag is).

Given that the point of `-Z unleash-the-miri-inside-of-you` is to debug the Miri internals, I see no good reason for this extra hurdle. I cannot imagine a situation where we'd use that flag, realize the program also requires some feature gate, and then be like "oh I guess if this feature is unstable I will do something else". Instead, we'll always just add that flag to the code as well, so requiring the flag achieves nothing.

r? @oli-obk @ecstatic-morse
Fixes https://github.com/rust-lang/rust/issues/71630

4 years agoUpdate link in contributing.md
Michael [Sun, 3 May 2020 22:40:15 +0000 (00:40 +0200)]
Update link in contributing.md

4 years agofix rebase
Esteban Küber [Sun, 3 May 2020 21:09:58 +0000 (14:09 -0700)]
fix rebase