Commit Graph

217046 Commits

Author SHA1 Message Date
Matthias Krüger
f1a349457f
Rollup merge of #108013 - notriddle:notriddle/search-index-itemtype, r=GuillaumeGomez
rustdoc: use a string with one-character codes for search index types

    $ wc -c search-index.old.js search-index.new.js
    3940530 search-index.old.js
    3843222 search-index.new.js

((3940530-3843222)/3940530)*100 = 2.47%

    $ wc -c search-index.old.js.gz search-index.new.js.gz
    380251 search-index.old.js.gz
    379434 search-index.new.js.gz

((380251-379434)/380251)*100 = 0.214%
2023-02-13 23:25:15 +01:00
Matthias Krüger
9bf807e7a1
Rollup merge of #108002 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

2 commits in f2a78f64b668f63f581203c6bac509903f7c00ee..d94e03a18a2590ed3f1c67b859cb11528d2a2d5c
2023-02-10 16:01:09 UTC to 2023-02-10 15:55:43 UTC

- Update to Rust 1.67.1
- Update to Rust 1.66.1

## rust-embedded/book

1 commits in f1a4614aa41cc544b91b79760a709e113f3451d7..701d1551429da4cb609082c0ac99df569e336710
2023-01-31 12:32:49 UTC to 2023-01-31 12:32:49 UTC

- fix: Circled Image not visible on B&W E-Ink screen (rust-embedded/book#339)

## rust-lang/nomicon

2 commits in bd1829d235296952bf72ca55635e360584b8805e..79b53665a7c61d171fb8c5ad0b73b371f9ee6ba7
2023-02-13 08:40:24 UTC to 2023-02-07 09:43:03 UTC

- Fixes double bug in Send-Sync example (rust-lang/nomicon#401)
- Small language fix in subtyping.md (rust-lang/nomicon#399)

## rust-lang/reference

4 commits in 22882fb3f7b4d69fdc0d1731e8b9cfcb6910537d..e5adb99c04817b7fbe08f4ffce5b36702667345f
2023-02-08 18:09:03 UTC to 2023-02-01 03:49:46 UTC

- Eliminate 'half open' terminology from range pattern grammar (rust-lang/reference#1330)
- fix place expression context example (rust-lang/reference#1327)
- remove confusing words (rust-lang/reference#1324)
- Reword "expression for a match arm" (rust-lang/reference#1325)

## rust-lang/rust-by-example

5 commits in 134376872e8c387ef369507e0ee9b5a0e3272718..efe23c4fe12e06351b8dc8c3d18312c761455109
2023-02-06 11:32:23 UTC to 2023-01-31 16:38:03 UTC

- fix irrelevant comments (rust-lang/rust-by-example#1676)
- remove redudant code (rust-lang/rust-by-example#1675)
- Line comments: change 'inside' to 'after' (rust-lang/rust-by-example#1674)
- fix incorrect trait bound demonstration (rust-lang/rust-by-example#1673)
- fix "High Order Functions" typo (rust-lang/rust-by-example#1672)

## rust-lang/rustc-dev-guide

14 commits in e359ee27fc3da3356d71a732128c0a1abe02e53a..41a96ab971cb45e2a184df20619ad1829765c990
2023-02-11 06:41:56 UTC to 2023-01-31 18:42:30 UTC

- Add a citation file (rust-lang/rustc-dev-guide#1550)
- Improve git submodule help (rust-lang/rustc-dev-guide#1587)
- update examples for rustc 1.69.0-nightly (e1eaa2d5d 2023-02-06) (rust-lang/rustc-dev-guide#1590)
- Replace settings.json with x.py setup note (rust-lang/rustc-dev-guide#1588)
- Do not add accept header on linkcheck (rust-lang/rustc-dev-guide#1586)
- Fixed small grammar mistake in monomorph.md (rust-lang/rustc-dev-guide#1585)
- update bootstrap guide (rust-lang/rustc-dev-guide#1583)
- Use host symlink for custom rustup toolchain (rust-lang/rustc-dev-guide#1580)
- Fix broken links (rust-lang/rustc-dev-guide#1577)
- Add section on comparing types (rust-lang/rustc-dev-guide#1570)
- Update rustfmt path (rust-lang/rustc-dev-guide#1574)
- fix wrong heading level (rust-lang/rustc-dev-guide#1573)
- fix incorrect position of `Clarification of build command's stdout` (rust-lang/rustc-dev-guide#1572)
- extend bootstrap related documentations (rust-lang/rustc-dev-guide#1563)
2023-02-13 23:25:14 +01:00
Matthias Krüger
56193b0e60
Rollup merge of #107985 - alesito85:master, r=ChrisDenton
Added another error to be processed in fallback

This pull request addresses the problem of Rust not being able to read file/directory metadata because the current user doesn't have permission to read the file and are thus inaccessible.

One particular example is `System Volume Information`. But any example can be made by having a file/directory, which the current user can't access even though the system does allow to view the metadata, which is handled by the fallback.

The fallback exists to get the metadata but it was limited to one error type. Having added ERROR_ACCESS_DENIED per Chris Denton's suggestion, file/directory properties are now properly read.

Solution suggested by Chris Denton https://github.com/nushell/nushell/issues/6857#issuecomment-1426847135
2023-02-13 23:25:13 +01:00
Matthias Krüger
5915309645
Rollup merge of #107971 - saethlin:mir-opt-ub, r=cjgillot
Clearly document intentional UB in mir-opt tests

All of the changed mir-opt test input files did not pass Miri. Now they do.

r? `@cjgillot` because there's a CopyProp test in here that I do not fully understand
2023-02-13 23:25:13 +01:00
Matthias Krüger
7efb884b9c
Rollup merge of #107948 - jieyouxu:issue-107944, r=ozkanonur
Allow shortcuts to directories to be used for ./x.py fmt

Fixes #107944.

Maximum recursive search depth is 3 and only accepts shortcuts for directories. If there are no shortcut candidates, the previous behavior to panic is preserved. If there are multiple candidates, the shortcut candidates are ignored.

After this change, `./x.py fmt std` no longer panics and formats `library/std` instead.
2023-02-13 23:25:12 +01:00
Matthias Krüger
5f3d360844
Rollup merge of #107942 - compiler-errors:tighter-inherent-impl-bad-spans, r=Nilstrieb
Tighter spans for bad inherent `impl` self types

Self-explanatory
2023-02-13 23:25:12 +01:00
Matthias Krüger
5c94f4a112
Rollup merge of #107913 - base0x10:master, r=compiler-errors
Update broken link in cargo style guide

Toml now uses [toml.io](https://toml.io) for released specifications and the github repo for development. Also the old link was for the 0.4 specification, while cargo uses toml_edit, which uses toml 1.0 (reference:
https://github.com/toml-rs/toml/blob/main/crates/toml_edit/CHANGELOG.md#030---2021-09-13). Finally the discussion of "Bare keys" vs "Quoted keys" has moved from the `#table` section to `#keys`.
2023-02-13 23:25:11 +01:00
Matthias Krüger
73b022b8e1
Rollup merge of #107902 - vincenzopalazzo:macros/async_fn_suggestion, r=compiler-errors
fix: improve the suggestion on future not awaited

Considering the following code

```rust
fn foo() -> u8 {
    async fn async_fn() -> u8 {  22 }

    async_fn()
}

fn main() {}
```

the error generated before this commit from the compiler is

```
➜  rust git:(macros/async_fn_suggestion) ✗ rustc test.rs --edition 2021
error[E0308]: mismatched types
 --> test.rs:4:5
  |
1 | fn foo() -> u8 {
  |             -- expected `u8` because of return type
...
4 |     async_fn()
  |     ^^^^^^^^^^ expected `u8`, found opaque type
  |
  = note:     expected type `u8`
          found opaque type `impl Future<Output = u8>`
help: consider `await`ing on the `Future`
  |
4 |     async_fn().await
  |               ++++++

error: aborting due to previous error
```

In this case the error is nor perfect, and can confuse the user that do not know that the opaque type is the future.

So this commit will propose (and conclude the work start in https://github.com/rust-lang/rust/issues/80658)
to change the string `opaque type` to `future` when applicable and also remove the Expected vs Received note by adding a more specific one regarding the async function that return a future type.

So the new error emitted by the compiler is

```
error[E0308]: mismatched types
 --> test.rs:4:5
  |
1 | fn foo() -> u8 {
  |             -- expected `u8` because of return type
...
4 |     async_fn()
  |     ^^^^^^^^^^ expected `u8`, found future
  |
note: calling an async function returns a future
 --> test.rs:4:5
  |
4 |     async_fn()
  |     ^^^^^^^^^^
help: consider `await`ing on the `Future`
  |
4 |     async_fn().await
  |               ++++++

error: aborting due to previous error
```

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

It remains to rework the case described in the following issue https://github.com/rust-lang/rust/issues/107899 but I think this deserves its own PR after we discuss a little bit how to handle these kinds of cases.

r? `@eholk`

`@rustbot` label +I-async-nominated

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-02-13 23:25:11 +01:00
Michael Howell
a7b69ddea9 rustdoc: use a string with one-character codes for search index types
$ wc -c search-index.old.js search-index.new.js
    3940530 search-index.old.js
    3843222 search-index.new.js

((3940530-3843222)/3940530)*100 = 2.47%

    $ wc -c search-index.old.js.gz search-index.new.js.gz
    380251 search-index.old.js.gz
    379434 search-index.new.js.gz

((380251-379434)/380251)*100 = 0.214%
2023-02-13 14:27:00 -07:00
Ben Kimock
614df3fd5e Clearly document intentional UB in mir-opt tests
Co-authored-by: Jakob Degen <jakob.e.degen@gmail.com>
2023-02-13 13:50:50 -05:00
Michael Goulet
e20f6ff1dc Tighter spans for bad inherent impl types 2023-02-13 18:41:18 +00:00
许杰友 Jieyou Xu (Joe)
b10d744b87
Allow shortcuts to directories to be used for ./x.py fmt
Fixes #107944.

Maximum recursive search depth is 3 and only accepts shortcuts for
directories (single component paths, such as `./x.py fmt std`). If
there are no shortcut candidates but single componenet path(s) are
given, it falls back to the previous behavior to panic with unable to
find directory. If there are multiple shortcut candidates for a given
single component path, the shortcut candidates are considered
ambiguous, are then ignored, and the single component path is accepted
as-is.

After this change, `./x.py fmt std` no longer panics and formats
`library/std` instead.
2023-02-14 01:47:12 +08:00
rustbot
9dcad5a340 Update books 2023-02-13 12:01:05 -05:00
bors
a3c9eede5d Auto merge of #107924 - eggyal:move_fold_visit_traits_to_type_lib_with_trait_alias, r=oli-obk
Move folding & visiting traits into type library

This is a rework of #107712, following feedback on that PR.

In particular, this version uses trait aliases to reduce the API churn for trait consumers.  Doing so requires a workaround for #107747 until its fix in #107803 is merged into the stage0 compiler; this workaround, which uses conditional compilation based on the `bootstrap` configuration predicate, sits in dedicated commit b409329c for ease of reversion.

The possibility of the `rustc_middle` crate retaining its own distinct versions of each folding/visiting trait, blanket-implemented on all types that implement the respective trait in the type library, was also explored: however since this would necessitate making each `rustc_middle` trait a subtrait of the respective type library trait (so that such blanket implementations can delegate their generic methods), no benefit would be gained.

r? types
2023-02-13 16:50:33 +00:00
Vincenzo Palazzo
2bdc9a046a
fix: improve the suggestion on future not awaited
Considering the following code

```rust
fn foo() -> u8 {
    async fn async_fn() -> u8 {  22 }

    async_fn()
}

fn main() {}
```

the error generated before this commit from the compiler is

```
➜  rust git:(macros/async_fn_suggestion) ✗ rustc test.rs --edition 2021
error[E0308]: mismatched types
 --> test.rs:4:5
  |
1 | fn foo() -> u8 {
  |             -- expected `u8` because of return type
...
4 |     async_fn()
  |     ^^^^^^^^^^ expected `u8`, found opaque type
  |
  = note:     expected type `u8`
          found opaque type `impl Future<Output = u8>`
help: consider `await`ing on the `Future`
  |
4 |     async_fn().await
  |               ++++++

error: aborting due to previous error
```

In this case the error is nor perfect, and can confuse the user
that do not know that the opaque type is the future.

So this commit will propose (and conclude the work start in
https://github.com/rust-lang/rust/issues/80658)
to change the string `opaque type` to `future` when applicable
and also remove the Expected vs Received note by adding a more
specific one regarding the async function that return a future type.

So the new error emitted by the compiler is

```
error[E0308]: mismatched types
 --> test.rs:4:5
  |
1 | fn foo() -> u8 {
  |             -- expected `u8` because of return type
...
4 |     async_fn()
  |     ^^^^^^^^^^ expected `u8`, found future
  |
note: calling an async function returns a future
 --> test.rs:4:5
  |
4 |     async_fn()
  |     ^^^^^^^^^^
help: consider `await`ing on the `Future`
  |
4 |     async_fn().await
  |               ++++++

error: aborting due to previous error
```

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-02-13 16:23:23 +01:00
bors
0b439b119b Auto merge of #107989 - matthiaskrgr:rollup-jklrd5g, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #107340 (rustdoc: merge doctest tooltip with notable traits tooltip)
 - #107838 (Introduce `-Zterminal-urls` to use OSC8 for error codes)
 - #107922 (Print disk usage in PGO CI script)
 - #107931 (Intern span when length is MAX_LEN with parent.)
 - #107935 (rustc_ast: Merge impls and reorder methods for attributes and meta items)
 - #107986 (layout: deal with placeholders, ICE on bound types)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-13 13:37:22 +00:00
alesito85
f72eb4704a Add another error to Windows file open fallback
Added another error to be processed in fallback

Solution suggested by Chris Denton https://github.com/nushell/nushell/issues/6857#issuecomment-1426847135
2023-02-13 11:50:25 +01:00
Matthias Krüger
8701e80722
Rollup merge of #107986 - lcnr:layout-placeholder, r=petrochenkov
layout: deal with placeholders, ICE on bound types

A placeholder type is the same as a param as they represent "this could be any type". A bound type represents a type inside of a `for<T>` or `exists<T>`. When entering a forall or exists `T` should be instantiated as a existential (inference var) or universal (placeholder). You should never observe a bound variable without its binder.
2023-02-13 11:34:59 +01:00
Matthias Krüger
99d36b137d
Rollup merge of #107935 - petrochenkov:attreorder, r=michaelwoerister
rustc_ast: Merge impls and reorder methods for attributes and meta items

Merge `impl` blocks for the same types, change order of methods to be more predictable and consistent between impls.
No functional changes.
Follow up to https://github.com/rust-lang/rust/pull/107569.
2023-02-13 11:34:58 +01:00
Matthias Krüger
3e5c11b855
Rollup merge of #107931 - cjgillot:issue-107353, r=WaffleLapkin
Intern span when length is MAX_LEN with parent.

Fixes https://github.com/rust-lang/rust/issues/107353
2023-02-13 11:34:58 +01:00
Matthias Krüger
8674adc25c
Rollup merge of #107922 - Kobzol:ci-print-disk-size, r=Mark-Simulacrum
Print disk usage in PGO CI script

To diagnose issues like https://github.com/rust-lang/rust/pull/94857#issuecomment-1426648675.
2023-02-13 11:34:57 +01:00
Matthias Krüger
780beae7bd
Rollup merge of #107838 - estebank:terminal_hyperlinks, r=nagisa
Introduce `-Zterminal-urls` to use OSC8 for error codes

Terminals supporting the OSC8 Hyperlink Extension can support inline anchors where the text is user defineable but clicking on it opens a browser to a specified URLs, just like `<a href="URL">` does in HTML.

https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
2023-02-13 11:34:57 +01:00
Matthias Krüger
3054759fa8
Rollup merge of #107340 - notriddle:notriddle/simplify-doctest-tooltip, r=GuillaumeGomez
rustdoc: merge doctest tooltip with notable traits tooltip

Fixes https://discord.com/channels/442252698964721669/443150878111694848/1066420140167680000

<details><summary>a user report where the tooltip arrow overlaps the text</summary>

![](https://cdn.discordapp.com/attachments/443150878111694848/1066420139530145812/this-example-is-not-tested-busted-rendering.png)

</details>

Fixes #91100

Preview: <https://notriddle.com/notriddle-rustdoc-demos/simplify-doctest-tooltip/std/vec/struct.Vec.html#indexing>

Screenshot:

![image](https://user-images.githubusercontent.com/1593513/214975516-72667632-4609-49fa-8c37-e8d2ba1ba7dc.png)
2023-02-13 11:34:56 +01:00
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
2d91939bb7 Auto merge of #107634 - scottmcm:array-drain, r=thomcc
Improve the `array::map` codegen

The `map` method on arrays [is documented as sometimes performing poorly](https://doc.rust-lang.org/std/primitive.array.html#note-on-performance-and-stack-usage), and after [a question on URLO](https://users.rust-lang.org/t/try-trait-residual-o-trait-and-try-collect-into-array/88510?u=scottmcm) prompted me to take another look at the core [`try_collect_into_array`](7c46fb2111/library/core/src/array/mod.rs (L865-L912)) function, I had some ideas that ended up working better than I'd expected.

There's three main ideas in here, split over three commits:
1. Don't use `array::IntoIter` when we can avoid it, since that seems to not get SRoA'd, meaning that every step writes things like loop counters into the stack unnecessarily
2. Don't return arrays in `Result`s unnecessarily, as that doesn't seem to optimize away even with `unwrap_unchecked` (perhaps because it needs to get moved into a new LLVM type to account for the discriminant)
3. Don't distract LLVM with all the `Option` dances when we know for sure we have enough items (like in `map` and `zip`).  This one's a larger commit as to do it I ended up adding a new `pub(crate)` trait, but hopefully those changes are still straight-forward.

(No libs-api changes; everything should be completely implementation-detail-internal.)

It's still not completely fixed -- I think it needs pcwalton's `memcpy` optimizations still (#103830) to get further -- but this seems to go much better than before.  And the remaining `memcpy`s are just `transmute`-equivalent (`[T; N] -> ManuallyDrop<[T; N]>` and `[MaybeUninit<T>; N] -> [T; N]`), so hopefully those will be easier to remove with LLVM16 than the previous subobject copies 🤞

r? `@thomcc`

As a simple example, this test
```rust
pub fn long_integer_map(x: [u32; 64]) -> [u32; 64] {
    x.map(|x| 13 * x + 7)
}
```
On nightly <https://rust.godbolt.org/z/xK7548TGj> takes `sub rsp, 808`
```llvm
start:
  %array.i.i.i.i = alloca [64 x i32], align 4
  %_3.sroa.5.i.i.i = alloca [65 x i32], align 4
  %_5.i = alloca %"core::iter::adapters::map::Map<core::array::iter::IntoIter<u32, 64>, [closure@/app/example.rs:2:11: 2:14]>", align 8
```
(and yes, that's a 6**5**-element array `alloca` despite 6**4**-element input and output)

But with this PR it's only `sub rsp, 520`
```llvm
start:
  %array.i.i.i.i.i.i = alloca [64 x i32], align 4
  %array1.i.i.i = alloca %"core::mem::manually_drop::ManuallyDrop<[u32; 64]>", align 4
```

Similarly, the loop it emits on nightly is scalar-only and horrifying
```nasm
.LBB0_1:
        mov     esi, 64
        mov     edi, 0
        cmp     rdx, 64
        je      .LBB0_3
        lea     rsi, [rdx + 1]
        mov     qword ptr [rsp + 784], rsi
        mov     r8d, dword ptr [rsp + 4*rdx + 528]
        mov     edi, 1
        lea     edx, [r8 + 2*r8]
        lea     r8d, [r8 + 4*rdx]
        add     r8d, 7
.LBB0_3:
        test    edi, edi
        je      .LBB0_11
        mov     dword ptr [rsp + 4*rcx + 272], r8d
        cmp     rsi, 64
        jne     .LBB0_6
        xor     r8d, r8d
        mov     edx, 64
        test    r8d, r8d
        jne     .LBB0_8
        jmp     .LBB0_11
.LBB0_6:
        lea     rdx, [rsi + 1]
        mov     qword ptr [rsp + 784], rdx
        mov     edi, dword ptr [rsp + 4*rsi + 528]
        mov     r8d, 1
        lea     esi, [rdi + 2*rdi]
        lea     edi, [rdi + 4*rsi]
        add     edi, 7
        test    r8d, r8d
        je      .LBB0_11
.LBB0_8:
        mov     dword ptr [rsp + 4*rcx + 276], edi
        add     rcx, 2
        cmp     rcx, 64
        jne     .LBB0_1
```

whereas with this PR it's unrolled and vectorized
```nasm
	vpmulld	ymm1, ymm0, ymmword ptr [rsp + 64]
	vpaddd	ymm1, ymm1, ymm2
	vmovdqu	ymmword ptr [rsp + 328], ymm1
	vpmulld	ymm1, ymm0, ymmword ptr [rsp + 96]
	vpaddd	ymm1, ymm1, ymm2
	vmovdqu	ymmword ptr [rsp + 360], ymm1
```
(though sadly still stack-to-stack)
2023-02-13 10:18:48 +00:00
lcnr
9e84b00d44 layout: deal with placeholders, ICE on bound types
a placeholder type is the same as a param as they
represent "this could be any type". A bound type
represents a type inside of a `for<T>` or `exists<T>`.
When entering a forall or exists `T` should be
instantiated as a existential (inference var) or universal
(placeholder). You should never observe a bound variable
without its binder.
2023-02-13 10:47:12 +01: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