235229 Commits

Author SHA1 Message Date
Boxy
b2bf4b66f8 make more pretty 2023-09-18 17:29:13 +01:00
Matthias Krüger
966f240de2
Rollup merge of #115932 - Mark-Simulacrum:expand-review, r=Kobzol
Expand infra-ci reviewer list

r? `@Kobzol`
2023-09-18 18:27:21 +02:00
Matthias Krüger
864f7aafe4
Rollup merge of #115891 - RalfJung:structural-trait-derive, r=nnethercote
simplify inject_impl_of_structural_trait

There's a comment at `inject_impl_of_structural_trait` saying we cannot use `TraitDef`, but that comment is outdated -- we *can* use `TraitDef` nowadays since it has the `skip_path_as_bound` flag. (The flag needed some fixing, though.)
2023-09-18 18:27:20 +02:00
Matthias Krüger
e27c3e97ca
Rollup merge of #115762 - oli-obk:early_const_prop_lint2, r=compiler-errors
Explain revealing of opaque types in layout_of ParamEnv

r? `@compiler-errors`

~~I feel like `layout_of` is doing too many things at once, and I don't really know why. It could allow us to if callers could decide whether to reveal opaque types.~~

Looks like this also exists as a performance optimization. While we could probably figure out a way to do this, all the ones I came up with are fragile as `layout_of` callers now suddenly need to be careful what ParamEnv they pass in.
2023-09-18 18:27:20 +02:00
Matthias Krüger
0d0f4fd8a3
Rollup merge of #115663 - Gumichocopengin8:ci/update-github-action, r=Mark-Simulacrum
ci: actions/checkout@v3 to actions/checkout@v4

- Bump `actions/checkout` from v3 to v4 since v3 uses Node v16 whose support lasts until `11 Sep 2023` [Ref](https://endoflife.date/nodejs)
  - https://github.com/actions/checkout/releases/tag/v4.0.0
2023-09-18 18:27:19 +02:00
Matthias Krüger
0a66c87bd4
Rollup merge of #115494 - RalfJung:primitive_docs, r=Mark-Simulacrum
get rid of duplicate primitive_docs

Having this duplicate makes editing that file very annoying. And at least locally the generated docs still look perfectly fine...
2023-09-18 18:27:19 +02:00
Matthias Krüger
db9e217989
Rollup merge of #109409 - WaffleLapkin:progamer, r=dtolnay
Add `minmax{,_by,_by_key}` functions to `core::cmp`

This PR adds the following functions:

```rust
// mod core::cmp
#![unstable(feature = "cmp_minmax")]

pub fn minmax<T>(v1: T, v2: T) -> [T; 2]
where
    T: Ord;

pub fn minmax_by<T, F>(v1: T, v2: T, compare: F) -> [T; 2]
where
    F: FnOnce(&T, &T) -> Ordering;

pub fn minmax_by_key<T, F, K>(v1: T, v2: T, mut f: F) -> [T; 2]
where
    F: FnMut(&T) -> K,
    K: Ord;
```
(they are also `const` under `#[feature(const_cmp)]`, I've omitted `const` stuff for simplicity/readability)

----

Semantically these functions are equivalent to `{ let mut arr = [v1, v2]; arr.sort(); arr }`, but since they operate on 2 elements only, they are implemented as a single comparison.

Even though that's basically a sort, I think "sort 2 elements" operation is useful on it's own in many cases. Namely, it's a common pattern when you have 2 things, and need to know which one is smaller/bigger to operate on them differently.

I've wanted such functions countless times, most recently in #109402, so I thought I'd propose them.

----

r? libs-api
2023-09-18 18:27:18 +02:00
Maybe Waffle
0c3e0abbf8 Fill-in tracking issue for feature(cmp_minmax) 2023-09-18 16:21:03 +00:00
bors
b1575cb72e Auto merge of #115927 - lnicola:sync-from-ra, r=lnicola
⬆️ `rust-analyzer`

r? `@ghost`
2023-09-18 16:16:30 +00:00
Maybe Waffle
fe87063a18 Add minmax* functions to core::cmp 2023-09-18 16:13:25 +00:00
Oli Scherer
ee59531dfc Explain with_reveal_all_normalized usage 2023-09-18 15:17:52 +00:00
Oli Scherer
1a01e57d27 Prototype using const generic for simd_shuffle IDX array 2023-09-18 15:10:28 +00:00
lcnr
e8b8ddd17e remove provisional cache 2023-09-18 17:01:29 +02:00
bors
cbcf9a5368 Auto merge of #115795 - Kobzol:opt-dist-custom, r=Mark-Simulacrum
Refactor `opt-dist` to simplify local building

This PR refactors the `opt-dist` tool to make it easier to invoke it locally, outside of CI, and thus simplify building PGO/BOLT optimized `rustc` builds e.g. for distro maintainers. It should also make it easier to run the PGO/BOLT workflow locally e.g. to profile performance or debug issues (looking at you, https://github.com/rust-lang/rust/pull/115554).
2023-09-18 14:26:40 +00:00
bors
4022591cfd Auto merge of #11517 - mojave2:issue-11426, r=Alexendoo
fix ICE by `u64::try_from(<u128>)`

changelog: Fix the ICE in [`cast_possible_truncation`], when the `Shr` bits is larger than `u64::MAX`

fix #11426
2023-09-18 14:21:48 +00:00
Mark Rousskov
d5643b1dec Expand infra-ci reviewer list 2023-09-18 10:13:49 -04:00
clubby789
9c5de75ce1 Migrate 'cast enum with drop to int' diagnostic 2023-09-18 14:07:05 +00:00
clubby789
80a9699117 Migrate 'trivial cast' lint 2023-09-18 14:07:05 +00:00
clubby789
82471e9f6c Migrate 'casting unknown pointer' diagnostic 2023-09-18 14:07:05 +00:00
clubby789
94920cc6e0 Migrate 'int to fat pointer' cast diagnostic 2023-09-18 14:07:03 +00:00
clubby789
c2841e2a1e Migrate 'cast to bool' diagnostic 2023-09-18 14:03:57 +00:00
clubby789
dcb3e70861 Migrate 'is_empty' diagnostics 2023-09-18 14:03:57 +00:00
clubby789
6496181208 Migrate 'lossy int2ptr cast' diagnostic 2023-09-18 14:03:57 +00:00
clubby789
bf693d1743 Migrate 'lossy ptr2int cast' diagnostic 2023-09-18 14:03:57 +00:00
Guillaume Gomez
354397f04d Move mobile topbar title creation entirely into JS 2023-09-18 15:52:21 +02:00
Guillaume Gomez
b8b420cc79 Improve code readability by moving the retrieval of closures inside async functions right besides other closures handling.
Add doc comment explaining what `MutablyUsedVariablesCtxt::prev_move_to_closure` is about.
2023-09-18 15:47:24 +02:00
danakj
b7e98e13cd Document that the macabi sanitizers are shared with darwin
Do not rename and resign the darwin sanitizers a second time for
macabi.
2023-09-18 09:38:12 -04:00
danakj
4eb1b52794 Enable ASAN/LSAN/TSAN for *-apple-ios-macabi
The -macabi targets are iOS running on MacOS, and they use the runtime
libraries for MacOS, thus they have the same sanitizers available as the
*-apple-darwin targets.
2023-09-18 09:38:12 -04:00
Zalathar
01b67f4b26 coverage: Simplify sorting of coverage spans extracted from MIR
Switching to `Ordering::then_with` makes control-flow less complicated, and
there is no need to use `partial_cmp` here.
2023-09-18 23:15:25 +10:00
bors
ea16f812be Auto merge of #11531 - Alexendoo:remark-deps, r=flip1995
Update remark CI deps

[Remark v15](https://github.com/remarkjs/remark/releases/tag/15.0.0) was just released that needs a newer node version, this updates us to 18 (the current LTS)

Also updates mdbook while we're at it

changelog: none
2023-09-18 13:12:18 +00:00
Alex Macleod
32519528df Update remark CI deps 2023-09-18 12:48:32 +00:00
Zalathar
a4cb31bb58 coverage: Regression test for inconsistent handling of closure spans 2023-09-18 22:33:05 +10:00
Alex Macleod
b06b915dc0 Move zero_ptr to the casts module 2023-09-18 12:15:51 +00:00
bors
de68911f4a Auto merge of #115929 - matthiaskrgr:rollup-hhasy22, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #115558 (issue has since been fixed)
 - #115724 (Add myself to the mailmap)
 - #115811 (Make AIX known by bootstrap)
 - #115838 (inspect: closer to proof trees for coherence)
 - #115902 (Fix up a few CI images)
 - #115907 (nop_lift macros: ensure that we are using the right interner)
 - #115908 (Do not clone MIR for const-prop lint.)
 - #115916 (Add me as on vacation)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-09-18 11:56:46 +00:00
Jakub Beránek
ee451f8fac
Fix build on Windows 2023-09-18 13:45:42 +02:00
Zalathar
4690f97099 coverage: Fix an unstable-sort inconsistency in coverage spans
This code was calling `sort_unstable_by`, but failed to impose a total order on
the initial spans. That resulted in unpredictable handling of closure spans,
producing inconsistencies in the coverage maps and in user-visible coverage
reports.

This patch fixes the problem by always sorting closure spans before
otherwise-identical non-closure spans, and also switches to a stable sort in
case the ordering is still not total.
2023-09-18 21:28:56 +10:00
Matthias Krüger
5290cc9f23
Rollup merge of #115916 - jackh726:vacation, r=jackh726
Add me as on vacation
2023-09-18 13:02:20 +02:00
Matthias Krüger
c101c5fa50
Rollup merge of #115908 - cjgillot:lint-noclone, r=oli-obk
Do not clone MIR for const-prop lint.

Addresses https://github.com/rust-lang/rust/pull/115797#issuecomment-1721250533
2023-09-18 13:02:20 +02:00
Matthias Krüger
0d29cdd187
Rollup merge of #115907 - RalfJung:interner-check, r=compiler-errors
nop_lift macros: ensure that we are using the right interner

Right now someone could put down the wrong list name when using these macros, and everything would still build. Nothing does a type-check to ensure that the `$set` contains element of type `Self::Lifted`. Let's fix that.

For lists this is fairly easy; for the other interners we need to unwrap some newtypes which makes this more complicated.
2023-09-18 13:02:19 +02:00
Matthias Krüger
497701876f
Rollup merge of #115902 - Mark-Simulacrum:bump-ci, r=albertlarsan68
Fix up a few CI images

This forward-ports changes made on the stable branch to fix CI (https://github.com/rust-lang/rust/pull/115787).
2023-09-18 13:02:19 +02:00
Matthias Krüger
944c4134d2
Rollup merge of #115838 - lcnr:added-goals, r=compiler-errors
inspect: closer to proof trees for coherence

a continuation of #115751. Now explicitly store the added goals

r? ```@compiler-errors```
2023-09-18 13:02:18 +02:00
Matthias Krüger
c843ac2ad9
Rollup merge of #115811 - bzEq:make-aix-known, r=Mark-Simulacrum
Make AIX known by bootstrap

Use `x.py` to build rustc on AIX directly is failing
```
unknown OS type: AIX
Build completed unsuccessfully in 0:00:00
```
If kernel is `AIX`, we should return default triple `powerpc64-ibm-aix` for current rustc.
2023-09-18 13:02:18 +02:00
Matthias Krüger
5a8e8e5577
Rollup merge of #115724 - tgross35:mailmap, r=Mark-Simulacrum
Add myself to the mailmap
2023-09-18 13:02:17 +02:00
Matthias Krüger
2e38432525
Rollup merge of #115558 - tshepang:patch-4, r=Mark-Simulacrum
issue has since been fixed
2023-09-18 13:02:17 +02:00
Laurențiu Nicola
b18db7a13e Merge commit '258b15c506a2d3ad862fd17ae24eaf272443f477' into sync-from-ra 2023-09-18 12:33:49 +03:00
bors
258b15c506 Auto merge of #15628 - lnicola:sync-from-rust, r=lnicola
minor: Sync from downstream
2023-09-18 09:05:50 +00:00
Laurențiu Nicola
d39b45a58d Merge branch 'master' into sync-from-rust 2023-09-18 12:04:59 +03:00
bors
c92de58692 Auto merge of #11523 - Alexendoo:used-underscore-bindings-lint-levels, r=xFrednet
used_underscore_bindings: respect lint levels on the binding definition

Fixes #11520
Fixes #947

Also ignores usages of `PhantomData`

changelog: none
2023-09-18 09:04:44 +00:00
bors
078eb1120a Auto merge of #115923 - weihanglo:update-cargo, r=weihanglo
Update cargo

6 commits in d5336f813df39d476e61fc46daabb1446350660a..b4ddf95ad9954118ac0dae835f2966394ad04c02
2023-09-14 19:55:49 +0000 to 2023-09-18 03:48:09 +0000
- doc: differentiate defaults for split-debuginfo (rust-lang/cargo#12680)
- feat(cli): Add '-n' to dry-run (rust-lang/cargo#12660)
- feat: stabilize credential-process and registry-auth (rust-lang/cargo#12649)
- refactor: use `RegistryOrIndex` enum to replace two booleans (rust-lang/cargo#12677)
- doc: clarify caret requirements (rust-lang/cargo#12679)
- feat(pkgid): Allow incomplete versions when unambigious (rust-lang/cargo#12614)

r? ghost
2023-09-18 07:07:28 +00:00
Ralf Jung
7b7caae30e get rid of duplicate primitive_docs 2023-09-18 08:17:36 +02:00