Commit Graph

206302 Commits

Author SHA1 Message Date
Matthias Krüger
6900638c53
Rollup merge of #102226 - RalfJung:miri-sysroot-build, r=oli-obk
bootstrap/miri: switch to non-deprecated env var for setting the sysroot folder

r? `@oli-obk`
2022-09-24 14:29:56 +02:00
Matthias Krüger
81eb35f18a
Rollup merge of #102210 - notriddle:notriddle/did-you-mean, r=cjgillot
diagnostics: avoid syntactically invalid suggestion in if conditionals

Fixes #101065
2022-09-24 14:29:56 +02:00
Matthias Krüger
5fb41a6031
Rollup merge of #102204 - fee1-dead-contrib:manually-drop-trivially-drop, r=oli-obk
Make `ManuallyDrop` satisfy `~const Destruct`
2022-09-24 14:29:55 +02:00
Matthias Krüger
1c4a85fc40
Rollup merge of #102203 - notriddle:notriddle/source-sidebar, r=GuillaumeGomez
rustdoc: remove no-op CSS `#source-sidebar { z-index }`

This rule became redundant in 07e3f998b1. When `#source-sidebar` became nested below `.sidebar`, it went from being `position: fixed` to `position: static`, and according to MDN's [z-index] documentation, this means it has no effect.

[z-index]: https://developer.mozilla.org/en-US/docs/Web/CSS/z-index
2022-09-24 14:29:55 +02:00
Matthias Krüger
455a20b7ba
Rollup merge of #102186 - ink-feather-org:const_try_trait, r=fee1-dead
Add const_closure, Constify Try trait

Adds a struct for creating const `FnMut` closures (for now just copy pasted form my [const_closure](https://crates.io/crates/const_closure) crate).
I'm not sure if this way is how it should be done.
The `ConstFnClosure` and `ConstFnOnceClosure` structs can probably also be entirely removed.

This is then used to constify the try trait.

Not sure if i should add const_closure in its own pr and maybe make it public behind a perma-unstable feature gate.

cc ```@fee1-dead```  ```@rust-lang/wg-const-eval```
2022-09-24 14:29:54 +02:00
Matthias Krüger
eb628e8670
Rollup merge of #102109 - petrochenkov:addids, r=oli-obk
resolve: Set effective visibilities for imports more precisely

Instead of setting them for all primary and additional IDs of the import, only set them for the binding's true ID.
2022-09-24 14:29:53 +02:00
Matthias Krüger
bf167e0ae5
Rollup merge of #102088 - oli-obk:cleanups, r=bjorn3
Fix wrongly refactored Lift impl

see https://github.com/rust-lang/rust/pull/101858#issuecomment-1252713639

r? ``@bjorn3``
2022-09-24 14:29:53 +02:00
Matthias Krüger
1b1596c118
Rollup merge of #100823 - WaffleLapkin:less_offsets, r=scottmcm
Refactor some `std` code that works with pointer offstes

This PR replaces `pointer::offset` in standard library with `pointer::add` and `pointer::sub`, [re]moving some casts and using `.addr()` while we are at it.

This is a more complicated refactor than all other sibling PRs, so take a closer look when reviewing, please 😃  (though I've checked this multiple times and it looks fine).

r? ````@scottmcm````

_split off from #100746, continuation of #100822_
2022-09-24 14:29:52 +02:00
bors
cdb76db493 Auto merge of #102167 - thomcc:exclusive-inline, r=scottmcm
Add `#[inline]` to trivial functions on `core::sync::Exclusive`

When optimizing for size things like these sometimes don't inlined even though they're generic. This is bad because they're no-ops.

Only dodgy one is poll I guess since it forwards to the inner poll, but it's not like we're doing `#[inline(always)]` here.
2022-09-24 12:17:53 +00:00
bors
bb5a016175 Auto merge of #102064 - cjgillot:revert, r=Mark-Simulacrum
Revert perf-regression 101620

Reverts #101862 #101620

r? `@Mark-Simulacrum`
2022-09-24 09:36:29 +00:00
bors
199fe1d169 Auto merge of #102223 - matthiaskrgr:rollup-wb1qdhk, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #101780 (Add a platform support document for Android)
 - #102044 (Remove `RtlGenRandom` (take two))
 - #102081 (Adding ignore fuchsia tests for execvp (pre_exec))
 - #102082 (Adding ignore fuchsia non-applicable commands)
 - #102146 (rustdoc: CSS prevent sidebar width change jank)
 - #102152 (Calculate `ProjectionTy::trait_def_id` for return-position `impl Trait` in trait correctly)
 - #102175 (Also require other subtrees to always build successfully)
 - #102176 (Add `llvm-dis` to the set of tools in `ci-llvm`)
 - #102188 (Update doc after renaming `fn is_zero`)
 - #102199 (Improve rustdoc GUI tests)
 - #102218 (Document some missing command-line arguments)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-24 06:55:32 +00:00
Ralf Jung
5f77ce0296 bootstrap/miri: switch to non-deprecated env var for setting the sysroot folder 2022-09-24 08:53:40 +02:00
Deadbeef
a480ab6839 Allow specializing on const trait bounds 2022-09-24 06:22:59 +00:00
Matthias Krüger
4fc33e9443
Rollup merge of #102218 - ehuss:rustc-flags, r=JohnTitor
Document some missing command-line arguments

The rustc command-line arguments docs should document all of the stable arguments for rustc. Two were missing, `--force-warn` which was somewhat documented in the lint-levels chapter, but should also include a mention in the arguments list.  `--diagnostic-width` was stabilized in #95635, but the docs weren't updated.
2022-09-24 07:38:58 +02:00
Matthias Krüger
865e4566e7
Rollup merge of #102199 - GuillaumeGomez:improve-rustdoc-gui-tests, r=notriddle
Improve rustdoc GUI tests

I finally finished the update so we can now store values in variables and use them. It improves things nicely.

r? ``@notriddle``
2022-09-24 07:38:58 +02:00
Matthias Krüger
be902e8905
Rollup merge of #102188 - flba-eb:doc_missed_at_rename, r=jyn514
Update doc after renaming `fn is_zero`

`fn is_zero` has been renamed to `fn count_is_zero` in 1b1bf24636.
This patch updates the documentation accordingly.
2022-09-24 07:38:57 +02:00
Matthias Krüger
0cd345c247
Rollup merge of #102176 - ojeda:add-llvm-dis-to-ci-llvm, r=Mark-Simulacrum
Add `llvm-dis` to the set of tools in `ci-llvm`

The LLVM disassembler is needed for the test introduced in https://github.com/rust-lang/rust/pull/97550.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-09-24 07:38:56 +02:00
Matthias Krüger
00dfc32cad
Rollup merge of #102175 - oli-obk:miri_subtree_cleanup, r=jyn514
Also require other subtrees to always build successfully

r? ``@jyn514``
2022-09-24 07:38:56 +02:00
Matthias Krüger
a842357d37
Rollup merge of #102152 - compiler-errors:issue-102140, r=fee1-dead
Calculate `ProjectionTy::trait_def_id` for return-position `impl Trait` in trait correctly

Fixes #102140
2022-09-24 07:38:56 +02:00
Matthias Krüger
9a4fe30fff
Rollup merge of #102146 - notriddle:notriddle/sidebar-jank, r=GuillaumeGomez
rustdoc: CSS prevent sidebar width change jank

This commit makes the `width` and `min-width` of the sidebar the same. They originally were when cad0fce205 added the `min-width` rule, but 6a5f8b1aef changed the `width` without changing the `min-width`, causing it to sometimes oscilate between 200 and 250 pixels depending on the main content.

# Before

[Screencast from 09-22-2022 10:25:29 AM.webm](https://user-images.githubusercontent.com/1593513/191813469-ea00f30f-6f49-40fc-9a26-e1dfd5068d2b.webm)

# After

[Screencast from 09-22-2022 10:32:20 AM.webm](https://user-images.githubusercontent.com/1593513/191813642-ae0902da-5262-403a-bbdf-995334201acb.webm)
2022-09-24 07:38:55 +02:00
Matthias Krüger
6b67b0d34f
Rollup merge of #102082 - andrewpollack:uid-ignore, r=tmandry
Adding ignore fuchsia non-applicable commands

Adding ignore fuchsia non-applicable commands

cc `@djkoloski`

r? `@tmandry`
2022-09-24 07:38:54 +02:00
Matthias Krüger
49ef55c708
Rollup merge of #102081 - andrewpollack:add-execvp-calls-ignore, r=tmandry
Adding ignore fuchsia tests for execvp (pre_exec)

Adding ignore fuchsia tests for pre_exec, which calls execvp

cc. `@djkoloski`

r? `@tmandry`
2022-09-24 07:38:54 +02:00
Matthias Krüger
3baf5f8d9a
Rollup merge of #102044 - ChrisDenton:BCrypt-system-rand, r=thomcc
Remove `RtlGenRandom` (take two)

First try to use the system preferred RNG but if that fails (e.g. due to a broken system configuration) then fallback to manually opening an algorithm handle.
2022-09-24 07:38:53 +02:00
Matthias Krüger
6fff4d9cfd
Rollup merge of #101780 - chriswailes:android-platform, r=joshtriplett
Add a platform support document for Android

r? ``@joshtriplett``
2022-09-24 07:38:52 +02:00
Scott McMurray
f0dc35927b Put back one of the uses for intra-doc mentions 2022-09-23 21:47:23 -07:00
bors
06968954f7 Auto merge of #100845 - timvermeulen:iter_compare, r=scottmcm
Use internal iteration in `Iterator` comparison methods

Updates the `Iterator` methods `cmp_by`, `partial_cmp_by`, and `eq_by` to use internal iteration on `self`. I've also extracted their shared logic into a private helper function `iter_compare`, which will either short-circuit once the comparison result is known or return the comparison of the lengths of the iterators.

This change also indirectly benefits calls to `cmp`, `partial_cmp`, `eq`, `lt`, `le`, `gt`, and `ge`.

Unsurprising benchmark results: iterators that benefit from internal iteration (like `Chain`) see a speedup, while other iterators are unaffected.
```
 name                           before ns/iter  after ns/iter  diff ns/iter   diff %  speedup
 iter::bench_chain_partial_cmp  208,301         54,978             -153,323  -73.61%   x 3.79
 iter::bench_partial_cmp        55,527          55,702                  175    0.32%   x 1.00
 iter::bench_lt                 55,502          55,322                 -180   -0.32%   x 1.00
```
2022-09-24 04:04:46 +00:00
Eric Huss
f5f69bc0bb Document some missing command-line arguments 2022-09-23 19:02:59 -07:00
bors
e1c28e0c85 Auto merge of #102068 - cjgillot:erased-lifetime-print, r=eholk
Always print '_, even for erased lifetimes.

Explicit lifetime arguments are now the recommended syntax in rust 2018 and rust 2021.  This PR applies this discipline to rustc itself.
2022-09-24 01:23:17 +00:00
Eric Huss
3d01d43d48 rustdoc: Stabilize --diagnostic-width 2022-09-23 18:04:15 -07:00
inquisitivecrystal
ad05b32fee Add regression test for issue #100878 2022-09-23 16:54:34 -07:00
Chris Wailes
7ad0ac75c9 Respond to document review feedback 2022-09-23 16:14:17 -07:00
Camille GILLOT
eb1ddd2573 Bless miri. 2022-09-24 00:10:28 +02:00
Michael Howell
ac06d9cca3 diagnostics: avoid syntactically invalid suggestion in if conditionals
Fixes #101065
2022-09-23 14:27:44 -07:00
León Orell Valerian Liehr
28e0c5aec8
Allow more !Copy impls 2022-09-23 21:51:40 +02:00
Nilstrieb
66484c0a21 Fix clippy's const fn stability check for CURRENT_RUSTC_VERSION
Since clippy can use a projects MSRV for its lints, it might not want
to consider functions as const stable if they have been added lately.

Functions that have been stabilized this version use
CURRENT_RUSTC_VERSION as their version, which gets then turned into the
current version, which might be something like `1.66.0-dev`. The version
parser cannot deal with this version, so it has to be stripped off.
2022-09-23 21:04:54 +02:00
Nilstrieb
aa35ab81ea Stabilize const BTree{Map,Set}::new
Since `len` and `is_empty` are not const stable yet, this also
creates a new feature for them since they previously used the same
`const_btree_new` feature.
2022-09-23 20:55:37 +02:00
onestacked
84666afb36 Constify Residual behind const_try 2022-09-23 20:17:31 +02:00
Deadbeef
a74eba4ad5 Make ManuallyDrop satisfy ~const Destruct 2022-09-23 18:07:36 +00:00
onestacked
d78bc41785 Remove unused ConstFn(Once)Closure structs. 2022-09-23 19:55:51 +02:00
Michael Howell
f570d310b7 rustdoc: remove no-op CSS rule #source-sidebar { z-index: 1 }
This rule became redundant in 07e3f998b1.
When `#source-sidebar` became nested below `.sidebar`, it went from being
`position: fixed` to `position: static`, and according to MDN's [z-index]
documentation, this means it has no effect.

[z-index]: https://developer.mozilla.org/en-US/docs/Web/CSS/z-index
2022-09-23 10:48:24 -07:00
Michael Howell
8b0feb8622 rustdoc: remove no-op mobile CSS #source-sidebar { z-index: 11 }
This rule became redundant in 07e3f998b1.
When `#source-sidebar` became nested below `.sidebar`, it went from being
`position: fixed` to `position: static`, and according to MDN's [z-index]
documentation, this means it has no effect.

[z-index]: https://developer.mozilla.org/en-US/docs/Web/CSS/z-index
2022-09-23 10:45:26 -07:00
bors
4a14677239 Auto merge of #102192 - matthiaskrgr:rollup-0ctjzco, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #102094 (Add missing documentation for `bool::from_str`)
 - #102115 (Add examples to `bool::then` and `bool::then_some`)
 - #102134 (Detect panic strategy using `rustc --print cfg`)
 - #102137 (Don't convert valtree to constvalue during normalization)
 - #102148 (add regression test for miri issue 2433)
 - #102158 (rustdoc: clean up CSS/DOM for deprecation warnings)
 - #102177 (Fix a typo in `std`'s root docs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-23 16:44:06 +00:00
Camille GILLOT
9b83e316c8 Bless clippy. 2022-09-23 18:42:14 +02:00
Camille GILLOT
8077d03b3f Bless 32bit ui. 2022-09-23 18:42:14 +02:00
Camille GILLOT
8de8115262 Bless pretty tests. 2022-09-23 18:42:14 +02:00
Camille GILLOT
f11499189e Bless cgu test. 2022-09-23 18:42:14 +02:00
Camille GILLOT
aac2c7ddd8 Always print '_, even for erased lifetimes. 2022-09-23 18:42:14 +02:00
onestacked
6267c60f6a Added some spacing in const closure 2022-09-23 18:20:57 +02:00
Michael Howell
cd481542df rustdoc: fix GUI tests to deal with slightly changed width 2022-09-23 09:18:07 -07:00
Guillaume Gomez
d30cb5b663 Improve GUI tests by using variables 2022-09-23 18:12:37 +02:00