Commit Graph

217010 Commits

Author SHA1 Message Date
Alan Egerton
63ad5d0522
Rename folder traits' tcx method to interner 2023-02-13 10:24:51 +00:00
Alan Egerton
459e142413
Move folding and visiting traits into type library 2023-02-13 10:24:50 +00:00
Alan Egerton
9fa6bb2aa0
Make atomic structural impls generic over Interner 2023-02-13 10:24:50 +00:00
Alan Egerton
9783fcc13b
Make folding traits generic over the Interner 2023-02-13 10:24:49 +00:00
Alan Egerton
dea342d861
Make visiting traits generic over the Interner 2023-02-13 10:24:49 +00:00
Alan Egerton
0b7dda9afd
Constrain Interners to be Sized 2023-02-13 10:24:48 +00:00
Alan Egerton
38c522c693
Project Binder and Predicate from Interner trait 2023-02-13 10:24:48 +00:00
Alan Egerton
e8d152d2f4
Move TypeVisitableExt from ir module 2023-02-13 10:24:47 +00:00
Alan Egerton
b409329c62
Workaround issue #107747
Only required until fix #107803 is merged into stage0 compiler, expected
when beta 1.69.0 is released on 2023-03-09, then this commit can be
reverted.
2023-02-13 10:24:47 +00:00
Alan Egerton
36d09e3906
Split TypeVisitableExt from TypeVisitable 2023-02-13 10:24:47 +00:00
Alan Egerton
ba55a453eb
Alias folding/visiting traits instead of re-export 2023-02-13 10:24:46 +00:00
Alan Egerton
62846d7c99
Move folding & visiting traits to ir submodules 2023-02-13 10:24:45 +00:00
bors
20081880ad Auto merge of #107980 - Dylan-DPC:rollup-u4b19bl, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #107654 (reword descriptions of the deprecated int modules)
 - #107915 (Add `array::map` benchmarks)
 - #107961 (Avoid copy-pasting the `ilog` panic string in a bunch of places)
 - #107962 (Add a doc note about why `Chain` is not `ExactSizeIterator`)
 - #107966 (Update browser-ui-test version to 0.14.3)
 - #107970 (Hermit: Remove floor symbol)
 - #107973 (Fix unintentional UB in SIMD tests)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-13 07:07:33 +00:00
Dylan DPC
4bf58083ac
Rollup merge of #107973 - saethlin:fix-simd-test-ub, r=workingjubilee
Fix unintentional UB in SIMD tests

r? `@workingjubilee`
2023-02-13 11:12:52 +05:30
Dylan DPC
55f36ed0a4
Rollup merge of #107970 - hermitcore:hermit-rm-floor, r=thomcc
Hermit: Remove floor symbol

This symbol should be provided by Hermit.

It was introduced in 2019 (https://github.com/rust-lang/rust/pull/65167). Since 2020, Hermit provides these math functions on its own (https://github.com/hermitcore/rusty-hermit/pull/37). I think moving this to Hermit was merely an oversight.

Related:
* https://github.com/hermitcore/libhermit-rs/pull/654
* https://github.com/hermitcore/rusty-hermit/pull/406

CC: `@stlankes`
2023-02-13 11:12:51 +05:30
Dylan DPC
b5aeba8706
Rollup merge of #107966 - GuillaumeGomez:update-browser-ui-test, r=notriddle
Update browser-ui-test version to 0.14.3

It brings a few fixes to the `NEAR` checks. The PR for it in [here](https://github.com/GuillaumeGomez/browser-UI-test/pull/436).

r? `@notriddle`
2023-02-13 11:12:51 +05:30
Dylan DPC
f7caaa573e
Rollup merge of #107962 - scottmcm:why-not-exact, r=Mark-Simulacrum
Add a doc note about why `Chain` is not `ExactSizeIterator`

Inspired by <https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Why.20isn't.20Chain.3CA.2C.20B.3E.20an.20ExactSizeIterator.3F/near/327395874>.
2023-02-13 11:12:50 +05:30
Dylan DPC
2ec6aebb41
Rollup merge of #107961 - scottmcm:unify-ilog-panics, r=Mark-Simulacrum
Avoid copy-pasting the `ilog` panic string in a bunch of places

I also ended up changing the implementations to `if let` because it doesn't work to
```rust
self.checked_ilog2().unwrap_or_else(panic_for_nonpositive_argument)
```
due to the `!`.  But as a bonus that meant I could remove the `rustc_allow_const_fn_unstable` too.
2023-02-13 11:12:50 +05:30
Dylan DPC
c0d1e324d5
Rollup merge of #107915 - JulianKnodt:array_benches, r=Mark-Simulacrum
Add `array::map` benchmarks

Since there were no previous benchmarks for `array::map`, and it is known to have mediocre/poor performance, add some simple benchmarks. These benchmarks vary the length of the array and size of each item.
2023-02-13 11:12:49 +05:30
Dylan DPC
47358298f6
Rollup merge of #107654 - pitaj:reword-integral-modules, r=thomcc
reword descriptions of the deprecated int modules

Based on recommendation by `@est31` here: https://github.com/rust-lang/rust/pull/107587#issuecomment-1416131590

This is meant to make it more clear, when looking at the `std` or `core` docs, that these are deprecated modules - not deprecated integer types (a common misunderstanding).

Before:
![image](https://user-images.githubusercontent.com/803701/216733011-fabc22e1-4e77-4a47-96e3-a765ac4690b6.png)

After:
![image](https://user-images.githubusercontent.com/803701/216733660-02071ced-883d-4ab5-8c0a-d28547d1d5db.png)
2023-02-13 11:12:49 +05:30
bors
96834f0231 Auto merge of #107191 - Voultapher:reverse-timsort-scan-direction, r=thomcc
Reverse Timsort scan direction

Another PR in the series of stable sort improvements. Best reviewed by looking at the individual commits.

The main perf gain here is for fully ascending (sorted) or reversed inputs for cheap to compare types such as `u64`, these see a ~1.5x speedup.

![timsort_evo2_hot_u64_10k](https://user-images.githubusercontent.com/6864584/213913351-cfdf452f-a37c-4bc6-a811-d10c60e66eca.png)

![timsort_evo2_hot_string_10k](https://user-images.githubusercontent.com/6864584/213913354-d9cc395a-2b48-4f54-b687-09174b9e35ce.png)

Types such as string with indirect pre-fetching see only minor changes. Further speedups are planned in future PRs so, I wouldn't spend too much time for benchmarks here.
2023-02-13 04:06:04 +00:00
Ben Kimock
9c4696b940 Fix unintentional UB in SIMD tests 2023-02-12 20:18:48 -05:00
bors
7740f9a571 Auto merge of #107869 - nnethercote:reduce-interning, r=compiler-errors
Reduce interning

r? `@compiler-errors`
2023-02-13 00:35:26 +00:00
Martin Kröning
913a566c22 Hermit: Remove floor symbol
This symbol should be provided by Hermit.
2023-02-12 23:37:58 +01:00
Nicholas Nethercote
e261665b2c Avoid interning empty tuples. 2023-02-13 09:32:51 +11:00
Nicholas Nethercote
7a72560154 Reduce direct mk_ty usage.
We use more specific `mk_*` functions in most places, might as well use
them as much as possible.
2023-02-13 09:32:48 +11:00
Nicholas Nethercote
6248bbbf26 Pre-intern some commonly used type variables.
This requires some rearrangement of plumbing, such as adding
`mk_fresh_{,int_,float_}ty` and removing `mk_ty_infer`.
2023-02-13 09:25:36 +11:00
bors
59083c57d4 Auto merge of #107967 - matthiaskrgr:rollup-7wvbla5, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #107748 (refer to new home)
 - #107842 (Patch `build/rustfmt/lib/*.so` for NixOS)
 - #107930 (Improve JS function itemTypeFromName code a bit)
 - #107934 (rustdoc: account for intra-doc links in `<meta name="description">`)
 - #107943 (Document `PointerLike`)
 - #107954 (avoid mixing accesses of ptrs derived from a mutable ref and parent ptrs)
 - #107955 (fix UB in ancient test)
 - #107964 (rustdoc: use tighter line height in h1 and h2)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-12 21:32:23 +00:00
Matthias Krüger
1d4397ba70
Rollup merge of #107964 - notriddle:notriddle/title-line-height, r=GuillaumeGomez
rustdoc: use tighter line height in h1 and h2

This keeps the line height for body text the same, as required by WCAG, but for headers, it makes sense to have wrapped lines be a bit tighter packed.

## Before

![image](https://user-images.githubusercontent.com/1593513/218332683-88a02467-7811-4e6b-81f8-67dded691465.png)

## After

![image](https://user-images.githubusercontent.com/1593513/218332698-a1b2a265-0658-4306-8473-b835f663172d.png)
2023-02-12 22:29:50 +01:00
Matthias Krüger
f81cb97cb2
Rollup merge of #107955 - RalfJung:ancient-ub, r=jyn514
fix UB in ancient test

This seems to go back all the way to the [original version of this test](b9aa9def85/src/test/run-pass/regions-mock-trans.rs) from ten years ago... ``@nikomatsakis`` trip down memory lane? ;)

Clearly deallocation is a form of mutation so doing it to a (pointer derived from a) shared reference cannot be legal. Let's use mutable references instead.
2023-02-12 22:29:49 +01:00
Matthias Krüger
454ae9fb8b
Rollup merge of #107954 - RalfJung:tree-borrows-fix, r=m-ou-se
avoid mixing accesses of ptrs derived from a mutable ref and parent ptrs

``@Vanille-N`` is working on a successor for Stacked Borrows. It will mostly accept strictly more code than Stacked Borrows did, with one exception: the following pattern no longer works.
```rust
let mut root = 6u8;
let mref = &mut root;
let ptr = mref as *mut u8;
*ptr = 0; // Write
assert_eq!(root, 0); // Parent Read
*ptr = 0; // Attempted Write
```
This worked in Stacked Borrows kind of by accident: when doing the "parent read", under SB we Disable `mref`, but the raw ptrs derived from it remain usable. The fact that we can still use the "children" of a reference that is no longer usable is quite nasty and leads to some undesirable effects (in particular it is the major blocker for resolving https://github.com/rust-lang/unsafe-code-guidelines/issues/257). So in Tree Borrows we no longer do that; instead, reading from `root` makes `mref` and all its children read-only.

Due to other improvements in Tree Borrows, the entire Miri test suite still passes with this new behavior, and even the entire libcore and liballoc test suite, except for these 2 cases this PR fixes. Both of these involve code where the programmer wrote `&mut` but then used pointers derived from that reference in ways that alias with the parent pointer, which arguably is violating uniqueness. They are fixed by properly using raw pointers throughout.
2023-02-12 22:29:49 +01:00
Matthias Krüger
4b91b673b7
Rollup merge of #107943 - compiler-errors:document-pointer-like, r=jyn514
Document `PointerLike`

I forgot to document this, and even though it's currently more of an implementation detail, the old doc was kinda embarrassing 😅
2023-02-12 22:29:48 +01:00
Matthias Krüger
9b503325b4
Rollup merge of #107934 - notriddle:notriddle/intra-doc-link-meta-description, r=camelid,GuillaumeGomez
rustdoc: account for intra-doc links in `<meta name="description">`

Similar to #86451, but for the SEO descriptions instead of the search descriptions.
2023-02-12 22:29:48 +01:00
Matthias Krüger
76c47fb904
Rollup merge of #107930 - GuillaumeGomez:js-func-improvement, r=notriddle
Improve JS function itemTypeFromName code a bit

Very small code improvement replacing a `for` loop with `findIndex` method.

r? ````@notriddle````
2023-02-12 22:29:48 +01:00
Matthias Krüger
ca99d51b6d
Rollup merge of #107842 - fee1-dead-contrib:patch_rustfmt_nixos, r=Mark-Simulacrum
Patch `build/rustfmt/lib/*.so` for NixOS

fixes #107676.
2023-02-12 22:29:47 +01:00
Matthias Krüger
d29aba19d0
Rollup merge of #107748 - tshepang:renamed, r=cuviper
refer to new home

The module has since been made its own crate...
see 2d75a339ca.
2023-02-12 22:29:47 +01:00
Guillaume Gomez
5fe1046668 Update browser-ui-test version to 0.14.3 2023-02-12 22:02:39 +01:00
Michael Howell
b0df355f80 rustdoc: use tighter line height in h1 and h2 2023-02-12 12:30:57 -07:00
Scott McMurray
79d2430e99 Add a doc note about why Chain is not ExactSizeIterator 2023-02-12 10:37:25 -08:00
bors
5b8f284536 Auto merge of #107643 - Zoxc:single-cache, r=cjgillot
Create a single value cache for the () query key

Since queries using `()` as the key can only store a single value, specialize for that case.

This looks like a minor performance improvement:
<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.8477s</td><td align="right">1.8415s</td><td align="right"> -0.33%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2666s</td><td align="right">0.2655s</td><td align="right"> -0.40%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.3943s</td><td align="right">6.3686s</td><td align="right"> -0.40%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.6413s</td><td align="right">1.6345s</td><td align="right"> -0.42%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">1.0337s</td><td align="right">1.0313s</td><td align="right"> -0.24%</td></tr><tr><td>Total</td><td align="right">11.1836s</td><td align="right">11.1414s</td><td align="right"> -0.38%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9964s</td><td align="right"> -0.36%</td></tr></table>
2023-02-12 17:20:33 +00:00
Ralf Jung
0ea0c90d58 fix UB in ancient test 2023-02-12 16:30:37 +01:00
bors
00cf19a75a Auto merge of #107933 - petrochenkov:rmdlc, r=GuillaumeGomez
rustdoc: Remove cache for preprocessed markdown links

It's quite possible that it's no longer useful after https://github.com/rust-lang/rust/pull/94857 is merged.
2023-02-12 14:28:43 +00:00
Ralf Jung
c3a2e7a809 avoid mixing accesses of ptrs derived from a mutable ref and parent ptrs 2023-02-12 15:16:27 +01:00
bors
adb4bfd25d Auto merge of #105671 - lukas-code:depreciate-char, r=scottmcm
Use associated items of `char` instead of freestanding items in `core::char`

The associated functions and constants on `char` have been stable since 1.52 and the freestanding items have soft-deprecated since 1.62 (https://github.com/rust-lang/rust/pull/95566). This PR ~~marks them as "deprecated in future", similar to the integer and floating point modules (`core::{i32, f32}` etc)~~ replaces all uses of `core::char::*` with `char::*` to prepare for future deprecation of `core::char::*`.
2023-02-12 11:09:06 +00:00
bors
51cb5614dd Auto merge of #105601 - BelovDV:change-rlib-with-not-stable, r=petrochenkov
Enable new rlib in non stable cases

If bundled static library uses cfg (unstable) or whole-archive (wasn't supported) bundled libs are packed even without packed_bundled_libs.

r? `@petrochenkov`
2023-02-12 07:15:27 +00:00
bors
b7089e0dd3 Auto merge of #107894 - Voultapher:improve-heapsort-fallback, r=scottmcm
Speedup heapsort by 1.5x by making it branchless

`slice::sort_unstable` will fall back to heapsort if it repeatedly fails to find a good pivot. By making the core child update code branchless it is much faster. On Zen3 sorting 10k `u64` and forcing the sort to pick heapsort, results in:

455us -> 278us
2023-02-12 03:30:10 +00:00
Michael Goulet
cca82fd997 Document PointerLike 2023-02-12 01:23:02 +00:00
bors
d094016128 Auto merge of #106677 - tbu-:pr_less_doc_hidden_pub, r=scottmcm
Remove a couple of `#[doc(hidden)] pub fn` and their `#[feature]` gates
2023-02-11 23:57:05 +00:00
Michael Howell
72b3f46b43 rustdoc: account for intra-doc links in <meta name="description"> 2023-02-11 16:10:28 -07:00
John Kåre Alsaker
80d265240b Create a single value cache for the () query key 2023-02-11 23:38:01 +01:00