Commit Graph

218538 Commits

Author SHA1 Message Date
est31
5a02105fff Rustdoc-ify LiteralKind note 2023-03-03 08:39:36 +01:00
est31
ef658907a5 Match end user facing unmatched backticks in compiler/ 2023-03-03 08:39:36 +01:00
bors
13471d3b20 Auto merge of #108654 - LeSeulArtichaut:revert-99767, r=compiler-errors
Revert stabilization of `#![feature(target_feature_11)]`

This reverts #99767 due to the presence of bugs #108645 and #108646.

cc `@joshtriplett`
cc tracking issue #69098
r? `@ghost`
2023-03-02 17:38:31 +00:00
bors
7e966bcd03 Auto merge of #108640 - matthiaskrgr:rollup-rii4t5t, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #108516 (Restrict `#[rustc_box]` to `Box::new` calls)
 - #108575 (Erase **all** regions when probing for associated types on ambiguity in astconv)
 - #108585 (Run compiler test suite in parallel on Fuchsia)
 - #108606 (Add test case for mismatched open/close delims)
 - #108609 (Highlight whole expression for E0599)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-02 14:04:22 +00:00
Léo Lanteri Thauvin
bfe5189904 Revert "Stabilize #![feature(target_feature_11)]"
This reverts commit b379d216ee.
2023-03-02 13:41:17 +01:00
Matthias Krüger
832987bb1e
Rollup merge of #108609 - clubby789:e0599-highlight, r=estebank
Highlight whole expression for E0599

Fixes #108603

This adds a secondary label to highlight the whole expression leading to the error. It also prevents empty labels being recognised as 'unexpected' by compiletest - otherwise, tests with NOTE annotations would pick up empty labels.

`@rustbot` label +A-diagnostics
2023-03-02 07:24:02 +01:00
Matthias Krüger
c09a9a69e2
Rollup merge of #108606 - chenyukang:yukang/fix-104367, r=compiler-errors
Add test case for mismatched open/close delims

Fixes #104367
Fixes #105209

After landing https://github.com/rust-lang/rust/pull/108297, these issues are resolved.
2023-03-02 07:24:02 +01:00
Matthias Krüger
478d530af4
Rollup merge of #108585 - djkoloski:parallel_fuchsia_test_runner, r=tmandry
Run compiler test suite in parallel on Fuchsia

This also adds file locking around calls to `pm publish` as these calls are not thread-safe.
2023-03-02 07:24:01 +01:00
Matthias Krüger
91dafebc91
Rollup merge of #108575 - compiler-errors:erase, r=estebank
Erase **all** regions when probing for associated types on ambiguity in astconv

Fixes #108562
2023-03-02 07:24:01 +01:00
Matthias Krüger
c9c9283c6a
Rollup merge of #108516 - clubby789:rustc-box-restrict, r=compiler-errors
Restrict `#[rustc_box]` to `Box::new` calls

Currently, `#[rustc_box]` can be applied to any call expression with a single argument. This PR only allows it to be applied to calls to `Box::new`
2023-03-02 07:24:00 +01:00
bors
18caf88956 Auto merge of #107879 - icedrocket:update-llvm, r=cuviper
Update LLVM submodule

Fixes #105626
2023-03-02 05:27:32 +00:00
clubby789
d845769557 Restrict #[rustc_box] to Box::new calls 2023-03-02 02:42:19 +00:00
bors
864b6258fc Auto merge of #106673 - flba-eb:add_qnx_nto_stdlib, r=workingjubilee
Add support for QNX Neutrino to standard library

This change:

- adds standard library support for QNX Neutrino (7.1).
- upgrades `libc` to version `0.2.139` which supports QNX Neutrino

`@gh-tr`

⚠️ Backtraces on QNX require https://github.com/rust-lang/backtrace-rs/pull/507 which is not yet merged! (But everything else works without these changes) ⚠️

Tested mainly with a x86_64 virtual machine (see qnx-nto.md) and partially with an aarch64 hardware (some tests fail due to constrained resources).
2023-03-02 02:41:42 +00:00
bors
0b4ba4cf0e Auto merge of #108483 - scottmcm:unify-bytewise-eq-traits, r=the8472
Merge two different equality specialization traits in `core`

Arrays and slices each had their own version of this, without a matching set of `impl`s.

Merge them into one (still-`pub(crate)`) `cmp::BytewiseEq` trait, so we can stop doing all these things twice.

And that means that the `[T]::eq` → `memcmp` specialization picks up a bunch of types where that previously only worked for arrays, so examples like <https://rust.godbolt.org/z/KjsG8MGGT> will use it now instead of emitting loops.

r? the8472
2023-03-01 23:34:37 +00:00
Scott McMurray
44eec1d9b0 Merge two different equality specialization traits in core 2023-03-01 14:42:06 -08:00
David Koloski
c9f1a541b3 Run compiler test suite in parallel on Fuchsia 2023-03-01 15:35:00 -05:00
bors
f77bfb7336 Auto merge of #108620 - Dylan-DPC:rollup-o5c4evy, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #108143 (rustdoc: search by macro when query ends with `!`)
 - #108394 (Make `x doc --open` work on every book)
 - #108427 (Recover from for-else and while-else)
 - #108462 (Fix `VecDeque::append` capacity overflow for ZSTs)
 - #108568 (Make associated_item_def_ids for traits use an unstable option to also return associated types for RPITITs)
 - #108604 (Add regression test for #107280)
 - #108605 (Add regression test for #105821)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-01 18:51:29 +00:00
Dylan DPC
02e4eefd88
Rollup merge of #108605 - JohnTitor:issue-105821, r=compiler-errors
Add regression test for #105821

Closes #105821
r? compiler-errors
2023-03-01 23:40:22 +05:30
Dylan DPC
0ed76b473f
Rollup merge of #108604 - JohnTitor:issue-107280, r=compiler-errors
Add regression test for #107280

Closes #107280
r? compiler-errors
2023-03-01 23:40:21 +05:30
Dylan DPC
9d132f77ae
Rollup merge of #108568 - spastorino:new-rpitit-flag, r=compiler-errors
Make associated_item_def_ids for traits use an unstable option to also return associated types for RPITITs

r? `@compiler-errors`
2023-03-01 23:40:21 +05:30
Dylan DPC
093a53f134
Rollup merge of #108462 - pommicket:fix-vecdeque-zst-overflow, r=Amanieu
Fix `VecDeque::append` capacity overflow for ZSTs

Fixes #108454.
2023-03-01 23:40:20 +05:30
Dylan DPC
27fa7b5e6d
Rollup merge of #108427 - y21:for-else-diagnostic, r=compiler-errors
Recover from for-else and while-else

This recovers from attempts at writing for-else or while-else loops, which might help users coming from e.g. Python.
```rs
for _ in 0..0 {
  // ...
} else {
  // ...
}
```
Combined with trying to store it in a let binding, the current diagnostic can be a bit confusing. It mentions let-else and suggests wrapping the loop in parentheses, which the user probably doesn't want. let-else doesn't make sense for `for` and `while` loops, as they are of type `()` (which already is an irrefutable pattern and doesn't need let-else).
<details>
<summary>Current diagnostic</summary>

```rs
error: right curly brace `}` before `else` in a `let...else` statement not allowed
 --> src/main.rs:4:5
  |
4 |     } else {
  |     ^
  |
help: wrap the expression in parentheses
  |
2 ~     let _x = (for _ in 0..0 {
3 |
4 ~     }) else {
  |
```
</details>

Some questions:
- Can the wording for the error message be improved? Would "for...else loops are not allowed" fit better?
- Should we be more "conservative" in case we want to support this in the future (i.e. say "for...else loops are **currently** not allowed/supported")?
- Is there a better way than storing a `&'static str` for the loop type? It is used for substituting the placeholder in the locale file (since it can emit either `for...else` or `while...else`). Maybe there is an enum I could use that I couldn't find
2023-03-01 23:40:19 +05:30
Dylan DPC
38461f8b8a
Rollup merge of #108394 - ferrocene:pa-open, r=ozkanonur
Make `x doc --open` work on every book

Before this PR, the `--open` flag had to be configured explicitly for every book, and most of them didn't configure it, resulting in the flag silently failing in all but two books.

In this PR, the code to check for the `--open` flag is in the underlying `RustbookSrc` step rather than all the individual steps. This is done by passing the parent step as a field of `RustbookSrc`, so that we can check for the correct step in `maybe_open_in_browser`.

This was part of a larger change that in the end wasn't worth it. Still, I think it could be useful as-is.
2023-03-01 23:40:19 +05:30
Dylan DPC
f03e5345aa
Rollup merge of #108143 - notriddle:notriddle/filter-exclamation-macro, r=GuillaumeGomez
rustdoc: search by macro when query ends with `!`

Related to #96399

Note: the `never` type alias is tested in [`/tests/rustdoc-js-std/alias-3.js`](08ad401633/tests/rustdoc-js-std/alias-3.js)

## Before

![image](https://user-images.githubusercontent.com/1593513/219504192-54cc0753-ff97-4a37-ad4a-8ae915181325.png)

## After

![image](https://user-images.githubusercontent.com/1593513/219504251-589a7e11-1e7b-4b7b-879d-1b564080017c.png)
2023-03-01 23:40:18 +05:30
Santiago Pastorino
73e2fe0494
Properly implement should_encode_fn_impl_trait_in_trait using new unstable option 2023-03-01 14:13:41 -03:00
clubby789
6c2a952b56 Highlight whole expression for E0599 2023-03-01 16:57:11 +00:00
Santiago Pastorino
811a1cabda
Make associated_item_def_ids for traits use an unstable option to also return associated types for RPITITs 2023-03-01 12:56:39 -03:00
Santiago Pastorino
be72beca68
Fix typo in docs 2023-03-01 12:56:39 -03:00
Santiago Pastorino
e74f50ecc2
Add unstable option new_rpitit to be used for new RPITIT lowering system 2023-03-01 12:56:39 -03:00
Santiago Pastorino
5295de1694
Add opt_rpitit_info query 2023-03-01 12:56:38 -03:00
bors
609496eecf Auto merge of #108446 - Zoxc:named-allocs, r=oli-obk
Name LLVM anonymous constants by a hash of their contents

This makes the names stable between different versions of a crate unlike the `AllocId` naming, making LLVM IR comparisons with `llvm-diff` more practical.
2023-03-01 15:36:15 +00:00
yukang
a641229916 Add testcase for issue 105209 2023-03-01 13:28:12 +00:00
yukang
94a200b6a9 Fix #104367, add test case for mismatched open/close delims 2023-03-01 13:14:30 +00:00
Yuki Okushi
50d35c1740
Add regression test for #105821
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-03-01 22:01:12 +09:00
Yuki Okushi
964234654d
Add regression test for #107280
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-03-01 21:58:27 +09:00
bors
5423745db8 Auto merge of #105871 - llogiq:option-as-slice, r=scottmcm
Add `Option::as_`(`mut_`)`slice`

This adds the following functions:

* `Option<T>::as_slice(&self) -> &[T]`
* `Option<T>::as_mut_slice(&mut self) -> &[T]`

The `as_slice` and `as_mut_slice_mut` functions benefit from an optimization that makes them completely branch-free. ~~Unfortunately, this optimization is not available on by-value Options, therefore the `into_slice` implementations use the plain `match` + `slice::from_ref` approach.~~

Note that the optimization's soundness hinges on the fact that either the niche optimization makes the offset of the `Some(_)` contents zero or the mempory layout of `Option<T>` is equal to that of `Option<MaybeUninit<T>>`.

The idea has been discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Option.3A.3Aas_slice). Notably the idea for the `as_slice_mut` and `into_slice´ methods came from `@cuviper` and `@Sp00ph` hardened the optimization against niche-optimized Options.

The [rust playground](https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=74f8e4239a19f454c183aaf7b4a969e0) shows that the generated assembly of the optimized method is basically only a copy while the naive method generates code containing a `test dx, dx` on x86_64.

---

EDIT from reviewer: ACP is https://github.com/rust-lang/libs-team/issues/150
2023-03-01 12:32:57 +00:00
y21
0758c05c97 recover from for-else and while-else 2023-03-01 13:26:59 +01:00
bors
64165aac68 Auto merge of #108476 - saethlin:remove-library-rustc-box, r=thomcc
Remove or document uses of #[rustc_box] in library

r? `@thomcc`

Only one of these uses is tested for in the rustc-perf benchmark suite. The impact there on compile time is somewhat dramatic, but I am inclined to make this change as a simplification to the library and wait for people to complain if it explodes their compilation time. I think in the absence of data or reports from users about what code paths really matter, if we are optimizing for compilation time, it's hard to argue against using `#[rustc_box]` everywhere we currently call `Box::new`.
2023-03-01 09:13:23 +00:00
bors
bcb610da7f Auto merge of #108587 - matthiaskrgr:rollup-rw6po59, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #108376 (compiler/rustc_session: fix sysroot detection logic)
 - #108400 (add llvm cgu instructions stats to perf)
 - #108496 (fix #108495, postfix decrement and prefix decrement has no warning)
 - #108505 (Further unify validity intrinsics)
 - #108520 (Small cleanup to `one_bound_for_assoc_type`)
 - #108560 (Some `infer/mod.rs` cleanups)
 - #108563 (Make mailmap more correct)
 - #108564 (Fix `x clean` with specific paths)
 - #108571 (Add contains_key to SortedIndexMultiMap)
 - #108578 (Update Fuchsia platform team members)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-01 06:23:19 +00:00
Florian Bartels
a510715749
Update library/std/src/os/nto/mod.rs
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
2023-03-01 06:42:40 +01:00
bors
5983a3a99e Auto merge of #108586 - matthiaskrgr:rollup-ry9u2ou, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #108297 (Exit when there are unmatched delims to avoid noisy diagnostics)
 - #108531 (rustdoc: Show that repeated expression arrays can be made with constant values)
 - #108536 (Update books)
 - #108550 (Remove the `capture_disjoint_fields` feature)
 - #108551 (Descriptive error when users try to combine RPITIT/AFIT with specialization)
 - #108554 (Only look for param in item's generics if it actually comes from generics)
 - #108555 (Fix a race in the query system)
 - #108558 (add missing feature in core/tests)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-01 03:11:44 +00:00
Matthias Krüger
cd5352dbce
Rollup merge of #108578 - djkoloski:update_fuchsia_team, r=tmandry
Update Fuchsia platform team members

r? `@tmandry`
2023-03-01 01:22:00 +01:00
Matthias Krüger
168589426c
Rollup merge of #108571 - Jesse-Bakker:sorted_index_multi_map_contains_key, r=Nilstrieb
Add contains_key to SortedIndexMultiMap
2023-03-01 01:21:59 +01:00
Matthias Krüger
41eb28dc18
Rollup merge of #108564 - clubby789:patch-1, r=jyn514
Fix `x clean` with specific paths

Fixes #108517

`cargo clean` takes package names to clean with `-p`, rather than as free args
2023-03-01 01:21:59 +01:00
Matthias Krüger
ed5d00beb1
Rollup merge of #108563 - albertlarsan68:patch-1, r=compiler-errors
Make mailmap more correct
2023-03-01 01:21:58 +01:00
Matthias Krüger
3ff3011afb
Rollup merge of #108560 - Nilstrieb:infer-cleanup, r=compiler-errors
Some `infer/mod.rs` cleanups
2023-03-01 01:21:58 +01:00
Matthias Krüger
35ef8ea5e1
Rollup merge of #108520 - compiler-errors:one-bound-nit, r=jackh726
Small cleanup to `one_bound_for_assoc_type`

Use fewer closures :)
2023-03-01 01:21:57 +01:00
Matthias Krüger
5af16c1655
Rollup merge of #108505 - Nilstrieb:further-unify-validity-intrinsics, r=michaelwoerister
Further unify validity intrinsics

Also merges the inhabitedness check into the query to further unify the
code paths.

Depends on #108364
2023-03-01 01:21:57 +01:00
Matthias Krüger
1c3cc8bba5
Rollup merge of #108496 - nx2k3:issue-108495-dec, r=WaffleLapkin
fix #108495, postfix decrement and prefix decrement has no warning

Fixes #108495
2023-03-01 01:21:56 +01:00
Matthias Krüger
32d7024100
Rollup merge of #108400 - csmoe:cgu-instr-perf, r=bjorn3
add llvm cgu instructions stats to perf

r? ```@bjorn3```
2023-03-01 01:21:56 +01:00