Commit Graph

206096 Commits

Author SHA1 Message Date
bors
8e9c93df46 Auto merge of #99609 - workingjubilee:lossy-unix-strerror, r=thomcc
Recover error strings on Unix from_lossy_utf8

Some language settings can result in unreliable UTF-8 being produced.
This can result in failing to emit the error string, panicking instead.
from_lossy_utf8 allows us to assume these strings usually will be fine.

This fixes rust-lang#99535.
2022-09-25 06:53:14 +00:00
bors
e20fabb0d0 Auto merge of #98457 - japaric:gh98378, r=m-ou-se
make Condvar, Mutex, RwLock const constructors work with the `unsupported` impl

applying this patch locally to the `rust-src` component fixes #98378

however, the solution seems wrong to me because PR #97791 didn't add any `rustc_const_stable` attribute to underlying implementations like `std::sys::unix::futex`, so I must be missing something about how const-stability is checked ... maybe the `restricted_std` feature (gate?) has an effect?

fixes #98378
fixes #98293 (probably)
2022-09-25 04:12:30 +00:00
bors
e58621a4a3 Auto merge of #102169 - scottmcm:constify-some-conditions, r=thomcc
Make ZST checks in core/alloc more readable

There's a bunch of these checks because of special handing for ZSTs in various unsafe implementations of stuff.

This lets them be `T::IS_ZST` instead of `mem::size_of::<T>() == 0` every time, making them both more readable and more terse.

*Not* proposed for stabilization.  Would be `pub(crate)` except `alloc` wants to use it too.

(And while it doesn't matter now, if we ever get something like #85836 making it a const can help codegen be simpler.)
2022-09-25 01:20:11 +00:00
bors
d0ece44cfa Auto merge of #102040 - TaKO8Ki:separate-definitions-and-hir-owners, r=cjgillot
Separate definitions and HIR owners in the type system

Fixes #83158

r? `@cjgillot`
2022-09-24 22:42:07 +00:00
bors
3f83906b30 Auto merge of #98483 - dvtkrlbs:bootstrap-dist, r=jyn514
Distribute bootstrap in CI

This pre-compiles bootstrap from source and adds it to the existing `rust-dev` component. There are two main goals here:
1. Make it faster to build rust from source, both the first time and incrementally
2. Make it easier to add non-python entrypoints, since they can call out to bootstrap directly rather than having to figure out the right flags to pre-compile it. This second part is still in a bit of flux, see the tracking issue below for more information.

There are also several changes to make bootstrap able to run on a machine other than the one it was built (particularly around `config.src` and `config.out` detection). I (`@jyn514)` am slightly concerned these will regress unless tested - maybe we should add an automated test that runs bootstrap in a chroot or something? Unclear whether the effort is worth the test coverage.

Helps with https://github.com/rust-lang/rust/issues/94829.
2022-09-24 20:00:51 +00:00
Scott McMurray
ed16dbf65e Add some more documentation 2022-09-24 12:12:41 -07:00
Joshua Nelson
2ef3d172c4 Copy bootstrap.exe on Windows, not bootstrap 2022-09-24 13:32:19 -05:00
bors
6580010551 Auto merge of #102234 - matthiaskrgr:rollup-5cb20l1, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #100823 (Refactor some `std` code that works with pointer offstes)
 - #102088 (Fix wrongly refactored Lift impl)
 - #102109 (resolve: Set effective visibilities for imports more precisely)
 - #102186 (Add const_closure, Constify Try trait)
 - #102203 (rustdoc: remove no-op CSS `#source-sidebar { z-index }`)
 - #102204 (Make `ManuallyDrop` satisfy `~const Destruct`)
 - #102210 (diagnostics: avoid syntactically invalid suggestion in if conditionals)
 - #102226 (bootstrap/miri: switch to non-deprecated env var for setting the sysroot folder)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-24 14:37:01 +00:00
Takayuki Maeda
8fe936099a separate definitions and HIR owners
fix a ui test

use `into`

fix clippy ui test

fix a run-make-fulldeps test

implement `IntoQueryParam<DefId>` for `OwnerId`

use `OwnerId` for more queries

change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-24 23:21:19 +09:00
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
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
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
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