]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoRollup merge of #80874 - jyn514:intra-doc-docs, r=Manishearth
Yuki Okushi [Tue, 2 Mar 2021 12:23:13 +0000 (21:23 +0900)]
Rollup merge of #80874 - jyn514:intra-doc-docs, r=Manishearth

Update intra-doc link documentation to match the implementation

r? `@Manishearth`
cc `@camelid` `@m-ou-se`

Relevant PRs:
- https://github.com/rust-lang/rust/pull/74489
- https://github.com/rust-lang/rust/pull/80181
- https://github.com/rust-lang/rust/pull/76078
- https://github.com/rust-lang/rust/pull/77519
- https://github.com/rust-lang/rust/pull/73101

Relevant issues:
- https://github.com/rust-lang/rust/issues/78800
- https://github.com/rust-lang/rust/issues/77200
- https://github.com/rust-lang/rust/issues/77199 / https://github.com/rust-lang/rust/issues/54191/

I haven't documented things that I consider 'just bugs', like https://github.com/rust-lang/rust/issues/77732, but I have documented features that aren't implemented, like https://github.com/rust-lang/rust/issues/78800.

3 years agoRollup merge of #80189 - jyn514:convert-primitives, r=poliorcetics
Yuki Okushi [Tue, 2 Mar 2021 12:23:12 +0000 (21:23 +0900)]
Rollup merge of #80189 - jyn514:convert-primitives, r=poliorcetics

Convert primitives in the standard library to intra-doc links

Blocked on https://github.com/rust-lang/rust/pull/80181. I forgot that this needs to wait for the beta bump so the standard library can be documented with `doc --stage 0`.

Notably I didn't convert `core::slice` because it's like 50 links and I got scared :fearful:

3 years agoAuto merge of #82688 - GuillaumeGomez:rollup-b754t11, r=GuillaumeGomez
bors [Tue, 2 Mar 2021 05:21:25 +0000 (05:21 +0000)]
Auto merge of #82688 - GuillaumeGomez:rollup-b754t11, r=GuillaumeGomez

Rollup of 7 pull requests

Successful merges:

 - #80734 (check that first arg to `panic!()` in const is `&str`)
 - #81932 (Always compile rustdoc with debug logging enabled when `download-rustc` is set)
 - #82018 (Remove the dummy cache in `DocContext`; delete RenderInfo)
 - #82598 (Check stability and feature attributes in rustdoc)
 - #82655 (Highlight identifier span instead of whole pattern span in `unused` lint)
 - #82662 (Warn about unknown doc attributes)
 - #82676 (Change twice used large const table to static)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #82676 - dtolnay:powers, r=Mark-Simulacrum
Guillaume Gomez [Mon, 1 Mar 2021 23:50:11 +0000 (00:50 +0100)]
Rollup merge of #82676 - dtolnay:powers, r=Mark-Simulacrum

Change twice used large const table to static

This table is used twice in core::num::dec2flt::algorithm::power_of_ten. According to the semantics of const, a separate huge definition of the table is inlined at both places.

https://github.com/rust-lang/rust/blob/5233edcf1c7ee70ac25e4ec1115c3546f53d8a2d/library/core/src/num/dec2flt/algorithm.rs#L16-L22

Theoretically this gets cleaned up by optimization passes, but in practice I am experiencing a miscompile from LTO on this code. Making the table a static, which would only be defined a single time and not require attention from LTO, eliminates the miscompile and seems semantically more appropriate anyway. A separate bug report on the LTO bug is forthcoming.

Original addition of `const` is from #27307.

3 years agoRollup merge of #82662 - GuillaumeGomez:doc-attr-check, r=jyn514
Guillaume Gomez [Mon, 1 Mar 2021 23:50:10 +0000 (00:50 +0100)]
Rollup merge of #82662 - GuillaumeGomez:doc-attr-check, r=jyn514

Warn about unknown doc attributes

Fixes #82652.

For the text error, I decided to go for "invalid" instead of "unknown". What do you think?

r? `@jyn514`

3 years agoRollup merge of #82655 - SkiFire13:fix-issue-81314, r=estebank
Guillaume Gomez [Mon, 1 Mar 2021 23:50:09 +0000 (00:50 +0100)]
Rollup merge of #82655 - SkiFire13:fix-issue-81314, r=estebank

Highlight identifier span instead of whole pattern span in `unused` lint

Fixes #81314

This pretty much just changes the span highlighted in the lint from `pat_sp` to `ident.span`. There's however an exception, which is in patterns with shorthands like `Point { y, ref mut x }`, where a suggestion to change just `x` would be invalid; in those cases I had to keep the pattern span. Another option would be suggesting something like `Point { y, x: ref mut _x }`.

I also added a new test since there weren't any test that checked the `unused` lint with optional patterns.

3 years agoRollup merge of #82598 - GuillaumeGomez:rustdoc-rustc-pass, r=jyn514
Guillaume Gomez [Mon, 1 Mar 2021 23:50:08 +0000 (00:50 +0100)]
Rollup merge of #82598 - GuillaumeGomez:rustdoc-rustc-pass, r=jyn514

Check stability and feature attributes in rustdoc

Fixes #82588.

cc `@Nemo157` `@camelid`
r? `@jyn514`

3 years agoRollup merge of #82018 - jyn514:no-dummy-cache, r=camelid,GuillaumeGomez
Guillaume Gomez [Mon, 1 Mar 2021 23:50:07 +0000 (00:50 +0100)]
Rollup merge of #82018 - jyn514:no-dummy-cache, r=camelid,GuillaumeGomez

Remove the dummy cache in `DocContext`; delete RenderInfo

The same information is available everywhere; the only reason the dummy
cache was needed is because it was previously stored in three different
places. This consolidates the info a bit so the cache in `DocContext` is
used throughout. As a bonus, it also completely removes `RenderInfo`.

- Return a `Cache` from `run_global_ctxt`, not `RenderInfo`
- Remove the unused `render_info` from `run_renderer`
- Remove RenderInfo altogether

Helps with https://github.com/rust-lang/rust/pull/82014. The next step is to move the `populate()` call before the `collect_intra_doc_links` pass, which currently breaks because a) lots of the cache is populated in early passes, and b) intra_doc_links itself sets some info with `register_res`. I'm working on separate PR for that to avoid making too many big changes at once.

r? `@GuillaumeGomez`

3 years agoRollup merge of #81932 - jyn514:rustdoc-logging, r=Mark-Simulacrum
Guillaume Gomez [Mon, 1 Mar 2021 23:50:06 +0000 (00:50 +0100)]
Rollup merge of #81932 - jyn514:rustdoc-logging, r=Mark-Simulacrum

Always compile rustdoc with debug logging enabled when `download-rustc` is set

Previously, logging at DEBUG or below would always be silenced, because
rustc compiles tracing with the `static_max_level_info` feature. That
makes sense for release artifacts, but not for developing rustdoc.

Instead, this compiles two different versions of tracing: one in the
release artifacts, distributed in the sysroot, and a new version
compiled by rustdoc. Since `rustc_driver` is always linked to the
version of sysroot, this copy/pastes `init_env_logging` into rustdoc.

To avoid compiling an unnecessary version of tracing when
`download-rustc` isn't set, this adds a new `using-ci-artifacts`
feature for rustdoc and passes that feature in bootstrap.

Addresses https://github.com/rust-lang/rust/issues/81930. This builds on https://github.com/rust-lang/rust/pull/79540.

r? `@Mark-Simulacrum`

3 years agoRollup merge of #80734 - abonander:ab/issue-66693, r=oli-obk
Guillaume Gomez [Mon, 1 Mar 2021 23:50:04 +0000 (00:50 +0100)]
Rollup merge of #80734 - abonander:ab/issue-66693, r=oli-obk

check that first arg to `panic!()` in const is `&str`

closes #66693

~~TODO: regression test~~

cc `@RalfJung` for error message wording

3 years agoAuto merge of #82663 - jyn514:rollup-xh3cb0c, r=jyn514
bors [Mon, 1 Mar 2021 20:52:47 +0000 (20:52 +0000)]
Auto merge of #82663 - jyn514:rollup-xh3cb0c, r=jyn514

Rollup of 8 pull requests

Successful merges:

 - #81210 (BTreeMap: correct node size test case for choices of B)
 - #82360 (config.toml parsing error improvements)
 - #82428 (Update mdbook)
 - #82480 (Remove `ENABLE_DOWNLOAD_RUSTC` constant)
 - #82578 (Add some diagnostic items for Clippy)
 - #82620 (Apply lint restrictions from renamed lints)
 - #82635 (Fix typos in rustc_infer::infer::nll_relate)
 - #82645 (Clarify that SyncOnceCell::set blocks.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoAdd missing stability attributes in libstd
Guillaume Gomez [Sat, 27 Feb 2021 23:48:22 +0000 (00:48 +0100)]
Add missing stability attributes in libstd

3 years agoAdd tests for doc attribute check
Guillaume Gomez [Mon, 1 Mar 2021 16:13:06 +0000 (17:13 +0100)]
Add tests for doc attribute check

3 years agoValidate meta items used in \#\[doc(...)\]
Guillaume Gomez [Mon, 1 Mar 2021 16:12:39 +0000 (17:12 +0100)]
Validate meta items used in \#\[doc(...)\]

3 years agoChange twice used large const table to static
David Tolnay [Mon, 1 Mar 2021 07:51:30 +0000 (23:51 -0800)]
Change twice used large const table to static

This table is used twice in core::num::dec2flt::algorithm::power_of_ten.
According to the semantics of const, a separate huge definition of the
table is inlined at both places.

    fn power_of_ten(e: i16) -> Fp {
        assert!(e >= table::MIN_E);
        let i = e - table::MIN_E;
        let sig = table::POWERS.0[i as usize];
        let exp = table::POWERS.1[i as usize];
        Fp { f: sig, e: exp }
    }

Theoretically this gets cleaned up by optimization passes, but in
practice I am experiencing a miscompile from LTO on this code. Making
the table a static, which would only be defined a single time and not
require attention from LTO, eliminates the miscompile and seems
semantically more appropriate anyway. A separate bug report on the LTO
bug is forthcoming.

3 years agoAuto merge of #82587 - taiki-e:unaligned_references, r=oli-obk
bors [Mon, 1 Mar 2021 18:10:38 +0000 (18:10 +0000)]
Auto merge of #82587 - taiki-e:unaligned_references, r=oli-obk

Enable report_in_external_macro in unaligned_references

Fixes an issue where `unaligned_references` is not triggered in external macros, unlike `safe_packed_borrows`.
Also, given that this lint is planned to eventually change to hard error (#82525), it would make sense for this lint to be triggered for external macros as well.

See https://github.com/taiki-e/pin-project-lite/pull/55#issuecomment-787038676 and https://github.com/taiki-e/pin-project-lite/pull/55#issuecomment-787052874 for more.

r? `@RalfJung`

3 years agocheck that first arg to `panic!()` in const is `&str`
Austin Bonander [Tue, 5 Jan 2021 21:54:28 +0000 (13:54 -0800)]
check that first arg to `panic!()` in const is `&str`

3 years agoRollup merge of #82645 - rkjnsn:patch-3, r=Mark-Simulacrum
Joshua Nelson [Mon, 1 Mar 2021 16:25:11 +0000 (11:25 -0500)]
Rollup merge of #82645 - rkjnsn:patch-3, r=Mark-Simulacrum

Clarify that SyncOnceCell::set blocks.

Reading the discussion of this feature, I gained the mistaken impression that neither `set` nor `get` blocked, and thus calling `get` immediately after `set` was not guaranteed to succeed. It turns out that `set` *does* block, guaranteeing that the cell contains a value once `set` returns. This change updates the documentation to state that explicitly.

Happy to adjust the wording as desired.

3 years agoRollup merge of #82635 - pierwill:edit-infer, r=oli-obk
Joshua Nelson [Mon, 1 Mar 2021 16:25:10 +0000 (11:25 -0500)]
Rollup merge of #82635 - pierwill:edit-infer, r=oli-obk

Fix typos in rustc_infer::infer::nll_relate

3 years agoRollup merge of #82620 - jyn514:apply-renamed-lints, r=Manishearth
Joshua Nelson [Mon, 1 Mar 2021 16:25:08 +0000 (11:25 -0500)]
Rollup merge of #82620 - jyn514:apply-renamed-lints, r=Manishearth

Apply lint restrictions from renamed lints

Previously, if you denied the old name of a renamed lint, it would warn
about using the new name, but otherwise do nothing. Now, it will behave
the same as if you'd used the new name.

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

r? `@ehuss`

3 years agoRollup merge of #82578 - camsteffen:diag-items, r=oli-obk
Joshua Nelson [Mon, 1 Mar 2021 16:25:07 +0000 (11:25 -0500)]
Rollup merge of #82578 - camsteffen:diag-items, r=oli-obk

Add some diagnostic items for Clippy

3 years agoRollup merge of #82480 - jyn514:no-enable-constant, r=Mark-Simulacrum
Joshua Nelson [Mon, 1 Mar 2021 16:25:06 +0000 (11:25 -0500)]
Rollup merge of #82480 - jyn514:no-enable-constant, r=Mark-Simulacrum

Remove `ENABLE_DOWNLOAD_RUSTC` constant

`ENABLE_DOWNLOAD_RUSTC` was introduced as part of the MVP for `download-rustc` as a way not to rebuild artifacts that have already been downloaded. Unfortunately, it doesn't work very well:

- Steps are ignored by default, which makes it easy to leave out a step
that should be built. For example, the MVP forgot to enable any tests,
so it was only possible to *build* locally.
- It didn't work correctly even when it was enabled: calling
  `builder.ensure()` would completely ignore the constant and rebuild the
  step anyway. This has no obvious fix since `ensure()` has to return a
  `Step::Output`.

Instead, this handles `download-rustc` in `impl Step for Rustc` and
`impl Step for Std`, which to my knowledge are the only build steps that
don't first go through `impl Step for Sysroot` (`Rustc` is used for
the `rustc-dev` component).

See https://github.com/rust-lang/rust/pull/79540#discussion_r563350075 and https://github.com/rust-lang/rust/issues/81930 for further context.

Here are some example runs with these changes and `download-rustc`
enabled:

```
$ x.py build src/tools/clippy
Building stage1 tool clippy-driver (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 1m 09s
Building stage1 tool cargo-clippy (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.11s
$ x.py test src/tools/clippy
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
Building stage1 tool clippy-driver (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.09s
Building rustdoc for stage1 (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.28s
    Finished release [optimized] target(s) in 15.26s
     Running build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/deps/clippy_driver-8b407b140e0aa91c
test result: ok. 592 passed; 0 failed; 3 ignored; 0 measured; 0 filtered out
$ x.py build src/tools/rustdoc
Building rustdoc for stage1 (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 41.28s
Build completed successfully in 0:00:41
$ x.py test src/test/rustdoc-ui
Building stage0 tool compiletest (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.12s
Building rustdoc for stage1 (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.10s
test result: ok. 105 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 8.15s
$ x.py build compiler/rustc
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
Build completed successfully in 0:00:00
```

Note a few things:

- Clippy depends on stage1 rustc-dev artifacts, but rustc didn't have to
  be recompiled. Instead, the artifacts were copied automatically.
- All steps are always enabled. There is no danger of forgetting a step,
  since only the entrypoints have to handle `download-rustc`.
- Building the compiler (`compiler/rustc`) automatically does no work.

Helps with https://github.com/rust-lang/rust/issues/81930.

r? `@Mark-Simulacrum`

3 years agoRollup merge of #82428 - ehuss:update-mdbook, r=Mark-Simulacrum
Joshua Nelson [Mon, 1 Mar 2021 16:25:05 +0000 (11:25 -0500)]
Rollup merge of #82428 - ehuss:update-mdbook, r=Mark-Simulacrum

Update mdbook

Changelog is here: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-047

3 years agoRollup merge of #82360 - osa1:issue82317, r=Mark-Simulacrum
Joshua Nelson [Mon, 1 Mar 2021 16:25:03 +0000 (11:25 -0500)]
Rollup merge of #82360 - osa1:issue82317, r=Mark-Simulacrum

config.toml parsing error improvements

Improve error messages for musl-libdir and wasi-root keys. Previously
the parser would panic with `unwrap()`. Now it prints

      Target "wasm32-wasi" does not have a "wasi-root" key

(and similar for the `musl-libdir` field, which is used in target that
use musl)

Also update comments around wasi-root field to make it clear that the
field is only valid in wasm32-wasi target and needs to be moved to a
`[target.wasm32-wasi]` section to be valid.

Fixes #82317

---

r? `@Mark-Simulacrum`

3 years agoRollup merge of #81210 - ssomers:btree_fix_node_size_test, r=Mark-Simulacrum
Joshua Nelson [Mon, 1 Mar 2021 16:24:58 +0000 (11:24 -0500)]
Rollup merge of #81210 - ssomers:btree_fix_node_size_test, r=Mark-Simulacrum

BTreeMap: correct node size test case for choices of B

r? `@Mark-Simulacrum`

3 years agoUse diagnostic items in into_iter_collections
Cameron Steffen [Sat, 27 Feb 2021 03:17:29 +0000 (21:17 -0600)]
Use diagnostic items in into_iter_collections

3 years agoAdd diagnostic items
Cameron Steffen [Sat, 27 Feb 2021 03:23:42 +0000 (21:23 -0600)]
Add diagnostic items

3 years agoAuto merge of #82216 - kulikjak:fix-solaris-target, r=nagisa,Mark-Simulacrum
bors [Mon, 1 Mar 2021 14:34:19 +0000 (14:34 +0000)]
Auto merge of #82216 - kulikjak:fix-solaris-target, r=nagisa,Mark-Simulacrum

make x86_64-pc-solaris the default target for x86-64 Solaris

This change makes `x86_64-pc-solaris` the default compilation target for x86-64 Solaris/Illumos (based on [this exchange](https://github.com/rust-lang/rust/issues/68214#issuecomment-748042054) with `@varkor).`

I tried several ways of doing this (leveraging the alias support added with #61761 and improved/fixed with #80073) and found out that cross-compilation to the new one is by far the simplest way of doing this. It can be achieved by adding the following arguments: `--build x86_64-sun-solaris --host x86_64-pc-solaris --target x86_64-pc-solaris` and enabling the cross compilation with `PKG_CONFIG_ALLOW_CROSS=1` environment variable.

I also removed alias support altogether - `x86_64-pc-solaris` and `x86_64-sun-solaris` are now two separate targets. The problem with aliases is that even if rust internally knows that two are the same, other tools building with rust don't know that, resulting in build issues like the one with firefox mentioned [here](https://github.com/rust-lang/rust/issues/68214#issuecomment-746144229). I think that once the dust settles and `x86_64-pc-solaris` becomes the default, `x86_64-sun-solaris` can be removed.

If you agree with the above, I have two subsequent questions:
1. Is there a preferred way to display deprecation warnings when `x86_64-sun-solaris` is passed into the compiler as an argument? I am not sure whether target deprecation was done before.
2. Where would be the best way to document this change for those using rust on Solaris? Without the cross-compilation arguments (used once to build a new version), the build won't work. Should I add it into [RELEASES.md](https://github.com/rust-lang/rust/blob/master/RELEASES.md)?

Thanks!

3 years agoUpdate Docker to use the correct target
Jakub Kulik [Fri, 19 Feb 2021 10:50:30 +0000 (11:50 +0100)]
Update Docker to use the correct target

3 years agoUpdate supported platforms doc
Jakub Kulik [Wed, 17 Feb 2021 10:27:34 +0000 (11:27 +0100)]
Update supported platforms doc

3 years agoChange default Solaris x86 target to x86_64-pc-solaris
Jakub Kulik [Tue, 16 Feb 2021 14:02:04 +0000 (15:02 +0100)]
Change default Solaris x86 target to x86_64-pc-solaris

3 years agoAuto merge of #78360 - tmiasko:storage-markers, r=wesleywiser,oli-obk
bors [Mon, 1 Mar 2021 11:53:24 +0000 (11:53 +0000)]
Auto merge of #78360 - tmiasko:storage-markers, r=wesleywiser,oli-obk

Remove storage markers if they won't be used during code generation

The storage markers constitute a substantial portion of all MIR
statements. At the same time, for builds without any optimizations,
the storage markers have no further use during and after MIR
optimization phase.

If storage markers are not necessary for code generation, remove them.

3 years agoAuto merge of #82654 - JohnTitor:rollup-nkcdkzp, r=JohnTitor
bors [Mon, 1 Mar 2021 08:22:06 +0000 (08:22 +0000)]
Auto merge of #82654 - JohnTitor:rollup-nkcdkzp, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #82309 (Propagate RUSTDOCFLAGS in the environment when documenting)
 - #82403 (rustbuild: print out env vars on verbose rustc invocations)
 - #82507 (Rename the `tidy` binary to `rust-tidy`)
 - #82531 (Add GUI tests)
 - #82532 (Add `build.print_step_rusage` to config.toml)
 - #82543 (fix env var name in CI)
 - #82622 (Propagate `--test-args` for `x.py test src/tools/cargo`)
 - #82628 (Try to clarify GlobalAlloc::realloc documentation comment.)
 - #82630 (Fix a typo in the `find_anon_type` doc)
 - #82643 (Add more proc-macro attribute tests)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoAdd regression test
Giacomo Stevanato [Sun, 28 Feb 2021 20:03:44 +0000 (21:03 +0100)]
Add regression test

3 years agoconfig.toml error reporting:
Ömer Sinan Ağacan [Sun, 21 Feb 2021 07:18:56 +0000 (10:18 +0300)]
config.toml error reporting:

Improve error messages for musl-libdir and wasi-root keys. Previously
the parser would panic with `unwrap()`. Now it prints

      Target "wasm32-wasi" does not have a "wasi-root" key

(and similar for the `musl-libdir` field, which is used in target that
use musl)

Also update comments around wasi-root field to make it clear that the
field is only valid in wasm32-wasi target and needs to be moved to a
`[target.wasm32-wasi]` section to be valid.

Fixes #82317

3 years agoRollup merge of #82643 - Aaron1011:test-macro-attrs, r=petrochenkov
Yuki Okushi [Mon, 1 Mar 2021 06:07:40 +0000 (15:07 +0900)]
Rollup merge of #82643 - Aaron1011:test-macro-attrs, r=petrochenkov

Add more proc-macro attribute tests

r? `@petrochenkov`

3 years agoRollup merge of #82630 - JohnTitor:fix-typo-in-find-anon-type-doc, r=petrochenkov
Yuki Okushi [Mon, 1 Mar 2021 06:07:39 +0000 (15:07 +0900)]
Rollup merge of #82630 - JohnTitor:fix-typo-in-find-anon-type-doc, r=petrochenkov

Fix a typo in the `find_anon_type` doc

3 years agoRollup merge of #82628 - vakaras:realloc-doc, r=Mark-Simulacrum
Yuki Okushi [Mon, 1 Mar 2021 06:07:38 +0000 (15:07 +0900)]
Rollup merge of #82628 - vakaras:realloc-doc, r=Mark-Simulacrum

Try to clarify GlobalAlloc::realloc documentation comment.

This PR tries to improve the documentation of [GlobalAlloc::realloc](https://doc.rust-lang.org/alloc/alloc/trait.GlobalAlloc.html#method.realloc) with two aspects:

1. Explicitly mention that `realloc` preserves the contents of the original memory block.
2. Explicitly mention which layout should be used to deallocate the reallocated block.

3 years agoRollup merge of #82622 - jyn514:cargo-test-args, r=Mark-Simulacrum
Yuki Okushi [Mon, 1 Mar 2021 06:07:37 +0000 (15:07 +0900)]
Rollup merge of #82622 - jyn514:cargo-test-args, r=Mark-Simulacrum

Propagate `--test-args` for `x.py test src/tools/cargo`

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

3 years agoRollup merge of #82543 - klensy:skip-jobs, r=Mark-Simulacrum
Yuki Okushi [Mon, 1 Mar 2021 06:07:36 +0000 (15:07 +0900)]
Rollup merge of #82543 - klensy:skip-jobs, r=Mark-Simulacrum

fix env var name in CI

There no `SKIP_JOBS` env var name, only `SKIP_JOB`.

3 years agoRollup merge of #82532 - pnkfelix:rustbuild-print-step-rusage, r=Mark-Simulacrum
Yuki Okushi [Mon, 1 Mar 2021 06:07:35 +0000 (15:07 +0900)]
Rollup merge of #82532 - pnkfelix:rustbuild-print-step-rusage, r=Mark-Simulacrum

Add `build.print_step_rusage` to config.toml

Adds `build.print_step_rusage` to config.toml, which is meant to be an easy way to let compiler developers get feedback on the terminal during bootstrap about resource usage during each step.

The output is piggy-backed on `[PRINT-STEP-TIMINGS]`, mostly because the functionality seemed to naturally fit there in the overall control-flow and output structure (even if very little is shared between the implementations themselves).

Some sample output (from my Linux box, where I believe the `max rss` output to be somewhat trust-worthy...):

```
[...]
   Compiling regex v1.4.3
[RUSTC-TIMING] tempfile test:false 0.323 user: 1.418662 sys: 0.81767 max rss (kb): 182084 page reclaims: 26615 page faults: 0 fs block inputs: 0 fs block outputs: 2160 voluntary ctxt switches: 798 involuntary ctxt switches: 131
   Completed tempfile v3.1.0 in 0.3s
[RUSTC-TIMING] chalk_ir test:false 1.890 user: 1.893603 sys: 0.99663 max rss (kb): 239432 page reclaims: 32107 page faults: 0 fs block inputs: 0 fs block outputs: 25008 voluntary ctxt switches: 108 involuntary ctxt switches: 183
   Completed chalk-ir v0.55.0 in 1.9s
   Compiling rustc_data_structures v0.0.0 (/home/pnkfelix/Dev/Rust/rust.git/compiler/rustc_data_structures)
[RUSTC-TIMING] chrono test:false 1.244 user: 3.333198 sys: 0.134963 max rss (kb): 246612 page reclaims: 44857 page faults: 0 fs block inputs: 0 fs block outputs: 11704 voluntary ctxt switches: 1043 involuntary ctxt switches: 326
   Completed chrono v0.4.15 in 1.3s
[RUSTC-TIMING] rustc_rayon test:false 1.332 user: 1.763912 sys: 0.75996 max rss (kb): 239076 page reclaims: 35285 page faults: 0 fs block inputs: 0 fs block outputs: 19576 voluntary ctxt switches: 359 involuntary ctxt switches: 168
   Completed rustc-rayon v0.3.0 in 1.3s
   Compiling matchers v0.0.1
[RUSTC-TIMING] matchers test:false 0.100 user: 0.94495 sys: 0.15119 max rss (kb): 140076 page reclaims: 8200 page faults: 0 fs block inputs: 0 fs block outputs: 392 voluntary ctxt switches: 43 involuntary ctxt switches: 12
   Completed matchers v0.0.1 in 0.1s
[...]
```

3 years agoRollup merge of #82531 - GuillaumeGomez:gui-tests-start, r=jyn514
Yuki Okushi [Mon, 1 Mar 2021 06:07:34 +0000 (15:07 +0900)]
Rollup merge of #82531 - GuillaumeGomez:gui-tests-start, r=jyn514

Add GUI tests

The start of a lot more of GUI tests! \o/

One test is to ensure that the search input can always be selected in all rustdoc "modes" (mobile, tablet mostly) whereas the second checks the shortcuts.

r? `@jyn514`

3 years agoRollup merge of #82507 - jyn514:tidy-windows, r=Mark-Simulacrum
Yuki Okushi [Mon, 1 Mar 2021 06:07:33 +0000 (15:07 +0900)]
Rollup merge of #82507 - jyn514:tidy-windows, r=Mark-Simulacrum

Rename the `tidy` binary to `rust-tidy`

This avoids naming collisions, particularly on Windows where the
dynamic library variable is PATH and setting it causes the in-tree
`tidy` to take precedence over the HTML tidy used by compiletest.

This doesn't change the x.py interface in any way, it still accepts `x.py test tidy` and prints error messages about `tidy`. It only changes the name of the file on disk.

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

3 years agoRollup merge of #82403 - pnkfelix:rustbuild-emit-env-vars-on-verbose-verbose, r=Mark...
Yuki Okushi [Mon, 1 Mar 2021 06:07:32 +0000 (15:07 +0900)]
Rollup merge of #82403 - pnkfelix:rustbuild-emit-env-vars-on-verbose-verbose, r=Mark-Simulacrum

rustbuild: print out env vars on verbose rustc invocations

Print out environment variables related to Rust on sufficiently verbose rustc invocations.

Output is filtered via heuristic of only printing environment variables whose keys start with "RUST" or "CARGO." This filtering is mostly motivated by my not caring to see e.g. "PATH" in my own output, though it is also motivated as a way to try to avoid printing out personal secrets like github keys that people might have stored in their environments for better or for worse, especially since build output is often pasted into bug reports or gists.

Fix #38686.

<details>

<summary>Click here to see sample output</summary>

Sample output looks like:

```
...
      Fresh core v0.0.0 (/home/pnkfelix/Dev/Rust/rust.git/library/core)
rustc env[0]: "CARGO"="/home/pnkfelix/Dev/Rust/rust.git/objdir-default/build/x86_64-unknown-linux-gnu/stage0/bin/cargo"
rustc env[1]: "CARGO_CRATE_NAME"="core"
rustc env[2]: "CARGO_INCREMENTAL"="0"
rustc env[3]: "CARGO_MAKEFLAGS"="--jobserver-fds=5,6 -j --jobserver-auth=5,6 -j"
rustc env[4]: "CARGO_MANIFEST_DIR"="/home/pnkfelix/Dev/Rust/rust.git/library/core"
rustc env[5]: "CARGO_PKG_AUTHORS"="The Rust Project Developers"
rustc env[6]: "CARGO_PKG_DESCRIPTION"=""
rustc env[7]: "CARGO_PKG_HOMEPAGE"=""
rustc env[8]: "CARGO_PKG_LICENSE"=""
rustc env[9]: "CARGO_PKG_LICENSE_FILE"=""
rustc env[10]: "CARGO_PKG_NAME"="core"
rustc env[11]: "CARGO_PKG_REPOSITORY"=""
rustc env[12]: "CARGO_PKG_VERSION"="0.0.0"
rustc env[13]: "CARGO_PKG_VERSION_MAJOR"="0"
rustc env[14]: "CARGO_PKG_VERSION_MINOR"="0"
rustc env[15]: "CARGO_PKG_VERSION_PATCH"="0"
rustc env[16]: "CARGO_PKG_VERSION_PRE"=""
rustc env[17]: "CARGO_PROFILE_RELEASE_CODEGEN_UNITS"="256"
rustc env[18]: "CARGO_PROFILE_RELEASE_DEBUG"="0"
rustc env[19]: "CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS"="false"
rustc env[20]: "CARGO_TARGET_DIR"="/home/pnkfelix/Dev/Rust/rust.git/objdir-default/build/x86_64-unknown-linux-gnu/stage0-std"
rustc env[21]: "RUSTBUILD_NATIVE_DIR"="/home/pnkfelix/Dev/Rust/rust.git/objdir-default/build/x86_64-unknown-linux-gnu/native"
rustc env[22]: "RUSTC"="/home/pnkfelix/Dev/Rust/rust.git/objdir-default/build/bootstrap/debug/rustc"
rustc env[23]: "RUSTC_BOOTSTRAP"="1"
rustc env[24]: "RUSTC_BREAK_ON_ICE"="1"
rustc env[25]: "RUSTC_ERROR_METADATA_DST"="/home/pnkfelix/Dev/Rust/rust.git/objdir-default/build/tmp/extended-error-metadata"
rustc env[26]: "RUSTC_FORCE_UNSTABLE"="1"
rustc env[27]: "RUSTC_INSTALL_BINDIR"="bin"
rustc env[28]: "RUSTC_LIBDIR"="/home/pnkfelix/Dev/Rust/rust.git/objdir-default/build/x86_64-unknown-linux-gnu/stage0/lib"
rustc env[29]: "RUSTC_LINT_FLAGS"="-Wrust_2018_idioms -Wunused_lifetimes -Dwarnings"
rustc env[30]: "RUSTC_PRINT_STEP_TIMINGS"="1"
rustc env[31]: "RUSTC_REAL"="/home/pnkfelix/Dev/Rust/rust.git/objdir-default/build/x86_64-unknown-linux-gnu/stage0/bin/rustc"
rustc env[32]: "RUSTC_SNAPSHOT"="/home/pnkfelix/Dev/Rust/rust.git/objdir-default/build/x86_64-unknown-linux-gnu/stage0/bin/rustc"
rustc env[33]: "RUSTC_SNAPSHOT_LIBDIR"="/home/pnkfelix/Dev/Rust/rust.git/objdir-default/build/x86_64-unknown-linux-gnu/stage0/lib"
rustc env[34]: "RUSTC_STAGE"="0"
rustc env[35]: "RUSTC_SYSROOT"="/home/pnkfelix/Dev/Rust/rust.git/objdir-default/build/x86_64-unknown-linux-gnu/stage0-sysroot"
rustc env[36]: "RUSTC_VERBOSE"="2"
rustc env[37]: "RUSTDOC"="/home/pnkfelix/Dev/Rust/rust.git/objdir-default/build/bootstrap/debug/rustdoc"
rustc env[38]: "RUSTDOCFLAGS"="--cfg=bootstrap -Dwarnings -Winvalid_codeblock_attributes --crate-version 1.52.0-dev"
rustc env[39]: "RUSTDOC_REAL"="/path/to/nowhere/rustdoc/not/required"
rustc env[40]: "RUSTFLAGS"="--cfg=bootstrap -Zmacro-backtrace -Clink-args=-Wl,-rpath,$ORIGIN/../lib -Cprefer-dynamic"
rustc env[41]: "RUST_COMPILER_RT_ROOT"="/home/pnkfelix/Dev/Rust/rust.git/src/llvm-project/compiler-rt"
rustc env[42]: "RUST_TEST_THREADS"="128"
rustc working directory: /home/pnkfelix/Dev/Rust/rust.git
rustc command: "LD_LIBRARY_PATH"="/home/pnkfelix/Dev/Rust/rust.git/objdir-default/build/x86_64-unknown-linux-gnu/stage0/lib:/home/pnkfelix/Dev/Rust/rust.git/objdi\
r-default/build/x86_64-unknown-linux-gnu/stage0-std/release/deps:/home/pnkfelix/Dev/Rust/rust.git/objdir-default/build/x86_64-unknown-linux-gnu/stage0/lib" "/home\
/pnkfelix/Dev/Rust/rust.git/objdir-default/build/x86_64-unknown-linux-gnu/stage0/bin/rustc" "--crate-name" "core" "--edition=2018" "library/core/src/lib.rs" "--er\
ror-format=json" "--json=diagnostic-rendered-ansi,artifacts" "--crate-type" "lib" "--emit=dep-info,metadata,link" "-C" "opt-level=3" "-C" "embed-bitcode=no" "-C" \
"codegen-units=256" "-C" "debuginfo=0" "-C" "metadata=6748933694d8be19" "-C" "extra-filename=-6748933694d8be19" "--out-dir" "/home/pnkfelix/Dev/Rust/rust.git/objd\
ir-default/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps" "--target" "x86_64-unknown-linux-gnu" "-L" "dependency=/home/pnkfelix/\
Dev/Rust/rust.git/objdir-default/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps" "-L" "dependency=/home/pnkfelix/Dev/Rust/rust.gi\
t/objdir-default/build/x86_64-unknown-linux-gnu/stage0-std/release/deps" "--cfg=bootstrap" "-Zmacro-backtrace" "-Clink-args=-Wl,-rpath,$ORIGIN/../lib" "-Cprefer-d\
ynamic" "-Z" "binary-dep-depinfo" "-Wrust_2018_idioms" "-Wunused_lifetimes" "-Dwarnings" "--sysroot" "/home/pnkfelix/Dev/Rust/rust.git/objdir-default/build/x86_64\
-unknown-linux-gnu/stage0-sysroot" "-Z" "force-unstable-if-unmarked"
...
```

3 years agoRollup merge of #82309 - jyn514:rustdocflags, r=Mark-Simulacrum
Yuki Okushi [Mon, 1 Mar 2021 06:07:31 +0000 (15:07 +0900)]
Rollup merge of #82309 - jyn514:rustdocflags, r=Mark-Simulacrum

Propagate RUSTDOCFLAGS in the environment when documenting

Previously, RUSTDOCFLAGS would get overriden when bootstrap set
`RUSTDOCFLAGS` itself. Propagate the flag manually, using the same logic
as `RUSTFLAGS`.

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

3 years agoAuto merge of #82440 - ssomers:btree_fix_casts, r=Mark-Simulacrum
bors [Mon, 1 Mar 2021 05:39:01 +0000 (05:39 +0000)]
Auto merge of #82440 - ssomers:btree_fix_casts, r=Mark-Simulacrum

BTree: no longer define impossible casts

Casts to leaf to internal only make sense when the original has a chance of being the thing it's cast to.

r? `@Mark-Simulacrum`

3 years agoRemove `krate.version`; fix `crate_version` in JSON
Joshua Nelson [Thu, 25 Feb 2021 05:16:47 +0000 (00:16 -0500)]
Remove `krate.version`; fix `crate_version` in JSON

Previously, `JsonRenderer::after_krate` called `krate.version.clone()`.
The problem was it did that after the version was already moved into the
cache, so it would always be None. The fix was to get the version from
the cache instead.

3 years agoRemove unused `RenderInfo` struct
Joshua Nelson [Fri, 12 Feb 2021 05:03:24 +0000 (00:03 -0500)]
Remove unused `RenderInfo` struct

3 years agoRemove the dummy cache in `DocContext`
Joshua Nelson [Fri, 12 Feb 2021 02:29:22 +0000 (21:29 -0500)]
Remove the dummy cache in `DocContext`

The same information is available everywhere; the only reason the dummy
cache was needed is because it waas previously stored in three different
places. This consolidates the info a bit so the cache in `DocContext` is
used throughout. As a bonus, it means `renderinfo` is used much much
less.

- Return a `Cache` from `run_global_ctxt`, not `RenderInfo`
- Remove the unused `render_info` from `run_renderer`
- Remove RefCell around `inlined`
- Add intra-doc links

3 years agoAdd more proc-macro attribute tests
Aaron Hill [Sun, 28 Feb 2021 19:51:44 +0000 (14:51 -0500)]
Add more proc-macro attribute tests

3 years agoRemove deleted pass from rustdoc test suite
Joshua Nelson [Mon, 1 Mar 2021 02:59:43 +0000 (21:59 -0500)]
Remove deleted pass from rustdoc test suite

`src/test/rustdoc-ui/deprecated-attrs.rs`
tells rustdoc to run the `collapse-docs` pass, which no longer exists
(it was removed in https://github.com/rust-lang/rust/pull/80261).
Rustdoc doesn't actually give a proper diagnostic here; instead it
prints an `error!` log. Now that tracing is compiled unconditionally,
the log is now being emitted by default, because it's at the error
level.

rustdoc shouldn't be using `error!` logging for diagnostics in the first
place, but in the meantime this change gets the testsuite to pass.

3 years agoAlways compile rustdoc with debug logging enabled when `download-rustc` is set
Joshua Nelson [Mon, 28 Dec 2020 18:28:29 +0000 (13:28 -0500)]
Always compile rustdoc with debug logging enabled when `download-rustc` is set

Previously, logging at DEBUG or below would always be silenced, because
rustc compiles tracing with the `static_max_level_info` feature. That
makes sense for release artifacts, but not for developing rustdoc.

Instead, this compiles two different versions of tracing: one in the
release artifacts, distributed in the sysroot, and a new version
compiled by rustdoc. Since `rustc_driver` is always linked to the
version of sysroot, this copy/pastes `init_env_logging` into rustdoc.

The builds the second version of tracing unconditionally; see the code
for details on why.

3 years agoAuto merge of #81094 - ssomers:btree_drainy_refactor_3, r=Mark-Simulacrum
bors [Mon, 1 Mar 2021 02:48:29 +0000 (02:48 +0000)]
Auto merge of #81094 - ssomers:btree_drainy_refactor_3, r=Mark-Simulacrum

BTreeMap: split up range_search into two stages

`range_search` expects the caller to pass the same root twice and starts searching a node for both bounds of a range. It's not very clear that in the early iterations, it searches twice in the same node. This PR splits that search up in an initial `find_leaf_edges_spanning_range` that postpones aliasing until the last second, and a second phase for continuing the search for the range in the each subtree independently (`find_lower_bound_edge` & `find_upper_bound_edge`), which greatly helps for use in #81075. It also moves those functions over to the search module.

r? `@Mark-Simulacrum`

3 years agoAuto merge of #82601 - terhechte:catalyst-support-m1-fix, r=petrochenkov
bors [Mon, 1 Mar 2021 00:07:29 +0000 (00:07 +0000)]
Auto merge of #82601 - terhechte:catalyst-support-m1-fix, r=petrochenkov

Fixed support for macOS Catalyst on ARM64

When I initially added Arm64 Catalyst support in https://github.com/rust-lang/rust/pull/77484 I had access to a DTK. However, while waiting to merge the PR some other changes were merged which caused conflicts in the branch. When fixing those conflicts I had no access to the DTK anymore and didn't try out if the resulting binaries did indeed work on Apple Silicon. I finally have a M1 and I realized that some small changes were necessary to support Apple Silicon. This PR adds the required changes. I've been running binaries generated with this branch for some time now and they work without issues.

3 years agoBless some tests
Giacomo Stevanato [Sun, 28 Feb 2021 20:03:36 +0000 (21:03 +0100)]
Bless some tests

3 years agoUse identifier's span in unused lint
Giacomo Stevanato [Sun, 28 Feb 2021 19:44:54 +0000 (20:44 +0100)]
Use identifier's span in unused lint

3 years agoAdd GUI tests
Guillaume Gomez [Thu, 25 Feb 2021 21:05:02 +0000 (22:05 +0100)]
Add GUI tests

3 years agoClarify that SyncOnceCell::set blocks.
Erik Jensen [Sun, 28 Feb 2021 20:57:38 +0000 (12:57 -0800)]
Clarify that SyncOnceCell::set blocks.

Reading the discussion of this feature, I gained the mistaken impression that neither `set` nor `get` blocked, and thus calling `get` immediately after `set` was not guaranteed to succeed. It turns out that `set` *does* block, guaranteeing that the cell contains a value once `set` returns. This change updates the documentation to state that explicitly.

3 years agoAuto merge of #81349 - jyn514:blanket-impls-cleanup, r=lcnr
bors [Sun, 28 Feb 2021 19:19:09 +0000 (19:19 +0000)]
Auto merge of #81349 - jyn514:blanket-impls-cleanup, r=lcnr

Remove unnecessary `self_ty` parameter to `get_blanket_impls`

It can be calculated when necessary at the callsite, there's no need to
pass it separately.

This also renames `param_env_def_id` to `item_def_id`.

cc `@eddyb`

3 years agoFix typos in rustc_infer::infer::nll_relate
pierwill [Sun, 28 Feb 2021 18:10:58 +0000 (10:10 -0800)]
Fix typos in rustc_infer::infer::nll_relate

3 years agoRemove unnecessary `self_ty` parameter to `get_blanket_impls`
Joshua Nelson [Sun, 24 Jan 2021 18:42:14 +0000 (13:42 -0500)]
Remove unnecessary `self_ty` parameter to `get_blanket_impls`

It can be calculated when necessary at the callsite, there's no need to
pass it separately.

This also renames `param_env_def_id` to `item_def_id`.

3 years agoAuto merge of #82560 - tspiteri:releases-typo, r=ehuss
bors [Sun, 28 Feb 2021 15:39:41 +0000 (15:39 +0000)]
Auto merge of #82560 - tspiteri:releases-typo, r=ehuss

fix typo in RELEASES.md

3 years agoFix a typo in the `find_anon_type` doc
Yuki Okushi [Sun, 28 Feb 2021 14:10:55 +0000 (23:10 +0900)]
Fix a typo in the `find_anon_type` doc

3 years agoTry to clarify GlobalAlloc::realloc documentation comment.
Vytautas Astrauskas [Sun, 28 Feb 2021 13:30:26 +0000 (14:30 +0100)]
Try to clarify GlobalAlloc::realloc documentation comment.

3 years agoAuto merge of #82603 - RalfJung:miri, r=RalfJung
bors [Sun, 28 Feb 2021 12:53:39 +0000 (12:53 +0000)]
Auto merge of #82603 - RalfJung:miri, r=RalfJung

update Miri

Pulls in a fix for unnecessary rebuilds that basically breaks Playground.

3 years agoupdate Miri
Ralf Jung [Sun, 28 Feb 2021 11:07:53 +0000 (12:07 +0100)]
update Miri

3 years agoAuto merge of #82350 - ehuss:test-chapter, r=jyn514
bors [Sun, 28 Feb 2021 09:18:27 +0000 (09:18 +0000)]
Auto merge of #82350 - ehuss:test-chapter, r=jyn514

Add a chapter on the test harness.

There isn't really any online documentation on the test harness, so this adds a chapter to the rustc book which provides information on how the harness works and details on the command-line options.

3 years agoAuto merge of #82605 - cuviper:issue81051, r=nikic
bors [Sun, 28 Feb 2021 06:37:18 +0000 (06:37 +0000)]
Auto merge of #82605 - cuviper:issue81051, r=nikic

Revert LLVM D81803 because it broke Windows 7

This submodule update reverts <https://reviews.llvm.org/D81803>.

While that change is meant to fix a real bug, [LLVM PR42623], it caused
new permission errors on Windows 7 that make it unable to build any
archives. This is probably the same root cause as [LLVM PR48378].

Fixes #81051. We'll file a new Rust issue to track the LLVM resolution.

[LLVM PR42623]: https://bugs.llvm.org/show_bug.cgi?id=42623
[LLVM PR48378]: https://bugs.llvm.org/show_bug.cgi?id=48378

3 years agoApply lint restrictions from renamed lints
Joshua Nelson [Sun, 28 Feb 2021 05:12:54 +0000 (00:12 -0500)]
Apply lint restrictions from renamed lints

Previously, if you denied the old name of a renamed lint, it would warn
about using the new name, but otherwise do nothing. Now, it will behave
the same as if you'd used the new name.

3 years agoPropagate `--test-args` for `x.py test src/tools/cargo`
Joshua Nelson [Sun, 28 Feb 2021 06:00:26 +0000 (01:00 -0500)]
Propagate `--test-args` for `x.py test src/tools/cargo`

3 years agoAuto merge of #82594 - nagisa:nagisa/remove-rumprun, r=petrochenkov
bors [Sun, 28 Feb 2021 03:56:16 +0000 (03:56 +0000)]
Auto merge of #82594 - nagisa:nagisa/remove-rumprun, r=petrochenkov

Remove the x86_64-rumprun-netbsd target

Herein we remove the target from the compiler and the code from libstd intended to support the now-defunct rumprun project.

Closes #81514

3 years agoAuto merge of #82611 - Dylan-DPC:rollup-l7xlpks, r=Dylan-DPC
bors [Sun, 28 Feb 2021 01:15:16 +0000 (01:15 +0000)]
Auto merge of #82611 - Dylan-DPC:rollup-l7xlpks, r=Dylan-DPC

Rollup of 11 pull requests

Successful merges:

 - #81856 (Suggest character encoding is incorrect when encountering random null bytes)
 - #82395 (Add missing "see its documentation for more" stdio)
 - #82401 (Remove a redundant macro)
 - #82498 (Use log level to control partitioning debug output)
 - #82534 (Link crtbegin/crtend on musl to terminate .eh_frame)
 - #82537 (Update measureme dependency to the latest version)
 - #82561 (doc: cube root, not cubic root)
 - #82563 (Fix intra-doc handling of `Self` in enum)
 - #82584 (Add ARIA role to sidebar toggle in Rustdoc)
 - #82596 (clarify RW lock's priority gotcha)
 - #82607 (Add a getter for Frame.loc)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoUse -O in try_identity test that requires storage markers
Tomasz Miąsko [Sun, 28 Feb 2021 00:00:00 +0000 (00:00 +0000)]
Use -O in try_identity test that requires storage markers

3 years agocompiletest: run mir-opt tests with -C opt-level=1
Tomasz Miąsko [Wed, 13 Jan 2021 00:00:00 +0000 (00:00 +0000)]
compiletest: run mir-opt tests with -C opt-level=1

The storage markers are removed at -C opt-level=0 and as a result output
of mir opt tests vary based on used optimization level. Use opt-level=1
for mir-opt tests to avoid the issue.

3 years agoRemove storage markers if they won't be used during code generation
Tomasz Miąsko [Wed, 13 Jan 2021 00:00:00 +0000 (00:00 +0000)]
Remove storage markers if they won't be used during code generation

The storage markers constitute a substantial portion of all MIR
statements. At the same time, for builds without any optimizations,
the storage markers have no further use during and after MIR
optimization phase.

If storage markers are not necessary for code generation, remove them.

3 years agoUpdate rustdoc test to make it work with newly added rustc passes
Guillaume Gomez [Sat, 27 Feb 2021 21:17:31 +0000 (22:17 +0100)]
Update rustdoc test to make it work with newly added rustc passes

3 years agoAdd test for rustdoc new check pass
Guillaume Gomez [Sat, 27 Feb 2021 17:36:15 +0000 (18:36 +0100)]
Add test for rustdoc new check pass

3 years agoRun some rustc passes in rustdoc
Guillaume Gomez [Sat, 27 Feb 2021 21:02:41 +0000 (22:02 +0100)]
Run some rustc passes in rustdoc

3 years agoRollup merge of #82607 - bjorn3:frame_loc_getter, r=RalfJung
Dylan DPC [Sat, 27 Feb 2021 20:56:25 +0000 (21:56 +0100)]
Rollup merge of #82607 - bjorn3:frame_loc_getter, r=RalfJung

Add a getter for Frame.loc

This is necessary for Priroda.

For context see https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Frame.3A.3Aloc.20no.20longer.20public/near/228070266 and oli-obk/priroda#27.

cc `@DJMcNab`

r? `@RalfJung`

3 years agoRollup merge of #82596 - matklad:rwlock, r=sfackler
Dylan DPC [Sat, 27 Feb 2021 20:56:24 +0000 (21:56 +0100)]
Rollup merge of #82596 - matklad:rwlock, r=sfackler

clarify RW lock's priority gotcha

In particular, the following program works on Linux, but deadlocks on
mac:

```rust
    use std::{
        sync::{Arc, RwLock},
        thread,
        time::Duration,
    };

    fn main() {
        let lock = Arc::new(RwLock::new(()));

        let r1 = thread::spawn({
            let lock = Arc::clone(&lock);
            move || {
                let _rg = lock.read();
                eprintln!("r1/1");
                sleep(1000);

                let _rg = lock.read();
                eprintln!("r1/2");

                sleep(5000);
            }
        });
        sleep(100);
        let w = thread::spawn({
            let lock = Arc::clone(&lock);
            move || {
                let _wg = lock.write();
                eprintln!("w");
            }
        });
        sleep(100);
        let r2 = thread::spawn({
            let lock = Arc::clone(&lock);
            move || {
                let _rg = lock.read();
                eprintln!("r2");
                sleep(2000);
            }
        });

        r1.join().unwrap();
        r2.join().unwrap();
        w.join().unwrap();
    }

    fn sleep(ms: u64) {
        std::thread::sleep(Duration::from_millis(ms))
    }
```

Context: I was completely mystified by a my CI deadlocking on mac ([here](https://github.com/matklad/xshell/pull/7)), until ``@azdavis`` debugged the issue. See a stand-alone reproduciton here: https://github.com/matklad/xshell/pull/15

3 years agoRollup merge of #82584 - tazjin:rustdoc-aria, r=GuillaumeGomez
Dylan DPC [Sat, 27 Feb 2021 20:56:23 +0000 (21:56 +0100)]
Rollup merge of #82584 - tazjin:rustdoc-aria, r=GuillaumeGomez

Add ARIA role to sidebar toggle in Rustdoc

This indicates that the div is an interactive element, and makes the sidebar toggle "clickable" in assistive technologies.

Example of Vimium after this change has been applied (see the issue mentioned below for a screenshot of before):

![Screenshot of Vimium link hints on a Rustdoc page, indicating that the sidebar toggle is clickable](https://user-images.githubusercontent.com/1552853/109384961-ff935400-78f8-11eb-8199-1d35181aeff0.png)

Fixes #82582

3 years agoRollup merge of #82563 - lucas-deangelis:issue-82209-fix, r=jyn514
Dylan DPC [Sat, 27 Feb 2021 20:56:22 +0000 (21:56 +0100)]
Rollup merge of #82563 - lucas-deangelis:issue-82209-fix, r=jyn514

Fix intra-doc handling of `Self` in enum

Fixes #82209

3 years agoRollup merge of #82561 - tspiteri:cube-root, r=Dylan-DPC
Dylan DPC [Sat, 27 Feb 2021 20:56:21 +0000 (21:56 +0100)]
Rollup merge of #82561 - tspiteri:cube-root, r=Dylan-DPC

doc: cube root, not cubic root

Like we say square root, not quadratic root.

3 years agoRollup merge of #82537 - wesleywiser:update_measureme, r=oli-obk
Dylan DPC [Sat, 27 Feb 2021 20:56:20 +0000 (21:56 +0100)]
Rollup merge of #82537 - wesleywiser:update_measureme, r=oli-obk

Update measureme dependency to the latest version

This version adds the ability to use `rdpmc` hardware-based performance
counters instead of wall-clock time for measuring duration. This also
introduces a dependency on the `perf-event-open-sys` crate on Linux
which is used when using hardware counters.

r? ```@oli-obk```

3 years agoRollup merge of #82534 - nikic:musl-crtend, r=nagisa
Dylan DPC [Sat, 27 Feb 2021 20:56:19 +0000 (21:56 +0100)]
Rollup merge of #82534 - nikic:musl-crtend, r=nagisa

Link crtbegin/crtend on musl to terminate .eh_frame

For some targets, rustc uses a "CRT fallback", where it links CRT
object files it ships instead of letting the host compiler link
them.

On musl, rustc currently links crt1, crti and crtn (provided by
libc), but does not link crtbegin and crtend (provided by libgcc).
In particular, crtend is responsible for terminating the .eh_frame
section. Lack of terminator may result in segfaults during
unwinding, as reported in #47551 and encountered by the LLVM 12
update in #81451.

This patch links crtbegin and crtend for musl as well, following
the table at the top of crt_objects.rs.

r? ``@nagisa``

3 years agoRollup merge of #82498 - tmiasko:partitioning-debug, r=matthewjasper
Dylan DPC [Sat, 27 Feb 2021 20:56:18 +0000 (21:56 +0100)]
Rollup merge of #82498 - tmiasko:partitioning-debug, r=matthewjasper

Use log level to control partitioning debug output

3 years agoRollup merge of #82401 - osa1:remove_redundant_macro, r=matthewjasper
Dylan DPC [Sat, 27 Feb 2021 20:56:17 +0000 (21:56 +0100)]
Rollup merge of #82401 - osa1:remove_redundant_macro, r=matthewjasper

Remove a redundant macro

Turn the macro into a function. Also remove unused 'span' argument.

3 years agoRollup merge of #82395 - pickfire:see-more, r=GuillaumeGomez
Dylan DPC [Sat, 27 Feb 2021 20:56:16 +0000 (21:56 +0100)]
Rollup merge of #82395 - pickfire:see-more, r=GuillaumeGomez

Add missing "see its documentation for more" stdio

StdoutLock and StderrLock does not have example, it would be better
to leave "see its documentation for more" like iter docs.

3 years agoRollup merge of #81856 - Smittyvb:utf16-warn, r=matthewjasper
Dylan DPC [Sat, 27 Feb 2021 20:56:15 +0000 (21:56 +0100)]
Rollup merge of #81856 - Smittyvb:utf16-warn, r=matthewjasper

Suggest character encoding is incorrect when encountering random null bytes

This adds a note whenever null bytes are seen at the start of a token unexpectedly, since those tend to come from UTF-16 encoded files without a [BOM](https://en.wikipedia.org/wiki/Byte_order_mark) (if a UTF-16 BOM appears it won't be valid UTF-8, but if there is no BOM it be both valid UTF-16 and valid but garbled UTF-8). This approach was suggested in https://github.com/rust-lang/rust/issues/73979#issuecomment-653976451.

Closes #73979.

3 years agoAdd a getter for Frame.loc
bjorn3 [Sat, 27 Feb 2021 20:01:02 +0000 (21:01 +0100)]
Add a getter for Frame.loc

This is necessary for Priroda.

3 years agoRevert LLVM D81803 because it broke Windows 7
Josh Stone [Sat, 27 Feb 2021 19:09:00 +0000 (11:09 -0800)]
Revert LLVM D81803 because it broke Windows 7

This submodule update reverts <https://reviews.llvm.org/D81803>.

While that change is meant to fix a real bug, [LLVM PR42623], it caused
new permission errors on Windows 7 that make it unable to build any
archives. This is probably the same root cause as [LLVM PR48378].

Fixes #81051. We'll file a new Rust issue to track the LLVM resolution.

[LLVM PR42623]: https://bugs.llvm.org/show_bug.cgi?id=42623
[LLVM PR48378]: https://bugs.llvm.org/show_bug.cgi?id=48378

3 years agoAuto merge of #80454 - JulianKnodt:ob_forest_op, r=matthewjasper
bors [Sat, 27 Feb 2021 17:35:35 +0000 (17:35 +0000)]
Auto merge of #80454 - JulianKnodt:ob_forest_op, r=matthewjasper

Skip Ty w/o infer ty/const in trait select

Remove some allocations & also add `skip_current_subtree` to skip subtrees with no inferred items.

r? `@eddyb` since marked in the FIXME

3 years agoFixed support for macOS Catalyst for Apple Silicon
Benedikt Terhechte [Sat, 27 Feb 2021 17:15:55 +0000 (18:15 +0100)]
Fixed support for macOS Catalyst for Apple Silicon

3 years agoUpdate library/std/src/sync/rwlock.rs
Aleksey Kladov [Sat, 27 Feb 2021 16:44:17 +0000 (19:44 +0300)]
Update library/std/src/sync/rwlock.rs

Co-authored-by: Steven Fackler <sfackler@gmail.com>
3 years agoclarify RW lock's priority gotcha
Aleksey Kladov [Sat, 27 Feb 2021 16:07:19 +0000 (19:07 +0300)]
clarify RW lock's priority gotcha

In particular, the following program works on Linux, but deadlocks on
mac:

    use std::{
        sync::{Arc, RwLock},
        thread,
        time::Duration,
    };

    fn main() {
        let lock = Arc::new(RwLock::new(()));

        let r1 = thread::spawn({
            let lock = Arc::clone(&lock);
            move || {
                let _rg = lock.read();
                eprintln!("r1/1");
                sleep(1000);

                let _rg = lock.read();
                eprintln!("r1/2");

                sleep(5000);
            }
        });
        sleep(100);
        let w = thread::spawn({
            let lock = Arc::clone(&lock);
            move || {
                let _wg = lock.write();
                eprintln!("w");
            }
        });
        sleep(100);
        let r2 = thread::spawn({
            let lock = Arc::clone(&lock);
            move || {
                let _rg = lock.read();
                eprintln!("r2");
                sleep(2000);
            }
        });

        r1.join().unwrap();
        r2.join().unwrap();
        w.join().unwrap();
    }

    fn sleep(ms: u64) {
        std::thread::sleep(Duration::from_millis(ms))
    }

3 years agoRemove the x86_64-rumprun-netbsd target
Simonas Kazlauskas [Sat, 27 Feb 2021 15:55:22 +0000 (17:55 +0200)]
Remove the x86_64-rumprun-netbsd target

Closes #81514

3 years agoAuto merge of #81874 - tesuji:spec_slice_fill, r=matthewjasper
bors [Sat, 27 Feb 2021 14:54:31 +0000 (14:54 +0000)]
Auto merge of #81874 - tesuji:spec_slice_fill, r=matthewjasper

Specialize slice::fill with Copy type and u8/i8/bool

I don't expect rustperf could measure any perf improvements with this changes
since `slice::fill` is newly added.

Godbolt link for this change: <https://rust.godbolt.org/z/r3fzee>.

r? `@matthewjasper` since this patch added new specialization.

3 years agoEnable report_in_external_macro in unaligned_references
Taiki Endo [Sat, 27 Feb 2021 12:25:06 +0000 (21:25 +0900)]
Enable report_in_external_macro in unaligned_references

3 years agoAdd ARIA role to sidebar toggle in Rustdoc
Vincent Ambo [Sat, 27 Feb 2021 10:37:05 +0000 (12:37 +0200)]
Add ARIA role to sidebar toggle in Rustdoc

This indicates that the div is an interactive element, and makes the
sidebar toggle "clickable" in assistive technologies.

Fixes #82582

3 years agoAuto merge of #82448 - Aaron1011:merge-hastokens-hasattrs, r=petrochenkov
bors [Sat, 27 Feb 2021 07:52:11 +0000 (07:52 +0000)]
Auto merge of #82448 - Aaron1011:merge-hastokens-hasattrs, r=petrochenkov

Combine HasAttrs and HasTokens into AstLike

When token-based attribute handling is implemeneted in #80689,
we will need to access tokens from `HasAttrs` (to perform
cfg-stripping), and we will to access attributes from `HasTokens` (to
construct a `PreexpTokenStream`).

This PR merges the `HasAttrs` and `HasTokens` traits into a new
`AstLike` trait. The previous `HasAttrs` impls from `Vec<Attribute>` and `AttrVec`
are removed - they aren't attribute targets, so the impls never really
made sense.