Commit Graph

136335 Commits

Author SHA1 Message Date
Yuki Okushi
598d189e9b
Rollup merge of #80643 - LingMan:unwrap, r=oli-obk
Move variable into the only branch where it is relevant

At the `if` branch `filter` (the `let` binding) is `None` iff `filter` (the parameter) was `None`.
We can branch on the parameter, move the binding into the `if`, and the complexity of handling
`Option<Option<_>` largely dissolves.

`@rustbot` modify labels +C-cleanup +T-compiler

Note: I have no idea how hot this code is. If this method frequently gets called with a `None` filter, there might be a small perf improvement.
2021-01-05 09:52:44 +09:00
Yuki Okushi
faf8beddef
Rollup merge of #80637 - LingMan:filter, r=oli-obk
Use Option::filter instead of open-coding it

`@rustbot` modify labels +C-cleanup +T-compiler
2021-01-05 09:52:42 +09:00
Yuki Okushi
1c6593c473
Rollup merge of #80627 - bugadani:warn, r=Mark-Simulacrum
Builder: Warn if test file does not exist

Running `./x.py test` with a file that does not exists (but where the path belongs to a test suite) silently ignores the missing file and runs the whole test suite. This PR prints a warning to reduce the potential surprise factor.

Closes #80621
2021-01-05 09:52:40 +09:00
Yuki Okushi
d85c2fe128
Rollup merge of #80612 - rust-lang:XAMPPRocky-patch-1, r=Mark-Simulacrum
Remove reverted change from relnotes

r? `@Mark-Simulacrum`
2021-01-05 09:52:38 +09:00
Yuki Okushi
be2a3f8642
Rollup merge of #80538 - JulianKnodt:err_usize, r=lcnr
Add check for `[T;N]`/`usize` mismatch in astconv

Helps clarify the issue in #80506
by adding a specific check for mismatches between [T;N] and usize.

r? `@lcnr`
2021-01-05 09:52:37 +09:00
Yuki Okushi
4c4e8e70bb
Rollup merge of #80533 - matthiaskrgr:bootstrap_clppy, r=Mark-Simulacrum
bootstrap: clippy fixes

addresses:

clippy::or_fun_call
clippy::single_char_add_str
clippy::comparison_to_empty
clippy::or_fun_call
2021-01-05 09:52:35 +09:00
Yuki Okushi
bdf8bbde1d
Rollup merge of #80442 - steffahn:mention_arc_in_cow, r=Mark-Simulacrum
Mention Arc::make_mut and Rc::make_mut in the documentation of Cow

Following this discussion: https://users.rust-lang.org/t/should-the-cow-documentation-mention-arc/53341

_Rendered (the last paragraph is new):_

![Screenshot_20201228_171551](https://user-images.githubusercontent.com/3986214/103228135-5d72e200-4930-11eb-89e1-38b5c86b08c7.png)

`@rustbot` modify labels: T-doc, T-libs
2021-01-05 09:52:33 +09:00
bors
9919ad6e9e Auto merge of #80426 - jyn514:bootstrap-caching, r=Mark-Simulacrum
Don't use `self.date` unconditionally for `program_out_of_date()`

This avoids unnecessary cache invalidations for programs not affected by
the stage0 version (which is everything except the stage0 compiler
itself).

The redundant invalidations weren't noticed until now because they only
showed up on stage0 bumps, at which point people are used to rebuilding
everything anyway. I noticed it in https://github.com/rust-lang/rust/pull/79540
because I wasn't adding `self.date` to the stamp file (because I didn't realize it was necessary). Rather than
adding self.date I thought it was better to remove it from the cache key.
2021-01-05 00:20:18 +00:00
oli
65ee418e5c Do not run const prop on the mir_for_ctfe of const fn 2021-01-04 22:29:45 +00:00
oli
409195d4e5 Update stderr files after rebase 2021-01-04 21:40:38 +00:00
oli
3af7989a7c No doc comments on expressions 2021-01-04 21:40:38 +00:00
oli
a76dae4946 Fix wording of query description 2021-01-04 21:40:38 +00:00
oli
9eaec139d0 Small comment adjustments 2021-01-04 21:40:38 +00:00
oli
caeb3d525d Move MIR body loading to a machine function 2021-01-04 21:40:38 +00:00
oli
f6d54aa0c1 Adjust imports 2021-01-04 21:40:38 +00:00
oli
7202054800 Document all the things 2021-01-04 21:40:38 +00:00
oli
680c4022ae Comment nit 2021-01-04 21:40:38 +00:00
oli
db90150b91 Polymorphization should look at the runtime MIR of const fn 2021-01-04 21:40:38 +00:00
oli
eb4e94b2e5 Simplify the optimize_mir query 2021-01-04 21:40:38 +00:00
oli
1f5fb3e056 Differentiate between the availability of ctfe MIR and runtime MIR 2021-01-04 21:40:38 +00:00
oli
cccd40f9b5 Keep an unoptimized duplicate of const fn around
This allows CTFE to reliably detect UB, as otherwise
optimizations may hide UB.
2021-01-04 21:40:38 +00:00
oli
8e4fe6647f Require the encode_promoted_mir caller to know whether MIR for this item actually exists 2021-01-04 21:40:38 +00:00
oli
248b4dbc4f Limit trait item mir encoding to items with default bodies 2021-01-04 21:40:38 +00:00
oli
dadf937a12 Remove mir encode calls that didn't actually encode anything 2021-01-04 21:40:38 +00:00
oli
552f391969 Make encode_optimized_mir always perform its action and instead require the callers to know whether they actually want this 2021-01-04 21:40:38 +00:00
oli
68ff5f0a18 Stop optimizing promoteds 2021-01-04 21:40:38 +00:00
bors
61f5a00923 Auto merge of #80624 - RalfJung:place-ref, r=oli-obk
use PlaceRef more consistently instead of loosely coupled local+projection

Instead of working directly with the `projections` array, use `iter_projections` and `last_projection`. This avoids having to construct new `PlaceRef` from the pieces everywhere.

I only did this for a few files, to see how people think about this. If y'all are happy with this, I'll open an E-mentor issue to complete this. I grepped for `Place::ty_from` to find the places that need adjusting -- this could miss some, but I am not sure what else to grep for.
2021-01-04 20:56:34 +00:00
max-heller
6f0413316f fix incompatible disambiguator test 2021-01-04 15:38:30 -05:00
Rich Kadel
e4aa99fe7a Inlining enabled by -mir-opt-level > 1 is incompatible with coverage
Fixes: #80060

Also adds additional test cases for coverage of doctests.
2021-01-04 11:06:42 -08:00
Ralf Jung
92d1b39043 make sure that promoteds which fail to evaluate in dead const code behave correctly 2021-01-04 19:48:56 +01:00
Albin Hedman
63f5d6111a Added reference to tracking issue and removed unneeded line 2021-01-04 19:36:25 +01:00
Ian Jackson
2c1d6557c9 Remove two obsolete uses of #![feature(split_inclusive)]
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-01-04 16:29:12 +00:00
Ian Jackson
be226e49e4 Stabilize split_inclusive
Closes #72360.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-01-04 16:20:08 +00:00
bors
9a22f993f0 Auto merge of #80688 - ehuss:update-mdbook, r=pietroalbini
[security] Update mdbook

Changelog from 0.4.3 to 0.4.5: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-045
2021-01-04 16:11:47 +00:00
Guillaume Gomez
9714ac08a5 Add tests for new doc alias check 2021-01-04 16:30:53 +01:00
Eric Huss
65675adaea Update mdbook 2021-01-04 07:18:37 -08:00
Dániel Buga
6002e78392 Builder: Warn if test file does not exist 2021-01-04 16:09:59 +01:00
Guillaume Gomez
c4c010f534 Add an error in case the doc alias is the same as the item it's aliasing 2021-01-04 15:05:36 +01:00
J. Ryan Stinnett
61c8aae0a9 Extract sidebar_deref_methods function 2021-01-04 13:27:13 +00:00
bors
ab5b9aecb9 Auto merge of #80651 - GroteGnoom:issue-78123-fix, r=Nadrieril
Add note to non-exhaustive match on reference to empty

Rust prints "type `&A` is non-empty" even is A is empty.
This is the intended behavior, but can be confusing.
This commit adds a note to non-exhaustive pattern errors if they are a
reference to something uninhabited.

I did not add tests to check that the note is not shown for
non-references or inhabited references, because this is already done
in other tests.

Maybe the added test is superfluous, because
`always-inhabited-union-ref` already checks for this case.

This does not handle &&Void or &&&void etc. I could add those as special
cases as well and ignore people who need quadruple
references.

Fixes #78123
2021-01-04 13:23:08 +00:00
bors
6163bfdcce Auto merge of #80661 - jyn514:duplicate-types, r=GuillaumeGomez
Cleanup rustdoc handling of associated types

This is best reviewed a commit at a time. No particular reason for these changes, they just stood out as I was reviewing https://github.com/rust-lang/rust/pull/80653 and thinking about https://github.com/rust-lang/rust/issues/80379. The new test case worked before, it just wasn't tested.

r? `@GuillaumeGomez`
2021-01-04 10:32:28 +00:00
kadmin
54883e0a1c Add check for array/usize mismatch in astconv 2021-01-04 10:07:15 +00:00
bors
887398ff68 Auto merge of #80610 - Aaron1011:unhash-def-path-hash, r=varkor
Use `UnhashMap` whenever we have a key of `DefPathHash`
2021-01-04 07:49:01 +00:00
bors
0cd459fd62 Auto merge of #80554 - GuillaumeGomez:more-js-cleanup, r=jyn514
More js cleanup

Part of #79052 (Same kind as #80515).

This one is about some small fixes:
 * Replacing some loops with `onEachLazy`.
 * Removing unused function arguments.
 * Turn `buildHelperPopup` into a variable so it can be "replaced" once the function has been called once so it's not called again.

r? `@jyn514`
2021-01-04 05:04:04 +00:00
oliver
e152582a2b
doc -- list edit for consistency 2021-01-04 04:50:24 +00:00
max-heller
06b0900a2d half working 2021-01-03 21:55:53 -05:00
bors
8989689e72 Auto merge of #80418 - oli-obk:this_could_have_been_so_simple, r=RalfJung
Allow references to interior mutable data behind a feature gate

supercedes #80373 by simply not checking for interior mutability on borrows of locals that have `StorageDead` and thus can never be leaked to the final value of the constant

tracking issue: https://github.com/rust-lang/rust/issues/80384

r? `@RalfJung`
2021-01-04 02:15:57 +00:00
max-heller
fc3a4058ce still verify disambiguators for primitives 2021-01-03 20:45:08 -05:00
max-heller
e33a205bdf primitive disambiguator tests 2021-01-03 20:38:28 -05:00
max-heller
b4a0ef066d fix issue 80559 2021-01-03 20:38:28 -05:00