Commit Graph

127438 Commits

Author SHA1 Message Date
bors fd702d2919 Auto merge of #76886 - Aaron1011:fix/ensure-stack-predicate, r=Mark-Simulacrum
Wrap recursive predicate evaluation with `ensure_sufficient_stack`

I haven't been able to come up with a minimized test case for #76770,
but this fixes a stack overflow in rustc as well.
2020-09-19 09:21:22 +00:00
bors 4e8a8b49ae Auto merge of #76879 - shepmaster:zlib-sys, r=Mark-Simulacrum
Upgrade libz-sys to 1.1.2

The current version has warnings that become errors on new versions of clang shipped in XCode:

```
warning: src/zlib/gzlib.c:214:15: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
warning:         (void)snprintf(state->path, len + 1, "%s", (const char *)path);
warning:               ^
warning: src/zlib/gzlib.c:214:15: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
warning: 1 error generated.

warning: src/zlib/gzwrite.c:428:11: error: implicitly declaring library function 'vsnprintf' with type 'int (char *, unsigned long, const char *, __builtin_va_list)' [-Werror,-Wimplicit-function-declaration
warning:     len = vsnprintf(next, state->size, format, va);
warning:           ^
warning: src/zlib/gzwrite.c:428:11: note: include the header <stdio.h> or explicitly provide a declaration for 'vsnprintf'
warning: 1 error generated.
```

r? `@Mark-Simulacrum`

/cc `@joshtriplett`
2020-09-19 06:28:37 +00:00
bors ac19c3bda1 Auto merge of #76856 - jonas-schievink:dist-rustc-src, r=Mark-Simulacrum
Distribute rustc sources as part of `rustc-dev`

They can be used to provide IDE features when working on rustc plugins/backends/etc without having to locate a separate Rust checkout.

r? `@Mark-Simulacrum`
2020-09-19 04:21:11 +00:00
bors a2c82df1f5 Auto merge of #76838 - est31:dogfood_uninit_features, r=oli-obk
Dogfood new_uninit and maybe_uninit_slice in rustc_arena

Dogfoods a few cool `MaybeUninit` related features in the compiler's rustc_arena crate.

Split off from #76821

r? `@oli-obk`
2020-09-19 02:21:19 +00:00
bors c6ab8e5fe0 Auto merge of #76787 - lzutao:slice_iters_new, r=lcnr
Using <Iter>::new instead of exposing internal fields

As requested in https://github.com/rust-lang/rust/pull/76311#discussion_r487685126
2020-09-18 23:38:17 +00:00
bors bbc677480d Auto merge of #76782 - lzutao:rd-cap, r=jyn514
Specialize merge_attrs in good case

Just a non-important micro-optimization.
r? `@jyn514`
2020-09-18 21:31:08 +00:00
bors 2cbc570e58 Auto merge of #76884 - Mark-Simulacrum:fix-macos-ci, r=pietroalbini
Add host triples to target lists

This PR is primarily intended to fix https://github.com/rust-lang/rustup/issues/2494, which is the second commit. That bug was introduced by #76415, and incompletely fixed by #76639. (#76639 added host triples, which gave us compilers, but missed that we also need documentation and other target-only things). However, it also removes duplicate macOS CI builders.

r? `@pietroalbini`
2020-09-18 19:13:02 +00:00
bors 9f8ac718f4 Auto merge of #76575 - lcnr:abstract-const, r=oli-obk
compare generic constants using `AbstractConst`s

This is a MVP of rust-lang/compiler-team#340. The changes in this PR should only be relevant if `feature(const_evaluatable_checked)` is enabled.

~~currently based on top of #76559, so blocked on that.~~

r? `@oli-obk` cc `@varkor` `@eddyb`
2020-09-18 16:59:50 +00:00
Aaron Hill 6a96aea36a
Wrap recursive predicate evaluation with `ensure_sufficient_stack`
I haven't been able to come up with a minimized test case for #76770,
but this fixes a stack overflow in rustc as well.
2020-09-18 12:24:42 -04:00
Mark Rousskov d0dff8f873 Make sure we build target-only things (e.g., docs) for host platforms too 2020-09-18 12:00:53 -04:00
Mark Rousskov 15adc2ee83 Remove duplicate macOS builders 2020-09-18 12:00:40 -04:00
Bastian Kauschke b7641209d7 add `const-evaluatable_checked` check back in 2020-09-18 17:36:11 +02:00
Bastian Kauschke 09e6254496 review, small cleanup 2020-09-18 17:11:34 +02:00
Bastian Kauschke 1b275d08ad document `const_evaluatable` 2020-09-18 17:11:34 +02:00
Bastian Kauschke 7fff155d2a remove allow(warnings) 2020-09-18 17:11:34 +02:00
Bastian Kauschke 30ff1ef3d0 support const_evaluatable_checked across crate boundaries 2020-09-18 17:11:34 +02:00
Bastian Kauschke 82ebbd7d6b add test for let-bindings 2020-09-18 17:11:34 +02:00
Bastian Kauschke c7d16df1d8 add function calls 2020-09-18 17:11:34 +02:00
Bastian Kauschke d1294e0ce2 allow unary operations and ignore StorageLive/Dead stmts 2020-09-18 17:11:34 +02:00
Bastian Kauschke 5a277822a5 use newtype_index for abstract_const::NodeId 2020-09-18 17:11:34 +02:00
Bastian Kauschke f24d532749 refactor AbstractConstBuilder 2020-09-18 17:11:34 +02:00
Bastian Kauschke c3a772f55f use abstract consts when unifying ConstKind::Unevaluated 2020-09-18 17:11:34 +02:00
Bastian Kauschke d327fa112b initial working state 2020-09-18 16:25:25 +02:00
bors fdc3405c20 Auto merge of #72412 - VFLashM:issue-72408-nested-closures-exponential, r=tmandry
Issue 72408 nested closures exponential

This fixes #72408.

Nested closures were resulting in exponential compilation time.

This PR is enhancing asymptotic complexity, but also increasing the constant, so I would love to see perf run results.
2020-09-18 14:08:39 +00:00
Jake Goulding 15bd2365fc Upgrade libz-sys to 1.1.2 2020-09-18 09:18:10 -04:00
bors 2c69266c06 Auto merge of #76837 - wesleywiser:disable_consideredequal, r=oli-obk
[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)

r? `@oli-obk`
2020-09-18 10:54:14 +00:00
Tyler Mandry 3ccb1c37e6 Remove redundancy in cache key 2020-09-18 09:03:53 +00:00
Lzu Tao b65937031d inline inner function of inlining methods 2020-09-18 08:36:21 +00:00
Lzu Tao 53d5261c69 Move unsafe code of slice `new` function of their Iterator structs
Init false state in Split* constructors
2020-09-18 08:36:21 +00:00
bors 953f33c5cb Auto merge of #76854 - aDotInTheVoid:mir-opt-32-64-diff-name, r=oli-obk
Rename mir-opt diff tests with 32/64 bit

Now syntax highlighting should work.

I've tested that `--bless` works localy, but I'm not sure it's possible on CI

Fixes #75746

r? `@oli-obk`
2020-09-18 08:28:03 +00:00
bors a0925fba74 Auto merge of #76790 - ssomers:btree_slice_slasher_returns, r=Mark-Simulacrum
BTreeMap: avoid slices even more

Epilogue to #73971: it seems the compiler is unable to realize that creating a slice and `get_unchecked`-ing one element is a simple fetch. So try to spell it out for the only remaining but often invoked case.

Also, the previous code doesn't seem fair game to me, using `get_unchecked` to reach beyond the end of a slice. Although the local function `slice_insert` also does that.

r? `@Mark-Simulacrum`
2020-09-18 05:47:00 +00:00
est31 2805a05154 Add bench_typed_arena_clear_100 bench 2020-09-18 05:52:45 +02:00
est31 daccd1709e Replace loop with drop_in_place call 2020-09-18 04:49:02 +02:00
est31 5acfcceb47 Dogfood new_uninit and maybe_uninit_slice in rustc_arena 2020-09-18 04:49:02 +02:00
Lzu Tao 2818032a2d Calculate more correct capacity in merge_attrs
Co-authored-by: jyn514 <joshua@yottadb.com>
2020-09-18 01:55:40 +00:00
Valerii Lashmanov f583513dc2 Intorduced MiniMap - a tiny small storage optimized map implementation
This makes everything about 1% faster in rustc-perf,
mostly negating performance hit of previous commit.
2020-09-17 20:44:11 -05:00
Valerii Lashmanov 17d2e3b5d2 Better handling for exponential-sized types in misc places
Mostly to fix ui/issues/issue-37311-type-length-limit/issue-37311.rs.

Most parts of the compiler can handle deeply nested types with a lot
of duplicates just fine, but some parts still attempt to naively
traverse type tree.

Before such problems were caught by type length limit check,
but now these places will have to be changed to handle
duplicated types gracefully.
2020-09-17 20:44:11 -05:00
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
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
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
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