Commit Graph

149735 Commits

Author SHA1 Message Date
bors
40c1623b16 Auto merge of #82639 - jyn514:stable-options, r=Mark-Simulacrum
Don't pass -Z unstable-options by default for UI tests

Unconditionally passing -Z unstable-options makes it impossible to test whether an option requires unstable-options or not.

This uncovered quite a lot of bugs, I'll open issues for each. These don't strictly need to be fixed before this is merged, it just makes the diff much larger because of the changes to diagnostics.

- https://github.com/rust-lang/rust/issues/82636
- https://github.com/rust-lang/rust/issues/82637
- https://github.com/rust-lang/rust/issues/82638
2021-06-10 12:47:54 +00:00
bors
0279cb11ed Auto merge of #85741 - tmiasko:ssa, r=nagisa
Use preorder traversal when checking for SSA locals

Traverse blocks in topological sort of dominance partial order, to ensure that
local analyzer correctly identifies locals that are already in static single
assignment form, while avoiding dependency on implicit numeric order of blocks.

When rebuilding the standard library, this change reduces the number of locals
that require an alloca from 62452 to 62348.
2021-06-10 10:06:58 +00:00
bors
c5fbcd35a8 Auto merge of #86186 - JohnTitor:rollup-upaw6wx, r=JohnTitor
Rollup of 7 pull requests

Successful merges:

 - #82037 (Make symbols stripping work on MacOS X)
 - #84687 (Multiple improvements to RwLocks)
 - #85997 (rustdoc: Print a warning if the diff when comparing to old nightlies is empty)
 - #86051 (Updated code examples and wording in move keyword documentation )
 - #86111 (fix off by one in `std::iter::Iterator` documentation)
 - #86113 (build doctests with lld if use-lld = true)
 - #86175 (update Miri)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-06-10 03:11:24 +00:00
Yuki Okushi
a6b7e1c121
Rollup merge of #86175 - RalfJung:miri, r=RalfJung
update Miri

We had some nice PRs land today, let's ship those. :)
Cc `@rust-lang/miri` r? `@ghost`
2021-06-10 11:02:16 +09:00
Yuki Okushi
f7aea23bd2
Rollup merge of #86113 - the8472:doctest-lld, r=Mark-Simulacrum
build doctests with lld if use-lld = true

results when running `./x.py test library/core --doc --stage 0`:

```
# OLD
test result: FAILED. 2844 passed; 6 failed; 28 ignored; 0 measured; 0 filtered out; finished in 21.13s

# NEW
test result: FAILED. 2844 passed; 6 failed; 28 ignored; 0 measured; 0 filtered out; finished in 11.92s
```
2021-06-10 11:02:15 +09:00
Yuki Okushi
6a292ebdcf
Rollup merge of #86111 - spookyvision:master, r=JohnTitor
fix off by one in `std::iter::Iterator` documentation

the range `(0..10)` is documented as "The even numbers from zero to ten." - should be ".. to nine".
2021-06-10 11:02:14 +09:00
Yuki Okushi
ceed619194
Rollup merge of #86051 - erer1243:update_move_keyword_docs, r=Mark-Simulacrum
Updated code examples and wording in move keyword documentation

Had a conversation with someone on the Rust Discord who was confused by the move keyword documentation. Some of the wording is odd sounding ("owned by value" - what else can something be owned by?). Also, some of the examples used Copy types when demonstrating move, leading to variables still being accessible in the outer scope after the move, contradicting the examples' comments.

I changed the move keyword documentation a bit, removing that odd wording and changing all the examples to use non-Copy types
2021-06-10 11:02:13 +09:00
Yuki Okushi
232e7a5e7a
Rollup merge of #85997 - jyn514:rustdoc-diff, r=Mark-Simulacrum
rustdoc: Print a warning if the diff when comparing to old nightlies is empty

This avoids confusing situations where it's unclear whether there's a
bug in the diff tool or not:

```
26: `@has` check failed
        `XPATH PATTERN` did not match
        // `@has` - '//code/a[`@href="{{channel}}/std/primitive.i32.html"]'` 'i32'

Encountered 6 errors

------------------------------------------

info: generating a diff against nightly rustdoc

failures:
    [rustdoc] rustdoc/primitive-reexport.rs
```
2021-06-10 11:02:12 +09:00
Yuki Okushi
578eb6d65f
Rollup merge of #84687 - a1phyr:improve_rwlock, r=m-ou-se
Multiple improvements to RwLocks

This PR replicates #77147, #77380 and #84650 on RWLocks :
- Split `sys_common::RWLock` in `StaticRWLock` and `MovableRWLock`
- Unbox rwlocks on some platforms (Windows, Wasm and unsupported)
- Simplify `RwLock::into_inner`

Notes to reviewers :
- For each target, I copied `MovableMutex` to guess if `MovableRWLock` should be boxed.
- ~A comment says that `StaticMutex` is not re-entrant, I don't understand why and I don't know whether it applies to `StaticRWLock`.~

r? `@m-ou-se`
2021-06-10 11:02:10 +09:00
Yuki Okushi
27e84b89da
Rollup merge of #82037 - calavera:strip_debuginfo_osx, r=petrochenkov
Make symbols stripping work on MacOS X

As reported in the [stabilization issue](https://github.com/rust-lang/rust/issues/72110), MacOS' linker doesn't support the `-s` and `-S` flags to strip symbols anymore. However, the os ships a separated tool to perform these operations.

This change allows the compiler to use that tool after a target has been compiled to strip symbols.

For rationale, see: https://github.com/rust-lang/rust/issues/72110#issuecomment-641169818
For option selection, see: https://www.unix.com/man-page/osx/1/strip/

Signed-off-by: David Calavera <david.calavera@gmail.com>
2021-06-10 11:02:01 +09:00
bors
1639a16ebf Auto merge of #85910 - cjgillot:no-meta-version, r=Aaron1011
Drop metadata_encoding_version.

Part of #85153

r? `@Aaron1011`
2021-06-10 00:39:25 +00:00
Ralf Jung
b757a5e828 update Miri 2021-06-09 21:06:09 +02:00
bors
eab201df70 Auto merge of #86003 - pnkfelix:issue-84297-revert-81238, r=Mark-Simulacrum
Make copy/copy_nonoverlapping fn's again

Make copy/copy_nonoverlapping fn's again, rather than intrinsics.

This a short-term change to address issue #84297.

It effectively reverts PRs #81167 #81238 (and part of #82967), #83091, and parts of #79684.
2021-06-09 16:47:05 +00:00
David Calavera
df0fc6daee Make symbols stripping work on MacOS X
As reported in the stabilization issue, MacOS' linker doesn't support the `-s` and `-S` flags to strip symbols anymore. However, the os ships a separated tool to perform these operations.

This change allows the compiler to use that tool after a target has been compiled to strip symbols.

For rationale, see: https://github.com/rust-lang/rust/issues/72110#issuecomment-641169818
For option selection, see: https://www.unix.com/man-page/osx/1/strip/

Signed-off-by: David Calavera <david.calavera@gmail.com>
2021-06-09 09:27:11 -07:00
bors
47d38752c6 Auto merge of #86150 - cjgillot:notable, r=michaelwoerister
Do not require the DefPathTable to construct the on-disk cache.

r? `@michaelwoerister`
2021-06-09 14:06:10 +00:00
bors
38bc9b9933 Auto merge of #85975 - the8472:revert-take-tra, r=scottmcm
Revert "implement TrustedRandomAccess for Take iterator adapter"

This reverts commit 37a5b515e9 (#83990).

The original change unintentionally caused side-effects from certain iterator chains combining `take`, `zip` and `next_back()` to be omitted which is observable by user code and thus likely a breaking change

Technically one could declare it not a breaking change since `Zip`'s API contract is silent about about its backwards iteration behavior but on the other hand there is nothing in the stable Iterator API that could justify the currently observable behavior. And either way, this impact wasn't noticed or discussed in the original PR.

Fixes #85969
2021-06-09 11:24:54 +00:00
bors
c4b5406981 Auto merge of #86118 - spastorino:tait-soundness-bug, r=nikomatsakis
Create different inference variables for different defining uses of TAITs

Fixes #73481

r? `@nikomatsakis`
cc `@oli-obk`
2021-06-09 09:00:16 +00:00
bors
d45d205d59 Auto merge of #86107 - Smittyvb:peephole-optim-eq-bool, r=wesleywiser
Peephole optimize `x == false` and `x != true`

This adds peephole optimizations to make `x == false`, `false == x`, `x != true`, and `true != x` get optimized to `!x` in the `instcombine` MIR pass. That pass currently handles `x == true` -> `x` already.
2021-06-09 06:06:06 +00:00
bors
c8381389ee Auto merge of #86160 - JohnTitor:rollup-8ark9x7, r=JohnTitor
Rollup of 11 pull requests

Successful merges:

 - #85676 (Fix documentation style inconsistencies for IP addresses)
 - #85715 (Document `From` impls in string.rs)
 - #85791 (Add `Ipv6Addr::is_unicast`)
 - #85957 (Display defaults on const params- rustdoc )
 - #85982 (Enable rustdoc to document safe wasm intrinsics)
 - #86121 (Forwarding implementation for Seek trait's stream_position method)
 - #86124 (Include macro name in 'local ambiguity' error)
 - #86128 (Refactor: Extract render_summary from render_impl.)
 - #86142 (Simplify proc_macro code using Bound::cloned().)
 - #86158 (Update books)
 - #86159 (Update cargo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-06-09 03:15:34 +00:00
Yuki Okushi
d8376f4865
Rollup merge of #86159 - ehuss:update-cargo, r=ehuss
Update cargo

11 commits in 0cecbd67323ca14a7eb6505900d0d7307b00355b..aa8b09297bb3156b849e73db48af4cd050492fe6
2021-06-01 20:09:13 +0000 to 2021-06-09 00:28:53 +0000
- Add `--prune` option for cargo-tree (rust-lang/cargo#9520)
- Fix typo in gitignore docs. (rust-lang/cargo#9556)
- Fix typos in command_prelude.rs (rust-lang/cargo#9552)
- Make clippy happy (rust-lang/cargo#9551)
- Remove some dead code. (rust-lang/cargo#9546)
- Add additional test for CJK progress width (rust-lang/cargo#9515)
- Pull in semver 1.0.3 'x' fix (rust-lang/cargo#9544)
- Add some tracking issues to unstable docs. (rust-lang/cargo#9540)
- Update documentation for include/exclude. (rust-lang/cargo#9538)
- Bump mdbook version for contrib guide. (rust-lang/cargo#9534)
- Replace deprecated `[replace]` references with `[patch]` (rust-lang/cargo#9533)
2021-06-09 12:04:10 +09:00
Yuki Okushi
e8c1cc855c
Rollup merge of #86158 - ehuss:update-books, r=ehuss
Update books

## reference

4 commits in 9c68af3ce6ccca2395e1868addef26a0542e9ddd..8f598e2af6c25b4a7ee88ef6a8196d9b8ea50ca8
2021-05-24 09:53:32 -0700 to 2021-06-01 19:00:46 +0100
- Add crate and module to glossary. (rust-lang-nursery/reference#1016)
- Fix type_length_limit example. (rust-lang-nursery/reference#1026)
- Rearrange HRTB grammar. (rust-lang-nursery/reference#1011)
- Revert "Temporarily remove pat_param." (rust-lang-nursery/reference#1010)

## rustc-dev-guide

6 commits in 50de7f0682adc5d95ce858fe6318d19b4b951553..c8da5bfd1c7c71d90ef1646f5e0a9f6609d5c78a
2021-05-20 15:02:20 +0200 to 2021-06-04 09:08:56 +0200
- Fix some links (rust-lang/rustc-dev-guide#1137)
- explain Miri engine vs Miri-the-tool
- Add more information about no_hash query modifier. (rust-lang/rustc-dev-guide#1133)
- improve section introduction
- not all tools require waiting for a nightly release before they can be fixed
- Describe the difference of rustc_lint vs rustc_lint_defs.
2021-06-09 12:04:09 +09:00
Yuki Okushi
3a9609b936
Rollup merge of #86142 - m-ou-se:proc-macro-subspan-bound-cloned-cleanup, r=petrochenkov
Simplify proc_macro code using Bound::cloned().
2021-06-09 12:04:08 +09:00
Yuki Okushi
e163e3c043
Rollup merge of #86128 - jsha:render-impl-into-mod, r=GuillaumeGomez
Refactor: Extract render_summary from render_impl.

This allows for a more readable straight-through logic in render_impl without need for a closure.

I think this will make #85970 a bit more of a straightforward change.

This is a pure refactoring. I've verified that the output of `x.py doc library/std` is byte-for-byte identical.

r? `@GuillaumeGomez`
2021-06-09 12:04:07 +09:00
Yuki Okushi
d7186a8efe
Rollup merge of #86124 - Aaron1011:ambig-macro-name, r=varkor
Include macro name in 'local ambiguity' error

Currently, we only point at the span of the macro argument. When the
macro call is itself generated by another macro, this can make it
difficult or impossible to determine which macro is responsible for
producing the error.
2021-06-09 12:04:06 +09:00
Yuki Okushi
c961a0fc88
Rollup merge of #86121 - nickshiling:forwarding_impl_for_seek_trait_stream_position, r=dtolnay
Forwarding implementation for Seek trait's stream_position method

Forwarding implementations for `Seek` trait's `stream_position` were missed when it was stabilized in `1.51.0`
2021-06-09 12:04:05 +09:00
Yuki Okushi
da1a4498ca
Rollup merge of #85982 - alexcrichton:doc-safe-wasm, r=jyn514
Enable rustdoc to document safe wasm intrinsics

This commit fixes an issue not found during #84988 where rustdoc is used
to document cross-platform intrinsics but it was requiring that
functions which use `#[target_feature]` are `unsafe` erroneously, even
if they're WebAssembly specific. Rustdoc today, for example, already has
a special case where it enables annotations like
`#[target_feature(enable = "simd128")]` on platforms other than
WebAssembly. The purpose of this commit is to relax the "require all
`#[target_feature]` functions are `unsafe`" requirement for all targets
whenever rustdoc is running, enabling all targets to fully document
other targets, such as WebAssembly, where intrinsics functions aren't
always `unsafe`.
2021-06-09 12:04:04 +09:00
Yuki Okushi
606feba5bb
Rollup merge of #85957 - BoxyUwU:rustdoc-const-generic-defaults, r=oli-obk
Display defaults on const params- rustdoc

previously rustdoc would render this struct declaration:
`pub struct Foo<const N: usize = 10>;`
as:
`pub struct Foo<const N: usize>;`
this PR changes it to render correctly
2021-06-09 12:04:03 +09:00
Yuki Okushi
3bc8221558
Rollup merge of #85791 - CDirkx:is_unicast, r=joshtriplett
Add `Ipv6Addr::is_unicast`

Adds an unstable utility method `Ipv6Addr::is_unicast` under the feature flag `ip` (tracking issue: #27709).

Added for completeness with the other unicast methods (see also https://github.com/rust-lang/rust/issues/85604#issuecomment-848220455) and opposite of `is_multicast`.
2021-06-09 12:04:01 +09:00
Yuki Okushi
58f4c0f949
Rollup merge of #85715 - fee1-dead:document-string, r=JohnTitor
Document `From` impls in string.rs
2021-06-09 12:03:59 +09:00
Yuki Okushi
e6763c966c
Rollup merge of #85676 - CDirkx:ip-style, r=JohnTitor
Fix documentation style inconsistencies for IP addresses

Pulled out of #85655 as it is unrelated. Fixes some inconsistencies in the docs for IP addresses:
- Currently some addresses are backticked, some are not, this PR backticks everything consistently. (looks better imo)
- Lowercase hex-literals are used when writing addresses.
2021-06-09 12:03:54 +09:00
Eric Huss
38c6d6c159 Update cargo 2021-06-08 19:38:25 -07:00
Eric Huss
7c08d5e87d Update books 2021-06-08 19:15:11 -07:00
Anatol Ulrich
acc65ccc78
Update library/core/src/iter/traits/iterator.rs
Co-authored-by: Yuki Okushi <jtitor@2k36.org>
2021-06-09 02:51:30 +02:00
Camille GILLOT
aeb050da9f Do not require the DefPathTable to construct the on-disk cache. 2021-06-08 22:23:03 +02:00
Santiago Pastorino
7b1e1c7333
add VecMap docs 2021-06-08 17:17:48 -03:00
Santiago Pastorino
cad762b1e2
Use impl FnMut directly as predicate type 2021-06-08 17:17:48 -03:00
Santiago Pastorino
ed94da14ed
Explicitly pass find arguments down the predicate so coercions can apply 2021-06-08 17:17:47 -03:00
Santiago Pastorino
0ad09f9386
Do not deconstruct OpaqueTypeKey to make the code more clear 2021-06-08 17:17:45 -03:00
Santiago Pastorino
ecd78e985e
defin_ty_def_id -> definition_ty_def_id 2021-06-08 16:45:44 -03:00
bors
ed597e7e19 Auto merge of #86139 - hyd-dev:miri, r=RalfJung
Update Miri

Fixes #86133.

r? `@RalfJung`
2021-06-08 18:33:51 +00:00
Mara Bos
58e0889bf5 Simplify proc_macro code using Bound::cloned(). 2021-06-08 16:31:50 +00:00
hyd-dev
18049647e1
Update Miri 2021-06-08 23:33:39 +08:00
Santiago Pastorino
f07412db41
Destructure OpaqueTypeKey in certain cases to simplify code 2021-06-08 10:13:54 -03:00
Santiago Pastorino
1278f3f295
Simplify code by using VecMap::get_by 2021-06-08 09:41:26 -03:00
Santiago Pastorino
dd56ec653c
Add VecMap::get_by(FnMut -> bool) 2021-06-08 09:40:58 -03:00
bors
a50d72158e Auto merge of #86127 - JohnTitor:rollup-0c6mp3j, r=JohnTitor
Rollup of 11 pull requests

Successful merges:

 - #85906 (Use `Iterator::find` instead of open-coding it)
 - #85951 (Update the documentation of `-C force-unwind-tables` for #83482)
 - #85985 (Clarify documentation of slice sorting methods)
 - #85989 (Remove rustfmt tests from top-level .gitattributes)
 - #86074 (Default panic message should print Box<dyn Any>)
 - #86078 (Type page font weight)
 - #86090 (⬆️ rust-analyzer)
 - #86095 (Search description codeblock)
 - #86096 (Comment out unused error codes and add description for E0316)
 - #86101 (Correct type signature in doc for Bound::as_mut)
 - #86103 (Remove lifetime hack)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-06-08 07:04:31 +00:00
Jacob Hoffman-Andrews
1c0ecd41ad Refactor: Extract render_summary from render_impl.
This allows for a more readable straight-through logic in render_impl
without need for a closure.
2021-06-07 21:40:56 -07:00
Yuki Okushi
b7fadfddcb
Rollup merge of #86103 - camsteffen:lifetime-hack, r=jackh726
Remove lifetime hack

It compiles without the hack. But I don't know why. I can't get the example in the referenced issue to compile...
2021-06-08 13:26:38 +09:00
Yuki Okushi
a416e05d27
Rollup merge of #86101 - glittershark:bound-as-mut-doc-fix, r=m-ou-se
Correct type signature in doc for Bound::as_mut

Thanks to ``@drmason13`` for pointing this out!
2021-06-08 13:26:37 +09:00
Yuki Okushi
2e8ffed861
Rollup merge of #86096 - FabianWolff:ec-E0316, r=GuillaumeGomez
Comment out unused error codes and add description for E0316

I have added an extended description of `E0316` and commented out a bunch of unused error codes to make clear the fact that they are no longer in use. You can check for yourself with
```shell
for ec in                                                \
    E0314 E0315   E0473 E0474 E0475   E0479 E0480 E0481  \
    E0483 E0484 E0485 E0486 E0487 E0488 E0489
do
    if [ ! -z "`grep -r $ec compiler/* --exclude-dir=rustc_error_codes`" ]
    then
        echo $ec
        false
    fi
done
```
i.e. these error codes appear nowhere in the compiler code and thus cannot be emitted.

r? ```@GuillaumeGomez```
2021-06-08 13:26:36 +09:00