206378 Commits

Author SHA1 Message Date
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 07e3f998b1ceb4b8d2a7992782e60f5e776aa114.
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 07e3f998b1ceb4b8d2a7992782e60f5e776aa114.
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
Guillaume Gomez
a4046e93e2 Update browser-ui-test version to 0.11.0 2022-09-23 18:12:23 +02:00
onestacked
449326aaad Added const Default impls for Arrays and Tuples. 2022-09-23 17:53:59 +02:00
Michael Howell
e3cb0a84c2 rustdoc: add regression test for sidebar width jank 2022-09-23 08:35:14 -07:00
Michael Howell
ee8e0bda34 rustdoc: CSS prevent sidebar width change jank
This commit makes the `width` and `min-width` of the sidebar the same. They
originally were when cad0fce2053d52b7ba04c458f4c124c8b5c6141e added the
`min-width` rule, but 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c changed the
width without changing the `min-width`, causing it to sometimes oscilate
between 200 and 250 pixels depending on the main content.
2022-09-23 08:35:14 -07:00
Matthias Krüger
dfe045ad71
Rollup merge of #102177 - inquisitivecrystal:std-doc-typo, r=Dylan-DPC
Fix a typo in `std`'s root docs

Remarkably, this typo has been present for *seven years.* I was so surprised that I reread the text five times and then asked people on the rust Zulip to double-check. :)
2022-09-23 15:40:23 +02:00
Matthias Krüger
6d6d89b08b
Rollup merge of #102158 - notriddle:notriddle/stab-p, r=GuillaumeGomez
rustdoc: clean up CSS/DOM for deprecation warnings

Preview: https://notriddle.com/notriddle-rustdoc-test/stab-p/std/macro.try.html
2022-09-23 15:40:23 +02:00
Matthias Krüger
0d0186939b
Rollup merge of #102148 - RalfJung:miri-test, r=oli-obk
add regression test for miri issue 2433

Adding this here because the test needs to be run with debug assertions enabled to be sure so I had to run it in the rustc workspace.

Cc https://github.com/rust-lang/miri/issues/2433
r? ``@oli-obk``
2022-09-23 15:40:22 +02:00
Matthias Krüger
3a8bad98d7
Rollup merge of #102137 - b-naber:lazy-const-val-conversion, r=lcnr
Don't convert valtree to constvalue during normalization

r? ``@lcnr``
2022-09-23 15:40:22 +02:00
Matthias Krüger
3de0d678f8
Rollup merge of #102134 - flba-eb:master, r=bjorn3
Detect panic strategy using `rustc --print cfg`

Instead of relying on a command line parameter, detect if a target is able to unwind or not.
Ignore tests that require unwinding on targets that don't support it.

I did not find any place where the removed parameter has been used, but it feels a bit risky as
I'm new to this test framework.

r? bjorn3
2022-09-23 15:40:21 +02:00
Matthias Krüger
6b001f3d68
Rollup merge of #102115 - Alfriadox:master, r=thomcc
Add examples to `bool::then` and `bool::then_some`

Added examples to `bool::then` and `bool::then_some` to show the distinction between the eager evaluation of `bool::then_some` and the lazy evaluation of `bool::then`.
2022-09-23 15:40:20 +02:00
Matthias Krüger
986fc4b5d2
Rollup merge of #102094 - GuillaumeGomez:bool-from-str-missing-docs, r=scottmcm
Add missing documentation for `bool::from_str`

Fixes #101870.
2022-09-23 15:40:20 +02:00
onestacked
53049f7dcd Fixed Doc-Tests 2022-09-23 15:39:13 +02:00
bors
9a963e3bad Auto merge of #102056 - b-naber:unevaluated, r=lcnr
Introduce mir::Unevaluated

Previously the distinction between unevaluated constants in the type-system and in mir was not explicit and a little confusing. Probably better to introduce its own type for that.

r? `@lcnr`
2022-09-23 13:39:11 +00:00
b-naber
a705e65605 rename Unevaluated to UnevaluatedConst 2022-09-23 14:27:34 +02:00
b-naber
ded3edac9a fix test 2022-09-23 14:25:30 +02:00
Florian Bartels
8eeeac69db Update doc after renaming fn is_zero
`fn is_zero` has been renamed to `fn count_is_zero` in
1b1bf2463619e23eba1b36b6d7df276ce73563dd.
This patch updates the documentation accordingly.
2022-09-23 14:16:35 +02:00
onestacked
8e0ea60a04 Constifed Try trait 2022-09-23 13:43:34 +02:00
onestacked
0b2f717dfa Added const_closure 2022-09-23 13:42:31 +02:00
bors
4d44e09cb1 Auto merge of #102165 - matthiaskrgr:rollup-n5oquhe, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #100734 (Split out async_fn_in_trait into a separate feature)
 - #101664 (Note if mismatched types have a similar name)
 - #101815 (Migrated the rustc_passes annotation without effect diagnostic infrastructure)
 - #102042 (Distribute rust-docs-json via rustup.)
 - #102066 (rustdoc: remove unnecessary `max-width` on headers)
 - #102095 (Deduplicate two functions that would soon have been three)
 - #102104 (Set 'exec-env:RUST_BACKTRACE=0' in const-eval-select tests)
 - #102112 (Allow full relro on powerpc64-unknown-linux-gnu)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-23 09:33:23 +00:00
Ralf Jung
c8d346e527 bootstrap: the backtrace feature is stable, no need to allow it any more 2022-09-23 11:07:16 +02:00
inquisitivecrystal
a0eb46788a Fix a typo in std's root docs 2022-09-23 01:45:43 -07:00
Miguel Ojeda
cb8a9c496f 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-23 10:19:59 +02:00
Florian Bartels
ccd19c7e9e Repair stderr test result to added line 2022-09-23 10:10:07 +02:00
Oli Scherer
7ed999b616 Also require other subtrees to always build successfully 2022-09-23 08:03:10 +00:00