Commit Graph

138596 Commits

Author SHA1 Message Date
Yuki Okushi 01e1d2d5e8
Rollup merge of #82302 - tmiasko:test-unsafe-send, r=Mark-Simulacrum
Remove unsafe impl Send for CompletedTest & TestResult
2021-02-21 15:26:49 +09:00
Yuki Okushi 2793859e86
Rollup merge of #82233 - ijackson:try-block-type-test, r=Mark-Simulacrum
try-back-block-type test: Use TryFromSliceError for From test

Using `i32` is rather fragile because it has many implementations.  Recently in an early draft of another MR (#82228) I did something that introduced a new `i32 as From<something>` impl and this test broke.

TryFromSliceError is nice because it doesn't seem likely to grow new conversions.  We still have one conversion, from Infallible.

My other MR is going to be reworked and won't need this any more but having done it I thought I would submit it rather than just throw it away.  Sorry for the tiny MR.
2021-02-21 15:26:48 +09:00
Yuki Okushi b9040c717c
Rollup merge of #82229 - estebank:issue-templace, r=Mark-Simulacrum
Add [A-diagnostics] bug report template
2021-02-21 15:26:47 +09:00
Yuki Okushi 2a57acf179
Rollup merge of #82181 - GuillaumeGomez:es5-checks-ci, r=Mark-Simulacrum
Add check for ES5 in CI

Follow-up of #82145.

r? ```@Mark-Simulacrum```
2021-02-21 15:26:46 +09:00
Yuki Okushi 13a3c6e170
Rollup merge of #82177 - rylev:no-delete-bootstrap-windows, r=Mark-Simulacrum
Do not delete bootstrap.exe on Windows during clean

Windows does not allow deleting currently running executables.

This an addition to ```@jyn514's``` change in https://github.com/rust-lang/rust/pull/80574.
2021-02-21 15:26:45 +09:00
Yuki Okushi 0fd78eda8d
Rollup merge of #82154 - CDirkx:ip-changelog, r=Mark-Simulacrum
Update RELEASES.md 1.50 to include methods stabilized in #79342

I noticed that #79342 was missing from the release notes for 1.50.
2021-02-21 15:26:44 +09:00
Yuki Okushi 882fd69b22
Rollup merge of #81966 - deg4uss3r:degausser/aarch64_apple_ios_sim, r=shepmaster
Add new `rustc` target for Arm64 machines that can target the iphonesimulator

This PR lands a new target (`aarch64-apple-ios-sim`) that targets arm64 iphone simulator, previously unreachable from Apple Silicon machines.

resolves #81632

r? `@shepmaster`
2021-02-21 15:26:42 +09:00
Yuki Okushi 4c1f195e0b
Rollup merge of #81833 - the8472:parallel-bootstrap-rustfmt, r=Mark-Simulacrum
parallelize x.py test tidy

Running tidy on individual commits when rewriting git history was somewhat of an annoyance, so I have parallelized it a bit.

running `time ./x.py test tidy` with warm IO caches:

old:

```
real	0m11.123s
user	0m14.495s
sys	0m5.227s
```

new:

```
real	0m1.834s
user	0m13.545s
sys	0m3.094s
```

There's further room for improvement (<0.9s should be feasible) but that would require bigger changes.
2021-02-21 15:26:41 +09:00
Yuki Okushi 56ae3fb2f0
Rollup merge of #81706 - SkiFire13:document-binaryheap-unsafe, r=Mark-Simulacrum
Document BinaryHeap unsafe functions

`BinaryHeap` contains some private safe functions but that are actually unsafe to call. This PR marks them `unsafe` and documents all the `unsafe` function calls inside them.

While doing this I might also have found a bug: some "SAFETY" comments in `sift_down_range` and `sift_down_to_bottom` are valid only if you assume that `child` doesn't overflow. However it may overflow if `end > isize::MAX` which can be true for ZSTs (but I think only for them). I guess the easiest fix would be to skip any sifting if `mem::size_of::<T> == 0`.

Probably conflicts with #81127 but solving the eventual merge conflict should be pretty easy.
2021-02-21 15:26:40 +09:00
Yuki Okushi 3219a100fa
Rollup merge of #81300 - ssomers:btree_cleanup_leak_tests, r=Mark-Simulacrum
BTree: share panicky test code & test panic during clear, clone

Bases almost all tests of panic on the same, richer definition, and extends it to cloning to test panic during clone.

r? ```@Mark-Simulacrum```
2021-02-21 15:26:36 +09:00
bors a31c16212d Auto merge of #82253 - RalfJung:miri, r=RalfJung
update Miri

Fixes Miri breakage (no issue was created as the toolstate tracking is currently broken: https://github.com/rust-lang/rust/issues/82254)
2021-02-21 00:19:45 +00:00
Esteban Küber 8ead8f57c6 Add A-diagnostics bug report template 2021-02-20 17:55:54 -05:00
The8472 c07197046d remove redundant box wrapper 2021-02-20 23:12:56 +01:00
The8472 6dc948e723 limit rustfmt parallelism by taking -j into account 2021-02-20 23:12:56 +01:00
The8472 211d49c73c parallelize x.py test tidy
old:

```
real	0m11.123s
user	0m14.495s
sys	0m5.227s
```

new:

```
real	0m2.767s
user	0m13.014s
sys	0m1.691s
```
2021-02-20 23:12:53 +01:00
Jan-Erik Rediger 8d6ad11ab2
iOS simulator: pick the target based on the environment variable
LLVM picks the right things to put into the compiled object file based
on the target deployment version.
We need to communicate it through the target triple.
Only with that LLVM will use the right commands in the file to make it
look and behave like code compiled for the arm64 iOS simulator target.
2021-02-20 16:45:00 -05:00
bors d2b38d6b3c Auto merge of #82341 - GuillaumeGomez:rollup-t7y7tyg, r=GuillaumeGomez
Rollup of 7 pull requests

Successful merges:

 - #80595 (`impl PartialEq<Punct> for char`; symmetry for #78636)
 - #81991 (Fix panic in 'remove semicolon' when types are not local)
 - #82176 (fix MIR fn-ptr pretty-printing)
 - #82244 (Keep consistency in example for Stdin StdinLock)
 - #82260 (rustc: Show ``@path`` usage in stable)
 - #82316 (Fix minor mistake in LTO docs.)
 - #82332 (Don't generate src link on dummy spans)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-02-20 21:38:53 +00:00
Giacomo Stevanato 3ec1a28418 Add FIXME for safety comments that are invalid when T is a ZST 2021-02-20 15:44:17 -05:00
Giacomo Stevanato 9b4e61255c Document BinaryHeap unsafe functions 2021-02-20 15:44:17 -05:00
Guillaume Gomez fc0cb5d5eb
Rollup merge of #82332 - GuillaumeGomez:no-src-link-on-dummy-spans, r=jyn514
Don't generate src link on dummy spans

Just realized that the "auto trait impls" had `[src]` links were leading to the crate root because they were dummy spans. This PR fixes this issue.

cc `@jyn514`
r? `@camelid`
2021-02-20 20:37:04 +01:00
Guillaume Gomez 77b6f96054
Rollup merge of #82316 - ehuss:lto-doc-fix, r=GuillaumeGomez
Fix minor mistake in LTO docs.

`-C lto=true` isn't a valid option.
2021-02-20 20:37:03 +01:00
Guillaume Gomez 8c095619cb
Rollup merge of #82260 - ojeda:rustc-argfile, r=jyn514
rustc: Show `@path` usage in stable

The feature was stabilized in #66172, but the usage string was not updated to be shown.
2021-02-20 20:37:02 +01:00
Guillaume Gomez c26a8bbd6d
Rollup merge of #82244 - pickfire:patch-6, r=dtolnay
Keep consistency in example for Stdin StdinLock

Stdin uses handle whereas StdinLock uses stdin_lock, changed it to handle.
2021-02-20 20:37:01 +01:00
Guillaume Gomez 2d39300e2f
Rollup merge of #82176 - RalfJung:mir-fn-ptr-pretty, r=oli-obk
fix MIR fn-ptr pretty-printing

An uninitialized function pointer would get printed as `{{uninit  fn()}` (notice the unbalanced parentheses), and a dangling fn ptr would ICE. This fixes both of that.

However, I have no idea how to add tests for this.

Also, I don't understand this MIR pretty-printing code. Somehow the print function `pretty_print_const_scalar` actually *returns* a transformed form of the const (but there is no doc comment explaining what is being returned); some match arms do `p!` while others do `self =`, and there's a wild mixture of `p!` and `write!`... all very mysterious and confusing.^^

r? ``@oli-obk``
2021-02-20 20:37:00 +01:00
Guillaume Gomez 39af025741
Rollup merge of #81991 - osa1:issue81839, r=estebank
Fix panic in 'remove semicolon' when types are not local

It's not possible to check if removing a semicolon fixes the type error
when checking match arms and one or both of the last arm's and the
current arm's return types are imported "opaque" types. In these cases
we don't generate a "consider removing semicolon" suggestions.

Fixes #81839

---

I'm not sure how to add a test for this. I think the test would need at least two crates. Do we have any existing tests that do this so that I can take a look?
2021-02-20 20:36:57 +01:00
Guillaume Gomez d38f6e82a4
Rollup merge of #80595 - pthariensflame:patch-1, r=m-ou-se
`impl PartialEq<Punct> for char`; symmetry for #78636

Also fixes the "since" version of the original.

Pinging ``@dtolnay`` and ``@petrochenkov.``
2021-02-20 20:36:54 +01:00
bors 83b30a639d Auto merge of #70951 - cjgillot:anarchy, r=oli-obk
Move the query engine out of rustc_middle

The handling of queries is moved to a trait `QueryEngine`.
It replaces `query::Queries` in the `TyCtxt`, allowing to move the query engine out of librustc_middle.

There are 2 modes to access the query engine: through `TyCtxt` and dynamic dispatch,
or through a `QueryCtxt`. The `QueryCtxt` is  required for everything touching the `OnDiskCache`.

For now, I put it in librustc_incremental, which is very small.
This may not be the best place.

A significant part of the codegen time for librustc_middle is moved to the recipient crate.

This PR may require a perf run.

cc #65031
r? `@Zoxc`
2021-02-20 18:58:05 +00:00
Guillaume Gomez 0c511c9115 Add test for no src links on dummy spans 2021-02-20 19:51:38 +01:00
Guillaume Gomez 3071685505 Don't render [src] link on dummy spans 2021-02-20 19:51:38 +01:00
Ralf Jung 3b81b47617 update Miri 2021-02-20 18:55:50 +01:00
Ralf Jung e90674574d fn ptr pretty printing: fall back to raw ptr printing 2021-02-20 11:34:35 +01:00
bors e7c23ab933 Auto merge of #82124 - tmiasko:op-ty-ref, r=oli-obk
Pass large interpreter types by reference, not value

r? `@ghost`
2021-02-20 10:20:42 +00:00
bors da5f7f1093 Auto merge of #81427 - klensy:eat-digits, r=m-ou-se
simplify eat_digits

Simplify eat_digits by checking values in iterator, plus decrease function size, by returning unchecked slices.

https://godbolt.org/z/cxjav4
2021-02-20 07:31:43 +00:00
bors b75baad5c3 Auto merge of #78181 - GuillaumeGomez:sized-trait, r=jyn514
Add Sized trait display when implemented on type

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

I'm not too happy about the hack I had to add in here, however, it seems like the `Sized` trait is **very** special.

cc `@jyn514`
r? `@ollie27`
2021-02-20 04:35:58 +00:00
Eric Huss bf8563dc9b Fix minor mistake in LTO docs.
`-C lto=true` isn't a valid option.
2021-02-19 19:34:46 -08:00
Alexander Ronald Altman 1839748772 `impl PartialEq<Punct> for char`; symmetry for #78636
Also fixes the "since" version of the original.
2021-02-19 17:28:19 -08:00
Guillaume Gomez 46f24c912f Add tests for !Sized trait display 2021-02-19 22:38:07 +01:00
Guillaume Gomez d20e05b78b Show negative implementation of Sized trait 2021-02-19 22:38:07 +01:00
Camille GILLOT 9823c2cc70 Workaround rustdoc not honouring cfg(parallel_compiler). 2021-02-19 22:05:27 +01:00
Ricky (deg4uss3r) f10fbbbd53
added aarch64_apple_ios_sim as a rustc target 2021-02-19 13:17:05 -05:00
Camille GILLOT 4581d16bcb Move the query system to rustc_query_impl. 2021-02-19 17:51:58 +01:00
Camille GILLOT 71f749a683 Introduce a QueryEngine trait object. 2021-02-19 17:51:57 +01:00
Camille GILLOT 23f9d10ea7 Make encode_query_results more generic. 2021-02-19 17:51:57 +01:00
Camille GILLOT 24dbb61e58 Move query names and Providers to parent module. 2021-02-19 17:51:57 +01:00
Camille GILLOT 8e5d613a11 Wrap QueryDescription into a macro. 2021-02-19 17:51:57 +01:00
Camille GILLOT cdc0b199a9 Split DepKindStruct in two. 2021-02-19 17:51:56 +01:00
Camille GILLOT 1ac21e4571 Use QueryCtxt in DepKindStruct. 2021-02-19 17:51:56 +01:00
Camille GILLOT b27266fdb2 Use a QueryContext for try_mark_green. 2021-02-19 17:51:56 +01:00
Camille GILLOT 3bd14c7bbe Select caching strategy per query.
The per-Key choice was not used.
2021-02-19 17:51:56 +01:00
Camille GILLOT 6e4af4a2d1 Move definition of callbacks to parent module. 2021-02-19 17:51:56 +01:00