Commit Graph

227800 Commits

Author SHA1 Message Date
Matthias Krüger
9f2c21c11f
Rollup merge of #112518 - chenyukang:yukang-fix-112458, r=davidtwco
Detect actual span for getting unexpected token from parsing macros

Fixes #112458
2023-06-27 17:48:44 +02:00
bors
f42f19b6d3 Auto merge of #113078 - saethlin:mention-the-function, r=RalfJung
Mention the panic function in CheckAlignment

Per https://github.com/rust-lang/rust/pull/112599#discussion_r1242333935
r? `@RalfJung`
2023-06-27 09:43:37 +00:00
bors
95978b302c Auto merge of #113083 - matthiaskrgr:rollup-anbqpij, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #113039 (make custom mir ICE a bit nicer)
 - #113058 (Add/improve code comments)
 - #113063 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-27 06:04:37 +00:00
Matthias Krüger
c396abe1bf
Rollup merge of #113063 - ehuss:update-books, r=ehuss
Update books

## nomicon

2 commits in b5f018fb5930cb733b0a8aaf2eed975d4771e74d..c369e4b489332f8721fbae630354fa83385d457d
2023-05-19 11:10:25 -0700 to 2023-06-04 23:21:07 +0900
- phantom-data: Add `Send` and `Sync` columns (rust-lang/nomicon#411)
- Rewrite the chapter on subtyping and variance (rust-lang/nomicon#340)

## reference

5 commits in 553d99b02a53b4133a40d5bd2e19958c67487c00..5ca365eac678cb0d41a20b3204546d6ed70c7171
2023-05-22 10:50:07 -0700 to 2023-06-22 10:13:08 -0700
- Document the ordering behavior of crate cfgs (rust-lang/reference#1369)
- fix incorrect syntax for type-paths (rust-lang/reference#1370)
- Fix inconsistent formatting of Disambiguating Function Calls example (rust-lang/reference#1366)
- Add LoongArch to inline-assembly documentation (rust-lang/reference#1357)
- comments: Fix typo: inner -> outer (rust-lang/reference#1364)

## book

1 commits in 8fa6b854d515506d825390fe0d817f5ef0c89350..21cf840842bdf768a798869f06373c96c1cc5122
2023-04-12 20:05:30 -0400 to 2023-06-12 12:24:06 -0400
- Correct `i32` formatting in ch19-05

## rust-by-example

10 commits in 8ee9528b72b927cff8fd32346db8bbd1198816f0..57636d6926762861f34e030d52ca25a71e95e5bf
2023-05-01 18:18:34 -0300 to 2023-06-20 21:49:11 -0300
- Fixed line number (rust-lang/rust-by-example#1723)
- Fix example in from_into.md (rust-lang/rust-by-example#1720)
- cast.md improvements for signed boundary case casting (rust-lang/rust-by-example#1719)
- Correct commentary about arrays in iter_find.md (rust-lang/rust-by-example#1714)
- Improved wording in asm.md (rust-lang/rust-by-example#1717)
- fix link to inline assembly reference (rust-lang/rust-by-example#1715)
- Fix grammar in string.md (rust-lang/rust-by-example#1713)
- Update let-else example with main function (rust-lang/rust-by-example#1711)
- Expand `Option::and_then` example to contrast with `map` (rust-lang/rust-by-example#1710)
- Add example for destructuring structs without match (rust-lang/rust-by-example#1709)

## rustc-dev-guide

9 commits in f1e637883fafeb83bdd5906ee7f467e4d35b7337..17fe3e948498c50e208047a750f17d6a8d89669b
2023-05-17 21:44:05 -0500 to 2023-06-26 18:34:26 +0200
- fix_typo
- run-make tests: fix and improve (rust-lang/rustc-dev-guide#1702)
- add stub for proof trees (rust-lang/rustc-dev-guide#1700)
- Update track_caller reference link (rust-lang/rustc-dev-guide#1688)
- Include information about setup defaults in how-to-build guide (rust-lang/rustc-dev-guide#1694)
- Fix typo (rust-lang/rustc-dev-guide#1697)
- Fix typo in thir.md
- Update triagebot links.
- name-resolution: Fix some typos in "Scopes and ribs"
2023-06-27 07:01:33 +02:00
Matthias Krüger
3238a97d39
Rollup merge of #113058 - GuillaumeGomez:improve-code-comments, r=notriddle
Add/improve code comments

Working on something else and did some small comments updates/adds.

r? `@notriddle`
2023-06-27 07:01:32 +02:00
Matthias Krüger
a144272eee
Rollup merge of #113039 - matthiaskrgr:custom_mir, r=compiler-errors
make custom mir ICE a bit nicer
2023-06-27 07:01:32 +02:00
bors
b5e51db16d Auto merge of #112938 - compiler-errors:clause-3, r=oli-obk
Migrate `TyCtxt::predicates_of` and `ParamEnv::caller_bounds` to `Clause`

The last big change in the series.

I will follow-up with additional filed issues once this PR lands:
- [ ] Investigate making `TypeFoldable<TyCtxt<'tcx>> for ty::Clause<'tcx>` implementation less weird: 2efe091705/compiler/rustc_middle/src/ty/structural_impls.rs (L672)
- [ ] Clean up the elaborator since it should only be emitting child clauses, not predicates
- [ ] Rename identifiers like `pred` and `predicates` to `clause` if they're actually clauses around the codebase
- [ ] Validate that all of the `ToPredicate` impls are acutally still needed, or prune them if they're not

r? `@ghost` until the other branch lands
2023-06-27 03:14:45 +00:00
Ben Kimock
cdaac8799b Mention the panic function in CheckAlignment 2023-06-26 22:20:41 -04:00
bors
b9ad9b78a2 Auto merge of #112693 - ericmarkmartin:use-more-placeref, r=spastorino
Use PlaceRef abstractions more often

Associated issue: https://github.com/rust-lang/rust/issues/80647

r? `@spastorino`
2023-06-27 00:34:49 +00:00
Michael Goulet
374173cd99 TypeWellFormedInEnv 2023-06-26 23:12:04 +00:00
Michael Goulet
fbdef58414 Migrate predicates_of and caller_bounds to Clause 2023-06-26 23:12:03 +00:00
bors
2a15bdaaa1 Auto merge of #112969 - CryZe:patch-7, r=Mark-Simulacrum
Update wasi-libc

This updates wasi-libc to the latest master.

Resolves #112749
2023-06-26 21:51:03 +00:00
bors
36fb58e433 Auto merge of #113057 - TaKO8Ki:rollup-071lc9g, r=TaKO8Ki
Rollup of 2 pull requests

Successful merges:

 - #112677 (remove unused field)
 - #112920 (rustdoc: render generic params & where-clauses of cross-crate assoc tys in impls)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-26 18:42:01 +00:00
Matthias Krüger
c6e6ceb078 make custom mir ICE a bit nicer 2023-06-26 19:23:22 +02:00
Eric Huss
20c46f0ef1 Update books 2023-06-26 09:44:26 -07:00
Guillaume Gomez
32f056ce6b Add/improve code comments 2023-06-26 16:38:14 +02:00
Takayuki Maeda
40e3fcfd59
Rollup merge of #112920 - fmease:rustdoc-fix-112904, r=GuillaumeGomez
rustdoc: render generic params & where-clauses of cross-crate assoc tys in impls

We used to only ever render generic parameters & where-clauses of cross-crate associated types when the item was located inside of a trait and we used to just drop them when it was inside of an impl block (trait or inherent).

Fixes #112904.

`@rustbot` label A-cross-crate-reexports
2023-06-26 23:16:16 +09:00
Takayuki Maeda
c6a4d44977
Rollup merge of #112677 - the8472:remove-unusued-field, r=JohnTitor
remove unused field

Followup to #104455. The field is no longer needed since ExtractIf (previously DrainFilter) doesn't keep draining in its drop impl.
2023-06-26 23:16:16 +09:00
bors
6f8c27ae89 Auto merge of #112887 - WaffleLapkin:become_unuwuable_in_hir, r=compiler-errors,Nilstrieb
`hir`: Add `Become` expression kind (explicit tail calls experiment)

This adds `hir::ExprKind::Become` alongside ast lowering. During hir-thir lowering we currently lower `become` as `return`, so that we can partially test `become` without ICEing.

cc `@scottmcm`
r? `@Nilstrieb`
2023-06-26 13:51:04 +00:00
bors
27e10c5292 Auto merge of #113049 - matthiaskrgr:rollup-41wo5w8, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #111326 (Add support for NetBSD/aarch64-be (big-endian arm64).)
 - #112559 (Add esp-idf missing targets)
 - #112840 (doc: loongarch: Update maintainers)
 - #112955 (CI: cancel in-progress workflow runs after a push)
 - #112979 (Rewrite most diagnostics as translatable within resolve/imports)
 - #113034 (Switch some more Steps to `builder.msg`)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-26 10:15:16 +00:00
Matthias Krüger
5122e88b35
Rollup merge of #113034 - jyn514:ci-progress, r=oli-obk
Switch some more Steps to `builder.msg`

In particular, this hides compiletest suites under a dropdown - some builders are configured with `verbose-tests`, which makes the suites take up many thousands of lines.

before:
```
Documenting stage1 cargo (x86_64-unknown-linux-gnu)
Check compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
```

after:
```
::group::Documenting stage1 cargo (x86_64-unknown-linux-gnu)
::group::Testing stage1 compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu)
```

found this from https://github.com/rust-lang-ci/rust/actions/runs/5366993848/jobs/9736792611

r? `@oli-obk`
2023-06-26 11:58:46 +02:00
Matthias Krüger
005d860fc6
Rollup merge of #112979 - NotStirred:translatable_diag/resolve_imports, r=fee1-dead
Rewrite most diagnostics as translatable within resolve/imports
2023-06-26 11:58:45 +02:00
Matthias Krüger
5d9935a638
Rollup merge of #112955 - Kobzol:ci-pr-cancel-workflows, r=Mark-Simulacrum
CI: cancel in-progress workflow runs after a push

Experimenting with the `concurrency` attribute.

r? `@Mark-Simulacrum`
2023-06-26 11:58:45 +02:00
Matthias Krüger
de79f51206
Rollup merge of #112840 - loongarch-rs:update-docs, r=GuillaumeGomez
doc: loongarch: Update maintainers

My colleague, `@zhaixiaojuan,` has been completely occupied with other matters and is no longer in charge of Rust. Consequently, I intend to update the maintainers in the platform documentation to avoid causing any disruptions for her and to ensure that relevant notifications regarding LoongArch are promptly directed to the appropriate developers.

Thanks your for contributions!
2023-06-26 11:58:44 +02:00
Matthias Krüger
ac84b664f9
Rollup merge of #112559 - SergioGasquez:master, r=JohnTitor
Add esp-idf missing targets

Adds some esp-idf missing targets to the table
2023-06-26 11:58:44 +02:00
Matthias Krüger
f6d58eaad3
Rollup merge of #111326 - he32:netbsd-aarch64-be, r=oli-obk
Add support for NetBSD/aarch64-be (big-endian arm64).
2023-06-26 11:58:43 +02:00
Maybe Waffle
e38576a893 Support hir::ExprKind::Become in clippy 2023-06-26 08:56:32 +00:00
Maybe Waffle
ccb71ff424 hir: Add Become expression kind 2023-06-26 08:56:32 +00:00
bors
25b5af1b3a Auto merge of #113024 - Jerrody:master, r=thomcc
`Default`: Always inline primitive data types.
2023-06-26 06:45:04 +00:00
bors
06c58cb966 Auto merge of #112884 - klensy:ri-drop-old-clap, r=albertlarsan68
rust-installer: migrate to clap 4.2, change to 2021 edition and fix few clippy lints

Updated rust-installer to clap 4.2, dropping last user of clap v3; changes to 2021 edition, fixes few clippy warns.
2023-06-26 03:21:01 +00:00
Eric Mark Martin
c07c10d1e4 use PlaceRef abstractions more consistently 2023-06-25 20:38:01 -04:00
bors
ae8ffa663c Auto merge of #111850 - the8472:external-step-by, r=scottmcm
Specialize `StepBy<Range<{integer}>>`

OLD

    iter::bench_range_step_by_fold_u16      700.00ns/iter +/- 10.00ns
    iter::bench_range_step_by_fold_usize    519.00ns/iter  +/- 6.00ns
    iter::bench_range_step_by_loop_u32      555.00ns/iter  +/- 7.00ns
    iter::bench_range_step_by_sum_reducible  37.00ns/iter  +/- 0.00ns

NEW

    iter::bench_range_step_by_fold_u16       49.00ns/iter +/- 0.00ns
    iter::bench_range_step_by_fold_usize    194.00ns/iter +/- 1.00ns
    iter::bench_range_step_by_loop_u32       98.00ns/iter +/- 0.00ns
    iter::bench_range_step_by_sum_reducible   1.00ns/iter +/- 0.00ns

NEW + `-Ctarget-cpu=x86-64-v3`

    iter::bench_range_step_by_fold_u16      22.00ns/iter +/- 0.00ns
    iter::bench_range_step_by_fold_usize    80.00ns/iter +/- 1.00ns
    iter::bench_range_step_by_loop_u32      41.00ns/iter +/- 0.00ns
    iter::bench_range_step_by_sum_reducible  1.00ns/iter +/- 0.00ns

I have only optimized for walltime of those methods, I haven't tested whether it eliminates bounds checks when indexing into slices via things like `(0..slice.len()).step_by(16)`.
2023-06-26 00:28:30 +00:00
bors
7f01f03061 Auto merge of #113038 - matthiaskrgr:rollup-sdcfkxa, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #112976 (Add test for futures with HRTB)
 - #113013 (rustdoc: get rid of extra line when line-wrapping fn decls with empty arg list)
 - #113030 (Add a regression test for #109071)
 - #113031 (Add a regression test for #110933)
 - #113036 (Accept `ReStatic` for RPITIT)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-25 22:01:21 +00:00
Matthias Krüger
6c7575721f
Rollup merge of #113036 - TaKO8Ki:fix-112094, r=compiler-errors
Accept `ReStatic` for RPITIT

Fixes #112094

Regression in 8216b7f229

If there is a better suggestion, I will go with that.
2023-06-25 22:34:32 +02:00
Matthias Krüger
d7723f4180
Rollup merge of #113031 - JohnTitor:issue-110933, r=compiler-errors
Add a regression test for #110933

Closes #110933
r? `@compiler-errors`
2023-06-25 22:34:31 +02:00
Matthias Krüger
dfd6d708db
Rollup merge of #113030 - JohnTitor:issue-109071, r=TaKO8Ki
Add a regression test for #109071

Closes #109071
r? `@compiler-errors`
2023-06-25 22:34:31 +02:00
Matthias Krüger
32995d87e6
Rollup merge of #113013 - fmease:rustdoc-decl-line-wrapping-slim-arg-list, r=camelid
rustdoc: get rid of extra line when line-wrapping fn decls with empty arg list

Fixes https://github.com/bevyengine/bevy/issues/8898#issuecomment-1605683417:

![Screenshot 2023-06-24 at 23-42-53 any_with_component in bevy_ecs schedule common_conditions - Rust](https://github.com/rust-lang/rust/assets/14913065/4646eba6-b186-4d78-96d9-aad716a4ef5d)

It now prints as shown below (which conforms to the style guide):

```rs
pub fn any_with_component<T: Component>(
) -> impl FnMut(Query<'_, '_, (), With<T>>) -> bool + Clone
```

The bug was introduced in #109011.
2023-06-25 22:34:30 +02:00
Matthias Krüger
aa8a885cc1
Rollup merge of #112976 - dswij:issue-112347, r=compiler-errors
Add test for futures with HRTB

Part of #112347

This PR adds test for ice when resolving for `Futures` with HRTB.
2023-06-25 22:34:30 +02:00
bors
8084f397c6 Auto merge of #113037 - TaKO8Ki:rollup-pqfbxwk, r=TaKO8Ki
Rollup of 3 pull requests

Successful merges:

 - #112281 (Test the cargo args generated by bootstrap.py)
 - #113028 (rustdoc: handle assoc const equalities in cross-crate impl-Trait-in-arg-pos)
 - #113029 (CI: do not run Bump dependencies workflow on forks)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-25 18:26:41 +00:00
Havard Eidnes
abb43958a9 platform-support.md: remove references to not-yet upstreamed targets. 2023-06-25 18:23:33 +00:00
Takayuki Maeda
f948ce7362
Rollup merge of #113029 - Kobzol:ci-fork-update, r=Mark-Simulacrum
CI: do not run Bump dependencies workflow on forks

I haven't found a prettier way of doing this. We can possibly only use the condition on the `pr` job (to just disallow the creation of the PR), or only on the `not-waiting-on-bors` step, as if it doesn't run, the following job (probably) also shouldn't run.

Fixes: https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/.22Weekly.20cargo.20update.22.20on.20forks

r? `@Mark-Simulacrum`
2023-06-26 01:50:28 +09:00
Takayuki Maeda
019f43e6c2
Rollup merge of #113028 - fmease:rustdoc-x-crate-itiap-clean-term, r=notriddle
rustdoc: handle assoc const equalities in cross-crate impl-Trait-in-arg-pos

Fixes FIXME (the added test previously lead to an ICE).

`@rustbot` label A-cross-crate-reexports
2023-06-26 01:50:28 +09:00
Takayuki Maeda
96ab7e6ed7
Rollup merge of #112281 - jyn514:test-bootstrap-py, r=albertlarsan68
Test the cargo args generated by bootstrap.py

I recommend reviewing this commit-by-commit using the instructions in https://rustc-dev-guide.rust-lang.org/git.html#moving-large-sections-of-code.

- Test cargo arguments passed by bootstrap.py

  This moves a lot of code around, but the logic itself is not too terribly complicated.

    - Move almost all logic in `def bootstrap` to the `RustBuild` class, to avoid mixing setting configuration with running commands
    - Update various doctests to the new (more complete) RustBuild config. In particular, don't pretend that `bin_root` supports `build` being unset.
    - Change `parse_args` not to use a global, to allow testing it
    - Set BUILD_DIR appropriately so bootstrap.py doesn't panic because cargo isn't found

- Allow passing arguments to `bootstrap_test.py`

    Previous, it used the built-in test runner, which doesn't support options unless they're manually passed in the script.

- Fix progress messages for configure in bootstrap_test.py

    Before it would unconditionally print `configure-args = []`.

r? `@albertlarsan68` cc https://github.com/rust-lang/rust/pull/112089 https://github.com/rust-lang/rust/pull/111979#issuecomment-1568525699
2023-06-26 01:50:27 +09:00
Havard Eidnes
7a07ffdbd8 SUMMARY.md: add entry for NetBSD. 2023-06-25 16:18:08 +00:00
The 8472
f174547124 Mark the StepBy specialization as unsafe 2023-06-25 18:11:51 +02:00
The 8472
8a72f35234 StepBy<Range<{int <= usize}>> can be TrustedLen 2023-06-25 18:11:51 +02:00
Takayuki Maeda
83722c62b0 accept ReStatic for RPITIT
add an ui test for #112094
2023-06-26 01:11:44 +09:00
The 8472
f70a4b9dd3 doccomments for StepBy specializations 2023-06-25 18:02:11 +02:00
jyn
1e7f03718b fix some bugs
- fix tests when `--build` is set
- don't leak `config.example.toml` fd
- don't crash if `config.toml` doesn't exist yet
2023-06-25 10:01:04 -05:00
jyn
bd36f636cb Switch some more Steps to builder.msg
In particular, this hides compiletest suites under a dropdown - some builders are configured with `verbose-tests`, which makes the suites take up many thousands of lines.

before:
```
Documenting stage1 cargo (x86_64-unknown-linux-gnu)
Check compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
```

after:
```
::group::Documenting stage1 cargo (x86_64-unknown-linux-gnu)
::group::Testing stage1 compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu)
```
2023-06-25 09:40:30 -05:00