Commit graph

206225 commits

Author SHA1 Message Date
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
1b1bf24636.
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
Oli Scherer 59e285ff34 Report diagnostics at the actually actionable site 2022-09-23 08:00:02 +00:00
Florian Bartels 0be3cc8234 ignore test cases when checking emscripten 2022-09-23 09:41:12 +02:00
Oli Scherer e237aaef25 Some test cleanups 2022-09-23 07:18:33 +00:00
Oli Scherer e9d219e97c Make the test actually show the problematic case 2022-09-23 07:15:55 +00:00
Oli Scherer 90ec6f847f Show errors instead of hiding them due to an earlier error 2022-09-23 07:12:59 +00:00
Oli Scherer 5ace12c409 Showcase a broken diagnostic 2022-09-23 07:10:11 +00:00
bors bc4d574ff2 Auto merge of #102150 - matthiaskrgr:rollup-6xmd8f3, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #102113 (OpTy: fix a method taking self rather than &self)
 - #102118 (rustdoc: clean up line numbers on code examples)
 - #102123 (Add note to clippy::non_expressive_names doc)
 - #102125 (rustdoc: remove no-op CSS `.content .item-info { position: relative }`)
 - #102127 (Use appropriate variable names)
 - #102128 (Const unification is already infallible, remove the error handling logic)
 - #102133 (Use valtrees for comparison)
 - #102135 (Improve some AllTypes fields name)
 - #102144 (Extend const_convert with const {FormResidual, Try} for ControlFlow.)
 - #102147 (rustdoc: remove no-op CSS `.location:empty { border: none }`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-23 06:52:39 +00:00
Florian Bartels 10f3657936 Adapt test results 2022-09-23 08:19:58 +02:00
Florian Bartels 0b0027fd2e Restore ignore tag
This test case actually requires std::process.
2022-09-23 08:19:58 +02:00
Florian Bartels 7bfbaa3881 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.
2022-09-23 08:19:58 +02:00
Scott McMurray cbbcd9f52c rustfmt 2022-09-22 23:13:12 -07:00
Scott McMurray 44b4ce1d61 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 at this time.  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-22 23:12:29 -07:00
Thom Chiovoloni 29efe8c789
Add #[inline] to trivial functions on core::sync::Exclusive 2022-09-22 22:15:27 -07:00
bors 77e7e88567 Auto merge of #100488 - khyperia:invalid-calling-convention-help-message, r=nagisa,jyn514
Improve the help message for an invalid calling convention

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

I mostly followed the suggestions of `@nagisa` in that issue, ~~however, I wasn't sure how to check stability for the suggestion of "Do not suggest CCs that cannot be used due to them being unstable and feature not being enabled", so I did not implement that point.~~

I haven't contributed to rustc much, please feel free to point out suggestions! For example, the `.map(|s| Symbol::intern(s)).collect::<Vec<_>>()` seems pretty gross performance-wise, but maybe that's OK in error reporting code.
2022-09-23 04:22:14 +00:00
Matthias Krüger 8e3b9bca65
Rollup merge of #102112 - cuviper:powerpc64-full-relro, r=eholk
Allow full relro on powerpc64-unknown-linux-gnu

This was previously limited to partial relro, citing issues on RHEL6,
but that's no longer a supported platform since #95026. We have long
been enabling full relro in RHEL7's own Rust builds for ppc64, without
trouble, so it should be fine to drop this workaround.
2022-09-23 04:29:20 +02:00
Matthias Krüger 3148b3dc16
Rollup merge of #102104 - Aaron1011:no-test-backtrace, r=Mark-Simulacrum
Set 'exec-env:RUST_BACKTRACE=0' in const-eval-select tests

This allows the tests to pass even if the user has RUST_BACKTRACE set when running 'x.py'
2022-09-23 04:29:19 +02:00
Matthias Krüger dac0f6e821
Rollup merge of #102095 - oli-obk:simplify, r=TaKO8Ki
Deduplicate two functions that would soon have been three

https://github.com/rust-lang/rust/pull/101900 would have added another copy of this for effects
2022-09-23 04:29:19 +02:00
Matthias Krüger f4c492cb5d
Rollup merge of #102066 - notriddle:notriddle/headers-max-width, r=GuillaumeGomez
rustdoc: remove unnecessary `max-width` on headers

This code was added in 003b2bc1c6 to prevent these headers from overlapping `.out-of-band` side items. That stopped being a problem when 3f92ff34b5 switched rustdoc over to using `float`, rather than `position: absolute`, to implement this.
2022-09-23 04:29:18 +02:00
Matthias Krüger adde928305
Rollup merge of #102042 - LukeMathWalker:add-rust-json-docs-to-rustup, r=Mark-Simulacrum
Distribute rust-docs-json via rustup.

I am not 100% sure on how to treat `rust-json-docs` in `target_host_combination`. I went along with a similar strategy to the one used for `rust-docs`, but looking for guidance there.
2022-09-23 04:29:17 +02:00
Matthias Krüger 695b708311
Rollup merge of #101815 - diegooliveira:master, r=davidtwco
Migrated the rustc_passes annotation without effect diagnostic infrastructure

Small change to move the validation for annotations to the new diagnostic infrastructure.
2022-09-23 04:29:16 +02:00
Matthias Krüger c2d2535b84
Rollup merge of #101664 - mejrs:similarity, r=fee1-dead
Note if mismatched types have a similar name

If users get a type error between similarly named types, it will point out that these are actually different types, and where they were defined.
2022-09-23 04:29:16 +02:00
Matthias Krüger 5d7937de8c
Rollup merge of #100734 - ComputerDruid:afit_feature, r=compiler-errors
Split out async_fn_in_trait into a separate feature

PR #101224 added support for async fn in trait desuraging behind the `return_position_impl_trait_in_trait` feature.

Split this out so that it's behind its own feature gate, since async fn in trait doesn't need to follow the same stabilization schedule.
2022-09-23 04:29:15 +02:00
bors 9279c547c7 Auto merge of #101708 - compiler-errors:issue-101696, r=jackh726
Normalize closure signature after construction

Astconv can't normalize inputs or outputs with escaping bound vars ([see this](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_typeck/check/fn_ctxt/mod.rs.html#294)), so normalize them after we've wrapped them in a binder.

Fixes #101696
2022-09-23 01:21:25 +00:00
Michael Howell 51f335deca rustdoc: fix unit tests 2022-09-22 16:29:51 -07:00
Michael Howell dedf6fcde4 rustdoc: clean up CSS/DOM for deprecation warnings 2022-09-22 14:54:38 -07:00
khyperia 9a206a78eb Improve the help message for an invalid calling convention 2022-09-22 22:18:30 +02:00
Michael Goulet 79c665b2a3 Calculate ProjectionTy::trait_def_id correctly 2022-09-22 19:49:18 +00:00
Matthias Krüger dfeff64550
Rollup merge of #102147 - notriddle:notriddle/location-border-none, r=GuillaumeGomez
rustdoc: remove no-op CSS `.location:empty { border: none }`

This rule was added in 2bb2a2975f to remove a border placed around the location when it's empty. That rule was removed in 6a5f8b1aef, so this rule does nothing.
2022-09-22 21:34:56 +02:00
Matthias Krüger 23370637ef
Rollup merge of #102144 - chriss0612:const_convert_control_flow, r=scottmcm
Extend const_convert with const {FormResidual, Try} for ControlFlow.

Very small change so I just used the existing `const_convert` feature flag.  #88674
Newly const API:
```
impl<B, C> const ops::Try for ControlFlow<B, C>;
impl<B, C> const ops::FromResidual for ControlFlow<B, C>;
```

`@usbalbin` I hope it is ok that I added to your feature.
2022-09-22 21:34:55 +02:00
Matthias Krüger a99e675a98
Rollup merge of #102135 - GuillaumeGomez:rename-alltypes-fields, r=notriddle
Improve some AllTypes fields name

r? `@notriddle`
2022-09-22 21:34:55 +02:00
Matthias Krüger aa384834d7
Rollup merge of #102133 - b-naber:use-valtrees-in-fast-reject, r=lcnr
Use valtrees for comparison

r? `@lcnr`
2022-09-22 21:34:54 +02:00
Matthias Krüger b93c9a7d37
Rollup merge of #102128 - oli-obk:const_unification, r=lcnr
Const unification is already infallible, remove the error handling logic

r? `@lcnr`

is this expected to be used in the future? Right now it is dead code.
2022-09-22 21:34:53 +02:00
Matthias Krüger c5d223033b
Rollup merge of #102127 - TaKO8Ki:use-appropriate-variable-names, r=lcnr
Use appropriate variable names
2022-09-22 21:34:52 +02:00
Matthias Krüger dee0c422e7
Rollup merge of #102125 - notriddle:notriddle/content-item-info, r=GuillaumeGomez
rustdoc: remove no-op CSS `.content .item-info { position: relative }`

This rule was added to help position the marker line in 110e7270ab, which was a `position: absolute` pseudo-element that relied on its parent to put it in the right spot. (it was changed from a line to an arrow in 1ffb9cf8d7, then a different arrow in ae3a53ff58).

The arrow was removed in 73d0f7c7b6, so the `relative` position is no longer necessary.
2022-09-22 21:34:52 +02:00
Matthias Krüger 86acea401a
Rollup merge of #102123 - schteve:clippy-note, r=Manishearth
Add note to clippy::non_expressive_names doc

Addresses confusion in rust-lang/rust-clippy#9514 by updating the lint docs.
2022-09-22 21:34:51 +02:00
Matthias Krüger ecbc00fa9e
Rollup merge of #102118 - notriddle:notriddle/line-numbers, r=GuillaumeGomez
rustdoc: clean up line numbers on code examples

* First commit switches from `display: inline-flex; width: 100%` to `display: flex`.

  `display: inline-flex` was used as part of e961d397ca, the original commit that added these line numbers. Does anyone know why it was done this way?

* Second commit makes it so that toggling this checkbox will update the page in real time, just like changing themes does.

Preview: https://notriddle.com/notriddle-rustdoc-test/line-numbers/std/vec/struct.Vec.html
2022-09-22 21:34:50 +02:00
Matthias Krüger 41ad726110
Rollup merge of #102113 - RalfJung:opty-assert-mem, r=oli-obk
OpTy: fix a method taking self rather than &self

r? `@oli-obk`
2022-09-22 21:34:49 +02:00
Ralf Jung a7cdfafafb make Miri build in stage 0 2022-09-22 21:01:23 +02:00
Ralf Jung 7927f0919f add regression test for miri issue 2433 2022-09-22 21:01:13 +02:00