Commit Graph

254322 Commits

Author SHA1 Message Date
Trevor Gross
3488679768 Correct the const stabilization of last_chunk for slices
`<[T]>::last_chunk` should have become const stable as part of
<https://github.com/rust-lang/rust/pull/117561>. Update the const
stability gate to reflect this.
2024-05-07 03:03:44 -05:00
bors
d71b3f486a Auto merge of #124813 - maurer:llvm-aarch64-fn32, r=nikic
Adjust 64-bit ARM data layouts for LLVM update

LLVM has updated data layouts to specify `Fn32` on 64-bit ARM to avoid C++ accidentally underaligning functions when trying to comply with member function ABIs.

This should only affect Rust in cases where we had a similar bug (I don't believe we have one), but our data layout must match to generate code.

As a compatibility adaptatation, if LLVM is not version 19 yet, `Fn32` gets voided from the data layout.

See llvm/llvm-project#90415

`@rustbot` label: +llvm-main
cc `@krasimirgg`
r? `@durin42`
2024-05-07 03:46:03 +00:00
bors
5ae5d13537 Auto merge of #124830 - aeubanks:dbg, r=durin42
Adjust dbg.value/dbg.declare checks for LLVM update

https://github.com/llvm/llvm-project/pull/89799 changes llvm.dbg.value/declare intrinsics to be in a different, out-of-instruction-line representation. For example
  call void `@llvm.dbg.declare(...)`
becomes
  #dbg_declare(...)

Update tests accordingly to work with both the old and new way.
2024-05-07 00:03:52 +00:00
Arthur Eubanks
6c348aca4e Adjust dbg.value/dbg.declare checks for LLVM update
https://github.com/llvm/llvm-project/pull/89799 changes llvm.dbg.value/declare intrinsics to be in a different, out-of-instruction-line representation. For example
  call void @llvm.dbg.declare(...)
becomes
  #dbg_declare(...)

Update tests accordingly to work with both the old and new way.
2024-05-06 23:15:48 +00:00
bors
7d83a4c131 Auto merge of #124822 - matthiaskrgr:rollup-h7fc52t, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #124759 (Record impl args in the proof tree in new solver)
 - #124809 (borrowck: prepopulate opaque storage more eagerly)
 - #124815 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-06 21:51:20 +00:00
Matthias Krüger
61751b232e
Rollup merge of #124815 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

3 commits in d207d894cc5e1d496ab99beeacd1a420e5d4d238..bebcf527e67755a989a1739b7cfaa8f0e6b30040
2024-04-30 02:06:57 UTC to 2024-04-25 21:04:25 UTC

- [ch10-03] Fix wording change about mandatory type annotation (rust-lang/book#3904)
- Introduce handling for accessible/semantic note rendering in HTML (rust-lang/book#3907)
- Backport changes from print for ch7 (rust-lang/book#3901)

## rust-embedded/book

1 commits in aa7d4b0b4653ddb47cb1de2036d090ec2ba9dab1..17842ebb050f62e40a4618edeb8e8ee86e758707
2024-05-01 13:23:40 UTC to 2024-05-01 13:23:40 UTC

- Update embedded rust debugging section of tooling.md (rust-embedded/book#369)

## rust-lang/reference

1 commits in 5854fcc286557ad3ab34d325073d11d8118096b6..51817951d0d213a0011f82b62aae02c3b3f2472e
2024-04-27 17:54:45 UTC to 2024-04-27 17:54:45 UTC

- Add docs for `#[collapse_debuginfo]` attribute (rust-lang/reference#1468)

## rust-lang/rust-by-example

3 commits in 60d34b5fd33db1346f9aabfc0c9d0bda6c8e42be..229ad13b64d919b12e548d560f06d88963b25cd3
2024-05-06 00:15:45 UTC to 2024-04-24 18:29:38 UTC

- Missing import (rust-lang/rust-by-example#1841)
- Added missing word (rust-lang/rust-by-example#1838)
- Raw string literal can contain up to 255 #s according to Rust Reference (rust-lang/rust-by-example#1839)

## rust-lang/rustc-dev-guide

5 commits in 07425fed36b00e60341c5e29e28d37d40cbd4451..2d1947ff34d50ca46dfe242ad75531a4c429bb52
2024-05-06 06:48:21 UTC to 2024-04-28 18:31:21 UTC

- Add documentation for check-cfg by-default in UI tests (rust-lang/rustc-dev-guide#1966)
- Add documentation on Apple notification group (rust-lang/rustc-dev-guide#1964)
- Update CI documentation to avoid mentioning `expand-yaml-anchors` (rust-lang/rustc-dev-guide#1971)
- Rename `-Z verbose` to `-Z verbose-internals` (rust-lang/rustc-dev-guide#1968)
- typo traige->triage (rust-lang/rustc-dev-guide#1967)
2024-05-06 21:46:06 +02:00
Matthias Krüger
284b5530b8
Rollup merge of #124809 - lcnr:prepopulate-opaques, r=compiler-errors
borrowck: prepopulate opaque storage more eagerly

otherwise we ICE due to ambiguity when normalizing while computing implied bounds.

r? ``@compiler-errors``
2024-05-06 21:46:06 +02:00
Matthias Krüger
f76c8f7f77
Rollup merge of #124759 - compiler-errors:impl-args, r=lcnr
Record impl args in the proof tree in new solver

Rather than rematching them during select.

Also use `ImplSource::Param` instead of `ImplSource::Builtin` for alias-bound candidates, so we don't ICE in `Instance::resolve`.

r? lcnr
2024-05-06 21:46:05 +02:00
bors
ce652dbb9a Auto merge of #124209 - Urgau:check-cfg-more-friendly-docs, r=ehuss
Make check-cfg docs more user-friendly

This PR improves the `--check-cfg` to make them more user-friendly by:
 - explaining the purpose of the feature
 - removing the "form" jargon
 - making it (bit) less formal and more "friendly"
 - making the doc less cluttered
 - and by fixing (the width and flags) of the examples

`@rustbot` label +F-check-cfg
2024-05-06 19:43:59 +00:00
Michael Goulet
e34723997a Use correct ImplSource for alias bounds 2024-05-06 14:38:35 -04:00
Michael Goulet
207b4b8e88 Record impl args in the InsepctCandiate rather than rematching during select 2024-05-06 14:17:22 -04:00
rustbot
da7cb4337f Update books 2024-05-06 14:01:31 -04:00
bors
31110152e2 Auto merge of #124811 - matthiaskrgr:rollup-4zpov13, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #124520 (Document that `create_dir_all` calls `mkdir`/`CreateDirW` multiple times)
 - #124724 (Prefer lower vtable candidates in select in new solver)
 - #124771 (Don't consider candidates with no failing where clauses when refining obligation causes in new solver)
 - #124808 (Use `super_fold` in `RegionsToStatic` visitor)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-06 17:24:30 +00:00
Urgau
a7a9793d56 Make check-cfg docs more user-friendly 2024-05-06 19:02:05 +02:00
Matthew Maurer
4d397d33da Adjust 64-bit ARM data layouts for LLVM update
LLVM has updated data layouts to specify `Fn32` on 64-bit ARM to avoid
C++ accidentally underaligning functions when trying to comply with
member function ABIs.

This should only affect Rust in cases where we had a similar bug (I
don't believe we have one), but our data layout must match to generate
code.

As a compatibility adaptatation, if LLVM is not version 19 yet, `Fn32`
gets voided from the data layout.

See llvm/llvm-project#90415
2024-05-06 16:53:17 +00:00
Matthias Krüger
ad73b1623d
Rollup merge of #124808 - compiler-errors:super, r=lcnr
Use `super_fold` in `RegionsToStatic` visitor

so as to avoid an infinite stack cycle

fixes #124805
r? lcnr
2024-05-06 18:50:36 +02:00
Matthias Krüger
43de8225dc
Rollup merge of #124771 - compiler-errors:cand-has-failing-wc, r=lcnr
Don't consider candidates with no failing where clauses when refining obligation causes in new solver

Improves error messages when we have param-env candidates that don't deeply unify (i.e. after alias-bounds).

r? lcnr
2024-05-06 18:50:35 +02:00
Matthias Krüger
2d557ba9f4
Rollup merge of #124724 - compiler-errors:prefer-lower, r=lcnr
Prefer lower vtable candidates in select in new solver

Also, adjust the select visitor to only winnow when the *parent* goal is `Certainty::Yes`. This means that we won't winnow in cases when we have any ambiguous inference guidance from two candidates.

r? lcnr
2024-05-06 18:50:35 +02:00
Matthias Krüger
44cbf7d853
Rollup merge of #124520 - tbu-:pr_create_dir_all_doc, r=Amanieu
Document that `create_dir_all` calls `mkdir`/`CreateDirW` multiple times
2024-05-06 18:50:34 +02:00
Michael Goulet
116f95bb46 Use super_fold in RegionsToStatic visitor 2024-05-06 12:22:15 -04:00
lcnr
5714c1f364 switch new solver to directly inject opaque types 2024-05-06 16:19:32 +00:00
lcnr
24ee32cf70 borrowck: more eagerly prepopulate opaques 2024-05-06 16:04:57 +00:00
Michael Goulet
4e3350d43b Don't consider candidates with no failing where clauses 2024-05-06 11:32:50 -04:00
lcnr
5f044f3528 BorrowckInferCtxt: infcx by value 2024-05-06 15:20:13 +00:00
Michael Goulet
a4ee20eb13 Prefer lower vtable candidates in select in new solver 2024-05-06 10:48:39 -04:00
bors
fc47cf38e5 Auto merge of #123850 - tspiteri:f16_f128_consts, r=Amanieu
Add constants for f16 and f128

- Commit 1 adds associated constants for `f16`, excluding NaN and infinities as these are implemented using arithmetic for `f32` and `f64`.
- Commit 2 adds associated constants for `f128`, excluding NaN and infinities.
- Commit 3 adds constants in `std::f16::consts`.
- Commit 4 adds constants in `std::f128::consts`.
2024-05-06 14:45:28 +00:00
bors
25e3949aa1 Auto merge of #124753 - GuillaumeGomez:migrate-rustdoc-determinism, r=jieyouxu
Migrate `run-make/rustdoc-error-lines` to new `rmake.rs`

Part of https://github.com/rust-lang/rust/issues/121876.

There was a weird naming inconsistency with `input`/`output`. A few tests write `.arg("-o").arg(path)` and the `output` method was actually the command output. So instead, I renamed the original `output` into `command_output` so that I could create the `output` method with the expected effect (and updated the tests to use it too).

EDIT: The first two commits come from https://github.com/rust-lang/rust/pull/124711. Some weird things happened recently pparently. ^^'

r? `@jieyouxu`
2024-05-06 12:00:44 +00:00
bors
8cef37dbb6 Auto merge of #124497 - rytheo:move-std-tests-to-library, r=workingjubilee
Move some stdlib tests from `tests/ui` to `library/std/tests`

Related to #99417
2024-05-06 09:53:24 +00:00
bors
69f53f5e55 Auto merge of #124679 - Urgau:check-cfg-structured-cli-errors, r=nnethercote
Improve check-cfg CLI errors with more structured diagnostics

This PR improve check-cfg CLI errors with more structured diagnostics.

In particular it now shows the statement where the error occurred, what kind lit it is, as well as pointing users to the doc for more details.

`@rustbot` label +F-check-cfg
2024-05-06 07:46:27 +00:00
Guillaume Gomez
34fe2172b1 Migrate run-make/rustdoc-error-lines to rmake.rs 2024-05-06 09:16:35 +02:00
Guillaume Gomez
823b423d4c Add new output method to Rustc and Rustdoc types 2024-05-06 09:16:35 +02:00
Urgau
228496e4f5 Improve check-cfg CLI errors with more structured diagnostics 2024-05-06 07:44:41 +02:00
Urgau
0b418f2b03 Return coherent description for boolean instead of panicking 2024-05-06 07:44:41 +02:00
bors
d287f3e4ee Auto merge of #124784 - matthiaskrgr:rollup-e9pg3v4, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #124742 (Add `rustfmt` cfg to well known cfgs list)
 - #124765 ([rustdoc] Fix bad color for setting cog in ayu theme)
 - #124768 ([resubmission] Meta: Enable the brand new triagebot transfer command)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-06 05:39:09 +00:00
Matthias Krüger
78ee4ce9b8
Rollup merge of #124768 - fmease:enable-triagebot-transfer-2, r=jackh726
[resubmission] Meta: Enable the brand new triagebot transfer command

#124725, https://github.com/rust-lang/rust/pull/124725#issuecomment-2094783916

r? ghost
2024-05-06 06:21:04 +02:00
Matthias Krüger
b0fb3c56e0
Rollup merge of #124765 - GuillaumeGomez:fix-wrong-cog-colotr, r=notriddle
[rustdoc] Fix bad color for setting cog in ayu theme

Before:

![Screenshot from 2024-05-05 19-29-36](https://github.com/rust-lang/rust/assets/3050060/e1f078e5-7fb3-472d-91e7-b4bde551d411)

After:

![image](https://github.com/rust-lang/rust/assets/3050060/0aa115ac-dd69-48e1-b93e-067a39cf25d2)

r? ````@notriddle````
2024-05-06 06:21:04 +02:00
Matthias Krüger
3d97660f40
Rollup merge of #124742 - Urgau:check-cfg-rustfmt, r=fmease
Add `rustfmt` cfg to well known cfgs list

This PR adds the `rustfmt` cfg to the well known cfgs list.

Related to https://github.com/rust-lang/rust/issues/124735
2024-05-06 06:21:03 +02:00
bors
96f1da8268 Auto merge of #124638 - nnethercote:mv-expand-tests, r=compiler-errors
Move some tests from `rustc_expand` to `rustc_parse`.

There are some test cases involving `parse` and `tokenstream` and `mut_visit` that are located in `rustc_expand`. Because it used to be the case that constructing a `ParseSess` required the involvement of `rustc_expand`. However, since #64197 merged (a long time ago) `rust_expand` no longer needs to be involved.

This commit moves the tests into `rustc_parse`. This is the optimal place for the `parse` tests. It's not ideal for the `tokenstream` and `mut_visit` tests -- they would be better in `rustc_ast` -- but they still rely on parsing, which is not available in `rustc_ast`. But `rustc_parse` is lower down in the crate graph and closer to `rustc_ast` than `rust_expand`, so it's still an improvement for them.

The exact renaming is as follows:

- rustc_expand/src/mut_visit/tests.rs -> rustc_parse/src/parser/mut_visit/tests.rs
- rustc_expand/src/tokenstream/tests.rs -> rustc_parse/src/parser/tokenstream/tests.rs
- rustc_expand/src/tests.rs + rustc_expand/src/parse/tests.rs -> compiler/rustc_parse/src/parser/tests.rs

The latter two test files are combined because there's no need for them to be separate, and having a `rustc_parse::parser::parse` module would be weird. This also means some `pub(crate)`s can be removed.

r? `@compiler-errors`
2024-05-06 03:31:30 +00:00
bors
80420a693f Auto merge of #124747 - MasterAwesome:master, r=davidtwco
Support Result<T, E> across FFI when niche optimization can be used (v2)

This PR is identical to #122253, which was approved and merged but then removed from master by a force-push due to a [CI bug](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/ci.20broken.3F).

r? ghost

Original PR description:

---

Allow allow enums like `Result<T, E>` to be used across FFI if the T/E can be niche optimized and the non-niche-optimized type is FFI safe.

Implementation of https://github.com/rust-lang/rfcs/pull/3391
Tracking issue: https://github.com/rust-lang/rust/issues/110503

Additional ABI and codegen tests were added in https://github.com/rust-lang/rust/pull/115372
2024-05-06 00:55:49 +00:00
Nicholas Nethercote
2acbe9c743 Move some tests from rustc_expand to rustc_parse.
There are some test cases involving `parse` and `tokenstream` and
`mut_visit` that are located in `rustc_expand`. Because it used to be
the case that constructing a `ParseSess` required the involvement of
`rustc_expand`. However, since #64197 merged (a long time ago)
`rust_expand` no longer needs to be involved.

This commit moves the tests into `rustc_parse`. This is the optimal
place for the `parse` tests. It's not ideal for the `tokenstream` and
`mut_visit` tests -- they would be better in `rustc_ast` -- but they
still rely on parsing, which is not available in `rustc_ast`. But
`rustc_parse` is lower down in the crate graph and closer to `rustc_ast`
than `rust_expand`, so it's still an improvement for them.

The exact renaming is as follows:

- rustc_expand/src/mut_visit/tests.rs -> rustc_parse/src/parser/mut_visit/tests.rs
- rustc_expand/src/tokenstream/tests.rs -> rustc_parse/src/parser/tokenstream/tests.rs
- rustc_expand/src/tests.rs + rustc_expand/src/parse/tests.rs ->
  compiler/rustc_parse/src/parser/tests.rs

The latter two test files are combined because there's no need for them
to be separate, and having a `rustc_parse::parser::parse` module would
be weird. This also means some `pub(crate)`s can be removed.
2024-05-06 09:06:02 +10:00
bors
3170bd9d1b Auto merge of #124146 - madsmtm:apple-triage, r=dtolnay
Triagebot: Rename `macos` ping group to `apple`

Expand the scope of the macOS ping group to all Apple targets.

Blocked on https://github.com/rust-lang/team/pull/1436 (rename in `team` repo)
Blocked on https://github.com/rust-lang/rustc-dev-guide/pull/1964 (referenced documentation link)

`@rustbot` label O-macos O-ios O-tvos O-watchos O-visionos
2024-05-05 22:22:58 +00:00
bors
9c9b568792 Auto merge of #124603 - Zalathar:mcdc-mappings, r=Nadrieril
coverage: Split out MC/DC mappings from `BcbMappingKind`

These variants were added to `BcbMappingKind` as part of the [MC/DC coverage](https://en.wikipedia.org/wiki/Modified_Condition/Decision_Coverage) implementation in #123409, because that was the path-of-least-resistance for integrating them into the existing code.

However, they ultimately represent complex concepts that the enum was not intended to handle, leading to more complexity in the code that processes them. This PR therefore follows in the footsteps of #124545, and splits the MC/DC mappings out into their own dedicated vectors of structs.

After that, `BcbMappingKind` itself ends up having only one variant (`Code`), so this PR also flattens that enum into its enclosing struct, renamed to `mapping::CodeMapping`.

---

No functional changes.

This will conflict slightly with #124571, but hopefully that should be easy to resolve either way.

`@rustbot` label +A-code-coverage
2024-05-05 19:23:20 +00:00
Mads Marquart
dc153f8c50 Change the label for the Apple ping group to the new O-apple 2024-05-05 21:20:25 +02:00
León Orell Valerian Liehr
6c1b8d2846
Meta: Enable the triagebot transfer command 2024-05-05 21:08:44 +02:00
Guillaume Gomez
e460901b13 Add GUI regression test for setting's cog color 2024-05-05 20:07:12 +02:00
Guillaume Gomez
0cbebd07ee Fix bad color for setting cog in ayu theme 2024-05-05 20:07:12 +02:00
bors
872a85658d Auto merge of #124754 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-05-05 17:08:24 +00:00
Ralf Jung
ba94910afd update rustc-build-sysroot for dealing with unexpected_cfgs 2024-05-05 17:18:57 +02:00
Ralf Jung
47b3ce0ea7 update lockfile 2024-05-05 17:17:45 +02:00
bors
7c4ac0603e Auto merge of #124752 - GuillaumeGomez:rollup-a4qagbd, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #124148 (rustdoc-search: search for references)
 - #124668 (Fix bootstrap panic when build from tarball)
 - #124736 (compiler: upgrade time from 0.3.34 to 0.3.36)
 - #124748 (Fix unwinding on 32-bit watchOS ARM (v2))
 - #124749 (Stabilize exclusive_range_pattern (v2))
 - #124750 (Document That `f16` And `f128` Hardware Support is Limited (v2))

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-05 14:59:34 +00:00