Commit graph

127539 commits

Author SHA1 Message Date
Valerii Lashmanov 2f3296192b Only visit types once when walking the type tree
This fixes #72408.

Nested closures were resulting in exponential compilation time.

As a performance optimization this change introduces MiniSet,
which is a simple small storage optimized set.
2020-09-17 20:44:11 -05:00
Nixon Enraght-Moony 735776d115 Fix --bless for mir-opt 32/64 bit file 2020-09-18 00:02:48 +01:00
Jonas Schievink ee1e9343b3 Distribute rustc sources as part of rustc-dev 2020-09-18 00:18:19 +02:00
Nixon Enraght-Moony 3c7593e69f Rename 32 bit mir files to be more tool friendly
See #75746
2020-09-17 21:49:21 +01:00
Nixon Enraght-Moony 4f23cec3f9 Rename 64 bit mir files to be more tool friendly
See #75746
2020-09-17 21:35:21 +01:00
Nixon Enraght-Moony 076e52d0c9 Put bit qualifier before mir/diff 2020-09-17 21:32:02 +01:00
bors f3c923a13a Auto merge of #76645 - fusion-engineering-forks:windows-lock, r=kennytm
Small cleanups in Windows Mutex.

 - Move `held` into the boxed part, since the SRW lock implementation does not use this. This makes the Mutex 50% smaller.
 - Use `Cell` instead of `UnsafeCell` for `held`, such that `.replace()` can be used.
 - Add some comments.
 - Avoid creating multiple `&mut`s to the critical section object in `ReentrantMutex`.
2020-09-17 19:23:58 +00:00
Dylan MacKenzie e03f4164d9 Default to implicit (not explicit) rules for promotability in const fn 2020-09-17 08:39:11 -07:00
Alistair Francis 3d1b6d6cc2 library/unwind: Add missing )
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-17 07:10:10 -07:00
Wesley Wiser dbd7226d29 [mir-opt] Disable the ConsideredEqual logic in SimplifyBranchSame opt
The logic is currently broken and we need to disable it to fix a beta
regression (see #76803)
2020-09-17 09:36:50 -04:00
bors 7bdb5dee7b Auto merge of #76634 - RalfJung:miri-guaranteed-eq-ne, r=oli-obk
move guaranteed{ne,eq} implementation to compile-time machine

Currently, Miri needs a special hack to avoid using the core engine implementation of these intrinsics. That seems silly, so let's move them to the CTFE machine, which is the only machine that wants to use them.

I also added a reference to https://github.com/rust-lang/rust/issues/73722 as a warning to anyone who wants to adjust `guaranteed_eq`.
2020-09-17 12:15:57 +00:00
Lzu Tao 9fe9c6da3e Using <Iter>::new instead of exposing internal fields 2020-09-17 09:58:26 +00:00
bors 95386b656e Auto merge of #76028 - aticu:improve_e0118, r=estebank,jyn514,GuillaumeGomez
Improve E0118

- Changes the "base type" terminology to "nominal type" (according to the [reference](https://doc.rust-lang.org/stable/reference/items/implementations.html#inherent-implementations)).
- Suggests removing a reference, if one is present on the type.
- Clarify what is meant by a "nominal type".

closes #69392

This is my first not-entirely-trivial PR, so please let me know if I missed anything or if something could be improved. Though I probably won't be able to fix anything in the upcoming week.
2020-09-17 03:56:38 +00:00
Ivan Tham b7c8bea6cb
Fix wording in mir doc 2020-09-17 09:07:19 +08:00
Matthias Krüger 0e3414248a don't lazily evaulate some trivial values for Option::None replacements (clippy::unnecessary_lazy_evaluations) 2020-09-17 01:37:35 +02:00
Alistair Francis 57b2da808c library/unwind: Consolidate RV32 and RV64
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-16 15:19:32 -07:00
Alistair Francis fd76268166 library/panic_unwind: Consolidate RV32 and RV64
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-16 14:31:42 -07:00
Matthias Krüger 94dae60040 simplfy condition in ItemLowerer::with_trait_impl_ref() 2020-09-16 23:09:57 +02:00
bors 285fc7d704 Auto merge of #76804 - tmandry:rollup-nwntt3q, r=tmandry
Rollup of 16 pull requests

Successful merges:

 - #75026 (Add array_windows fn)
 - #76642 (Do not lint ignored private doc tests)
 - #76719 (Change error message for ty param in const)
 - #76721 (Use intra-doc links in `core::mem`)
 - #76728 (Add a comment why `extern crate` is necessary for rustdoc)
 - #76735 (Remove unnecessary `clone()`s in bootstrap)
 - #76741 (Avoid printing dry run timings)
 - #76747 (Add missing code examples in libcore)
 - #76756 (fix a couple of stylistic clippy warnings)
 - #76758 ([fuchsia] Propagate the userspace UTC clock)
 - #76759 (Fix stabilization marker for future_readiness_fns)
 - #76760 (don't lazily evaluate some trivial values for Option::None replacements (clippy::unnecessary_lazy_evaluations))
 - #76764 (Update books)
 - #76775 (Strip a single leading tab when rendering dataflow diffs)
 - #76778 (Simplify iter fuse struct doc)
 - #76794 (Make graphviz font configurable)

Failed merges:

r? `@ghost`
2020-09-16 20:18:19 +00:00
Gus Wynn 230355f25f comments and factor to own method 2020-09-16 12:32:10 -07:00
Tyler Mandry 3bf66ae25f
Rollup merge of #76794 - richkadel:graphviz-font, r=ecstatic-morse
Make graphviz font configurable

Alternative to PR #76776.

To change the graphviz output to use an alternative `fontname` value,
add a command line option like: `rustc --graphviz-font=monospace`.

r? @ecstatic-morse
2020-09-16 12:24:30 -07:00
Tyler Mandry d3c63213a0
Rollup merge of #76778 - pickfire:patch-7, r=jonas-schievink
Simplify iter fuse struct doc
2020-09-16 12:24:28 -07:00
Tyler Mandry cd766c9d09
Rollup merge of #76775 - ecstatic-morse:dataflow-extra-tab-diff, r=Mark-Simulacrum
Strip a single leading tab when rendering dataflow diffs

The `fmt_diff_with` formatter uses a tab to separate additions from subtractions. Strip it when rendering those diffs on separate lines.

r? @Mark-Simulacrum (since you're speedy)
2020-09-16 12:24:27 -07:00
Tyler Mandry 5d8bc90715
Rollup merge of #76764 - ehuss:update-books, r=ehuss
Update books

## nomicon

1 commits in 25854752549d44d76fbd7650e17cb4f167a0b8fb..6e57e64501f61873ab80cb78a07180a22751a5d6
2020-08-19 16:41:48 -0400 to 2020-09-14 11:40:23 -0400
- Fix API change to alloc::Global::grow. (rust-lang-nursery/nomicon#236)

## reference

3 commits in 25391dba46262f882fa846beefaff54a966a8fa5..56a13c082ee90736c08d6abdcd90462517b703d3
2020-09-02 07:22:55 -0700 to 2020-09-14 23:20:16 -0700
- Update the description of staticlib (rust-lang-nursery/reference#884)
- Rust 1.46 now allows more features in const fn (rust-lang-nursery/reference#883)
- Document the enum changes in RFC 2195 (rust-lang-nursery/reference#879)

## book

1 commits in e5ed97128302d5fa45dbac0e64426bc7649a558c..cb28dee95e5e50b793e6ba9291c5d1568d3ad72e
2020-08-31 12:53:40 -0500 to 2020-09-09 10:06:00 -0500
- Fixed the error message of invalid array element access in ch03.2 (rust-lang/book#2446)
2020-09-16 12:24:25 -07:00
Tyler Mandry 6e0131cd5b
Rollup merge of #76760 - matthiaskrgr:clippy_lazy_eval, r=varkor
don't lazily evaluate some trivial values for Option::None replacements (clippy::unnecessary_lazy_evaluations)
2020-09-16 12:24:23 -07:00
Tyler Mandry 273267c9ee
Rollup merge of #76759 - yoshuawuyts:fix-future-pending-ready-stabilization-label, r=Dylan-DPC
Fix stabilization marker for future_readiness_fns

Updated the rustc version in which this will be stabilized from `1.47.0 -> 1.48.0`. Fixes https://github.com/rust-lang/rust/pull/74328#issuecomment-692133125. Ref #70921.

r? @Dylan-DPC
2020-09-16 12:24:21 -07:00
Tyler Mandry ab207743af
Rollup merge of #76758 - adamlesinski:clone_clock, r=tmandry
[fuchsia] Propagate the userspace UTC clock

On Fuchsia, spawning a subprocess does not automatically
clone all of the parent process' capabilities. UTC time on
Fuchsia is managed by a top-level userspace clock capability
that is cloned and passed to subprocesses.

This change ensures that any Rust subprocess gets access to the
UTC clock, if the parent had access to it. This is critical for
tests, which on Fuchsia, use panic=abort and spawn subprocesses
per test.
2020-09-16 12:24:19 -07:00
Tyler Mandry a6c4d30c7b
Rollup merge of #76756 - matthiaskrgr:cl123ppy, r=Dylan-DPC
fix a couple of stylistic clippy warnings

namely:

clippy::redundant_pattern_matching
clippy::redundant_pattern
clippy::search_is_some
clippy::filter_next
clippy::into_iter_on_ref
clippy::clone_on_copy
clippy::needless_return
2020-09-16 12:24:17 -07:00
Tyler Mandry ab78ca92f3
Rollup merge of #76747 - GuillaumeGomez:more-missing-libcore-code-examples, r=Mark-Simulacrum
Add missing code examples in libcore
2020-09-16 12:24:16 -07:00
Tyler Mandry 233937419a
Rollup merge of #76741 - Mark-Simulacrum:no-dry-run-timing, r=alexcrichton
Avoid printing dry run timings

This avoids a wall of text on CI with 0.000 as the likely time.

r? @alexcrichton
2020-09-16 12:24:14 -07:00
Tyler Mandry 2e0dbf162c
Rollup merge of #76735 - jyn514:no-clone, r=Mark-Simulacrum
Remove unnecessary `clone()`s in bootstrap

The performance difference is negligible, but it makes me feel better.

r? @Mark-Simulacrum
2020-09-16 12:24:12 -07:00
Tyler Mandry 6e57eecb05
Rollup merge of #76728 - jyn514:rustdoc-extern-crate, r=ehuss
Add a comment why `extern crate` is necessary for rustdoc

r? @ehuss

From https://github.com/rust-lang/rust/pull/74293#discussion_r488335500.
2020-09-16 12:24:10 -07:00
Tyler Mandry 153fb91d37
Rollup merge of #76721 - camelid:intra-doc-links-for-core-mem, r=jyn514
Use intra-doc links in `core::mem`

Part of #75080.

Last one for now!

---

@rustbot modify labels: A-intra-doc-links T-doc
2020-09-16 12:24:08 -07:00
Tyler Mandry a63f8c1cac
Rollup merge of #76719 - hameerabbasi:min-const-generics-ty, r=lcnr
Change error message for ty param in const

This PR introduces the following changes:

* Change error message for type param in a const expression when using
`min_const_generics`
* Change `ParamInNonTrivialAnonConst` to contain an extra `bool` used for
distinguishing whether the passed-in symbol is a type or a value.

Fixes #76701
2020-09-16 12:24:06 -07:00
Tyler Mandry ece688bae9
Rollup merge of #76642 - GuillaumeGomez:ignored-private-doc-test, r=jyn514
Do not lint ignored private doc tests

Fixes #76457.

r? @ehuss
2020-09-16 12:24:05 -07:00
Tyler Mandry 23a677787e
Rollup merge of #75026 - JulianKnodt:array_windows, r=Amanieu
Add array_windows fn

This mimicks the functionality added by array_chunks, and implements a const-generic form of
`windows`. It makes egregious use of `unsafe`, but by necessity because the array must be
re-interpreted as a slice of arrays, and unlike array_chunks this cannot be done by casting the
original array once, since each time the index is advanced it needs to move one element, not
`N`.

I'm planning on adding more tests, but this should be good enough as a premise for the functionality.
Notably: should there be more functions overwritten for the iterator implementation/in general?

~~I've marked the issue as #74985 as there is no corresponding exact issue for `array_windows`, but it's based of off `array_chunks`.~~

Edit: See Issue #75027 created by @lcnr for tracking issue

~~Do not merge until I add more tests, please.~~

r? @lcnr
2020-09-16 12:24:03 -07:00
Mara Bos 0bb96e7490 Avoid creating &muts in Windows ReentrantMutex. 2020-09-16 21:16:32 +02:00
Mara Bos 3fadc603ab Don't use mut in Windows Mutex. 2020-09-16 21:09:53 +02:00
Rich Kadel 3875abe32f Added RUSTC_GRAPHVIZ_FONT environment variable
Overrides the debugging_opts.graphviz_font setting.
2020-09-16 11:27:17 -07:00
Joshua Nelson c35ce3ff17 Don't generate bootstrap usage unless it's needed
Previously, `x.py` would unconditionally run `x.py build` to get the
help message. After https://github.com/rust-lang/rust/issues/76165,
when checking the CI stage was moved into `Config`, that would cause an
assertion failure (but only only in CI!):

```
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `2`', src/bootstrap/config.rs:619:49
```

This changes bootstrap to only generate a help message when it needs
to (when someone passes `--help`).
2020-09-16 13:31:20 -04:00
bors ff806b8716 Auto merge of #76420 - Gelbpunkt:aarch64-linux-musl, r=pietroalbini
Add aarch64-unknown-linux-musl host builds

This adds aarch64-unknown-linux-musl to the hosts list and adds the build to the dist-arm-linux builder as `@Mark-Simulacrum` suggested to me in Zulip. `@jyn514` requested to be mentioned 😄

I had to update the config for crosstool-ng as it had a prompt about the glibc version.

I ran `src/ci/docker/run.sh dist-arm-linux` to test it.

```
Build completed successfully in 1:31:50
Compile requests              8180
Compile requests executed     8135
Cache hits                     287
Cache misses                  7848
Cache timeouts                   0
Cache read errors                0
Forced recaches                  0
Cache write errors               0
Compilation failures             0
Cache errors                     0
Non-cacheable compilations       0
Non-cacheable calls             36
Non-compilation calls            9
Unsupported compiler calls       0
Average cache write          0.000 s
Average cache read miss      6.389 s
Average cache read hit       0.000 s
Cache location             Local disk: "/sccache"
Cache size                     202 MiB
Max cache size                  10 GiB
== clock drift check ==
  local time: Sun Sep  6 19:30:17 UTC 2020
  network time: Sun, 06 Sep 2020 19:30:17 GMT
== end clock drift check ==
```

Only errors were in miri due to struct fields being private (already been reported [here](https://github.com/rust-lang/rust/issues/76337))

Edit: Maybe it is helpful if I add that it is a working compiler
```sh
/rust-nightly-aarch64-unknown-linux-musl # ash install.sh
install: creating uninstall script at /usr/local/lib/rustlib/uninstall.sh
install: installing component 'rustc'
install: installing component 'cargo'
install: installing component 'rls-preview'
install: installing component 'rust-analyzer-preview'
install: installing component 'clippy-preview'
install: installing component 'rustfmt-preview'
install: installing component 'llvm-tools-preview'
install: installing component 'rust-analysis-aarch64-unknown-linux-musl'
install: installing component 'rust-std-aarch64-unknown-linux-musl'
install: WARNING: failed to run ldconfig. this may happen when not installing as root. run with --verbose to see the error

    Rust is ready to roll.

/ # cat test.rs
fn main() { println!("hello world"); }
/ # rustc test.rs
/ # ./test
hello world
 # file test
test: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped
```
2020-09-16 17:22:54 +00:00
Gus Wynn 1d93048324 give better suggestion when matching a const range 2020-09-16 10:13:11 -07:00
Alistair Francis 3e94295853 tools/build-manifest: Add support for RISC-V 32-bit
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-16 09:37:00 -07:00
Joshua Nelson be37265708 Give a better error message when x.py uses the wrong stage for CI 2020-09-16 12:00:56 -04:00
Alistair Francis 0f3ccbd662 library/unwind: Add support for RISC-V 32-bit
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-16 08:45:49 -07:00
Alistair Francis cf075355da library/std: sys_common: Add support for RISC-V 32-bit
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-16 08:45:08 -07:00
Alistair Francis cd066c9deb library/std: raw: Add support for RISC-V 32-bit
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-16 08:44:35 -07:00
Alistair Francis 84fe26c4d3 library/std: linux: Add support for RISC-V 32-bit
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-16 08:43:54 -07:00
Alistair Francis de0d55cb3c library/panic_unwind: Add UNWIND_DATA_REG for RISC-V 32-bit
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2020-09-16 08:42:55 -07:00
Rich Kadel 5c29332ace Make graphviz font configurable
Alternative to PR ##76776.

To change the graphviz output to use an alternative `fontname` value,
add a command line option like: `rustc --graphviz-font=monospace`.
2020-09-16 08:10:06 -07:00