Commit Graph

261364 Commits

Author SHA1 Message Date
Trevor Gross 526b4c9070
Rollup merge of #128036 - matthiaskrgr:ccrashes, r=jieyouxu
add more tests

r? `@jieyouxu`
2024-07-22 11:40:22 -05:00
Trevor Gross 8ee5e271ef
Rollup merge of #128008 - weiznich:fix/121521, r=lcnr
Start using `#[diagnostic::do_not_recommend]` in the standard library

This commit starts using `#[diagnostic::do_not_recommend]` in the standard library to improve some error messages. In this case we just hide a certain nightly only impl as suggested in #121521

The result in not perfect yet, but at least the `Yeet` suggestion is not shown anymore. I would consider that as a minor improvement.
2024-07-22 11:40:21 -05:00
Trevor Gross a7e884f50e
Rollup merge of #127923 - ferrocene:use-reuse-tool-4.0, r=pietroalbini
Use reuse tool 4.0

This change upgrades us to reuse-tool 4.0.3, which has a new TOML format configuration instead of the old `.reuse/dep5` Debian-style file.

* Updated requirements file to install reuse-4.0.3
* Ran `reuse convert-dep5` to switch to new file format
* Switched over to `override` so the `REUSE.toml` file takes precedence over whatever random Copyright strings `reuse` finds in the source tree.

Should fix https://github.com/rust-lang/rust/issues/127361
2024-07-22 11:40:21 -05:00
Trevor Gross 3ba92bec0e
Rollup merge of #127820 - Oneirical:intestellar-travel, r=jieyouxu
Rewrite and rename `issue-14698`. `issue-33329` and `issue-107094` `run-make` tests to rmake or ui

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

try-job: armhf-gnu
try-job: test-various
try-job: aarch64-apple
try-job: x86_64-msvc
2024-07-22 11:40:20 -05:00
Trevor Gross 5e8e46cbd2
Rollup merge of #127506 - liushuyu:s390x-target-features, r=davidtwco
rustc_target: add known safe s390x target features

This pull request adds known safe target features for s390x (aka IBM Z systems).
Currently, these features are unstable since stabilizing the target features requires submitting proposals.

The `vector` feature was added in IBM Z13 (`arch11`), and this is a SIMD feature for the newer IBM Z systems.
The `backchain` attribute is the IBM Z way of adding frame pointers like unwinding capabilities (the "frame-pointer" switch on IBM Z and IBM POWER platforms will add _emulated_ frame pointers to the binary, which profilers can't use for unwinding the stack).

Both attributes can be applied at the LLVM module or function levels. However, the `backchain` attribute has to be enabled for all the functions in the call stack to get a successful unwind process.
2024-07-22 11:40:19 -05:00
Trevor Gross 81135a015f
Rollup merge of #125990 - tbu-:pr_unsafe_env_lint_name, r=ehuss
Rename `deprecated_safe` lint to `deprecated_safe_2024`

Create a lint group `deprecated_safe` that includes `deprecated_safe_2024`.

Addresses https://github.com/rust-lang/rust/issues/124866#issuecomment-2142814375.

r? `@ehuss`
2024-07-22 11:40:19 -05:00
Trevor Gross a42b99384d
Rollup merge of #117932 - GuillaumeGomez:update-rustdoc-book, r=notriddle
Correct rustdoc section where we talk about rustdoc emitting errors on invalid code

As discussed on [zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/stop.20accepting.20broken.20code/near/401760318).

r? `@notriddle`
2024-07-22 11:40:18 -05:00
Oneirical 8990df7d13 rewrite and rename issue-107094 to rmake 2024-07-22 10:12:00 -04:00
Oneirical 613a7a79e7 rewrite and rename issue-33329 to ui test 2024-07-22 10:11:59 -04:00
Oneirical e870ab86dc rewrite and rename issue-14698 to rmake 2024-07-22 10:11:47 -04:00
Jonathan Pallant 2e971bf5c6
Removed CondensedDirectory support from license tools.
Now that we have reuse-tool 4.0, we no longer need to massage the JSON license data to collapse LLVM into a single copyright notice and license - reuse-tool can do it for us using an annotation in REUSE.toml.

This effectively reverts c6eb03b.
2024-07-22 10:44:18 +01:00
bors aee3dc4c6c Auto merge of #128056 - jieyouxu:rollup-zb1y27e, r=jieyouxu
Rollup of 8 pull requests

Successful merges:

 - #127177 (Distribute rustc_codegen_cranelift for arm64 macOS)
 - #127415 (Add missing try_new_uninit_slice_in and try_new_zeroed_slice_in)
 - #127510 (Rewrite `test-float-parse` in Rust)
 - #127977 (Update wasi-sdk in CI to latest release)
 - #127985 (Migrate `test-benches`, `c-unwind-abi-catch-panic` and `compiler-lookup-paths-2` `run-make` tests to rmake)
 - #127996 (Clean up warnings + `unsafe_op_in_unsafe_fn` when building std for armv6k-nintendo-3ds)
 - #128035 (Add test for #125837)
 - #128054 (mw triagebot vacation)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-22 08:49:00 +00:00
Jonathan Pallant 445e70bc04
Include REUSE.toml in REUSE.toml.
Also remove to licenses we no longer need, and given REUSE.toml reads some basic idea of what it's about.
2024-07-22 09:44:18 +01:00
许杰友 Jieyou Xu (Joe) c4c0ca41f0
Rollup merge of #128054 - michaelwoerister:mwoff072024, r=jieyouxu
mw triagebot vacation

I'll be away from computers for a couple of weeks.
2024-07-22 16:44:07 +08:00
许杰友 Jieyou Xu (Joe) f4d6d997e3
Rollup merge of #128035 - tiif:issue-125837, r=lcnr
Add test for #125837

Fixes #125837
2024-07-22 16:44:06 +08:00
许杰友 Jieyou Xu (Joe) 7d81e092a1
Rollup merge of #127996 - ian-h-chamberlain:fix/horizon-warnings-unsafe-in-unsafe, r=tgross35
Clean up warnings + `unsafe_op_in_unsafe_fn` when building std for armv6k-nintendo-3ds

See #127747

ping `@AzureMarker` `@Meziu`

I could only find one instance needing an extra `unsafe` that was not also shared with many other `unix` targets (presumably these will get covered in larger sweeping changes, I didn't want to introduce churn that would potentially conflict with those). The one codepath I found is shared with `vita` however, so also pinging `@nikarh` `@pheki` `@zetanumbers` just to make sure they're aware of this change.

Also removed one unused import from `process_unsupported` which should simply fix the warning for any target that uses it.
2024-07-22 16:44:06 +08:00
许杰友 Jieyou Xu (Joe) 5b915ab022
Rollup merge of #127985 - Oneirical:testibule-of-hell, r=Kobzol
Migrate `test-benches`, `c-unwind-abi-catch-panic` and `compiler-lookup-paths-2` `run-make` tests to rmake

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).
2024-07-22 16:44:05 +08:00
许杰友 Jieyou Xu (Joe) c89613938d
Rollup merge of #127977 - alexcrichton:update-wasi-sdk, r=Mark-Simulacrum
Update wasi-sdk in CI to latest release

This commit updates the `wasi-sdk` download used by the `wasm32-wasi*` targets. The motivation for this commit is generally just "keep things up to date" and is not intended to cause any issues or differences from before, just a routine update.
2024-07-22 16:44:05 +08:00
许杰友 Jieyou Xu (Joe) 27550f4fa4
Rollup merge of #127510 - tgross35:test-float-parse-update, r=Mark-Simulacrum
Rewrite `test-float-parse` in Rust

Migrate from the currently broken Rust + Python `test-float-parse` to a Rust implementation. This newer version should be significantly faster (tests execute in parallel with threads, rather than series across multiple processes, which also eliminates the "...the worker processes are leaked and stick around forever" message), and should be significantly easier to extend to the new float types.

Since this is faster and hopefully more stable, we should be able to launch it with `x` and run the faster tests in CI.
2024-07-22 16:44:04 +08:00
许杰友 Jieyou Xu (Joe) 9f4039fcd5
Rollup merge of #127415 - AljoschaMeyer:master, r=dtolnay
Add missing try_new_uninit_slice_in and try_new_zeroed_slice_in

The methods for fallible slice allocation in a given allocator were missing from `Box`, which was an oversight according to https://github.com/rust-lang/wg-allocators/issues/130

This PR adds them as `try_new_uninit_slice_in` and `try_new_zeroed_slice_in`. I simply copy-pasted the implementations of `try_new_uninit_slice` and `try_new_zeroed_slice` and adusted doc comment, typings, and the allocator it uses internally.

Also adds missing punctuation to the doc comments of `try_new_uninit_slice` and `try_new_zeroed_slice`.

Related issue is https://github.com/rust-lang/rust/issues/32838 (Allocator traits and std::heap) *I think*. Also relevant is https://github.com/rust-lang/rust/issues/63291, but I did not add the corresponding `#[unstable]` proc macro, since `try_new_uninit_slice` and `try_new_zeroed_slice` are also not annotated with it.
2024-07-22 16:44:03 +08:00
许杰友 Jieyou Xu (Joe) b66b4020d8
Rollup merge of #127177 - bjorn3:arm64_macos_cg_clif, r=Mark-Simulacrum
Distribute rustc_codegen_cranelift for arm64 macOS

Support for arm64 macOS has been added to rustc_codegen_cranelift recently.

Fixes https://github.com/rust-lang/rustc_codegen_cranelift/issues/1502
2024-07-22 16:44:02 +08:00
Jonathan Pallant aa32a2c3a2
Regenerated hashes using python3.10
) brew install python@3.10
) python3.10 -m venv /tmp/myenv
) source /tmp/myenv/bin/activate
) pip install pip-tools
) /tmp/myenv/bin/pip-compile --allow-unsafe --generate-hashes reuse-requirements.in
2024-07-22 09:40:27 +01:00
Michael Woerister ab71870f8d mw out of office 2024-07-22 10:05:56 +02:00
Aljoscha Meyer 351fe27354
Use given allocator instad of Global 2024-07-22 08:17:46 +02:00
bors ae7b1c1916 Auto merge of #127442 - saethlin:alloc-decoding-lock, r=oli-obk
Try to fix ICE from re-interning an AllocId with different allocation contents

As far as I can tell, based on my investigation in https://github.com/rust-lang/rust/issues/126741, the racy decoding scheme implemented here was never fully correct, but the arrangement of Allocations that's required to ICE the compiler requires some very specific MIR optimizations to create. As far as I can tell, GVN likes to create the problematic pattern, which is why we're noticing this problem now.

So the solution here is to not do racy decoding. If two threads race to decoding an AllocId, one of them is going to sit on a lock until the other is done.
2024-07-22 05:56:05 +00:00
Georg Semmler 00da9fc961
Start using `#[diagnostic::do_not_recommend]` in the standard library
This commit starts using `#[diagnostic::do_not_recommend]` in the
standard library to improve some error messages. In this case we just
hide a certain nightly only impl as suggested in #121521
2024-07-22 07:29:59 +02:00
bors ee0fd6caf7 Auto merge of #128048 - workingjubilee:rollup-gehtjxd, r=workingjubilee
Rollup of 6 pull requests

Successful merges:

 - #127583 (Deal with invalid UTF-8 from `gai_strerror`)
 - #128014 (Fix stab display in doc blocks)
 - #128020 (Just totally fully deny late-bound consts)
 - #128023 (rustdoc: short descriptions cause word-breaks in tables)
 - #128033 (Explain why we require `_` for empty patterns)
 - #128038 (Don't output incremental test artifacts into working directory)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-22 03:31:16 +00:00
Jubilee fdef1d9592
Rollup merge of #128038 - compiler-errors:inc-fat, r=oli-obk
Don't output incremental test artifacts into working directory

Currently tests can ICE when the test spits out `inc-fat` incremental artifacts directly into the top of the git checkout, and then the compiler version changes, and it reads nonsense incremental artifacts on a subsequent test run.

r? `@oli-obk`

cc `@Oneirical,` I think you added this -- I think the right flag to add when porting `-Cincremental` run-make tests is to use `//@ incremental` rather than manually specifying the `-Cincremental` rustflag.
2024-07-21 17:44:30 -07:00
Jubilee d484654a5e
Rollup merge of #128033 - Nadrieril:explain-empty-wildcards, r=compiler-errors
Explain why we require `_` for empty patterns

This adds a note to the "non-exhaustive patterns" diagnostic to explain why we sometimes require extra `_` patterns on empty types. This is one of the two diagnostic improvements I wanted to do before [stabilizing `min_exhaustive_patterns`](https://github.com/rust-lang/rust/pull/122792).

r? ``@compiler-errors``
2024-07-21 17:44:30 -07:00
Jubilee b9c9f07db0
Rollup merge of #128023 - Kijewski:pr-table-width, r=notriddle
rustdoc: short descriptions cause word-breaks in tables

The `.item-table` class is used to display name+description lists, e.g. the exported functions, as a table. If the names are long and the descriptions are short, then the width of the table does not expand to the whole size, but only uses a fraction. This causes a some names to break inside a word.

This change makes the table always use 100% of its parent width. The `.width-limiter` wrapper already ensures that the used width still does not become excessive.

See e.g. <https://docs.rs/mathlab/0.3.0/mathlab/fun/vec_num/index.html> or <https://docs.rs/cw-events/0.0.9/cw_events/> (random choices out of the list of the recent releases).

[![](https://i.imgur.com/XnH4eeT.png)](https://imgur.com/XnH4eeT) [![](https://i.imgur.com/7iQ9xE2.png)](https://imgur.com/7iQ9xE2)

The problem occurs (at least) in Firefox 130, Falkon 24, and Konqueror 22. It does not occur in Chrome 126.
2024-07-21 17:44:29 -07:00
Jubilee 2ef7699a1a
Rollup merge of #128020 - compiler-errors:nlb-no-const, r=BoxyUwU
Just totally fully deny late-bound consts

Kinda don't care about supporting this until we have where clauses on binders. They're super busted and should be reworked in due time, and they are approximately 100% useless until then 😸

Fixes #127970
Fixes #127009

r? ``@BoxyUwU``
2024-07-21 17:44:29 -07:00
Jubilee 5bd7525856
Rollup merge of #128014 - GuillaumeGomez:stab-in-doc-blocks, r=notriddle
Fix stab display in doc blocks

Went across this bug randomly:

![Screenshot from 2024-07-20 22-09-49](https://github.com/user-attachments/assets/89fdf427-b00e-4fcb-9d57-078bcb1bacd9)

With the fixed CSS:

![Screenshot from 2024-07-20 22-10-14](https://github.com/user-attachments/assets/eda9a1a6-6a12-408f-bd3a-25bb3397d163)

r? ```@notriddle```
2024-07-21 17:44:28 -07:00
Jubilee 6af66e836f
Rollup merge of #127583 - Nilstrieb:invalid-utf8, r=joboet
Deal with invalid UTF-8 from `gai_strerror`

When the system is using a non-UTF-8 locale, the value will indeed not be UTF-8. That sucks for everyone involved, but is no reason for panic. We can "handle" this gracefully by just using from lossy, replacing the invalid UTF-8 with � and keeping the accidentally valid UTF-8. Good luck when debugging, but at least it's not a crash.

We already do this for `strerror_r`.

fixes #127563
2024-07-21 17:44:27 -07:00
Ian Chamberlain dba6b74dd8
Fix warnings when checking armv6k-nintendo-3ds
Also fix one instance of unsafe_op_in_unsafe_fn that's specific to
horizon + vita - most others should be common with other code.
2024-07-21 20:12:54 -04:00
bors 0f8534e79e Auto merge of #120812 - compiler-errors:impl-sorting, r=lcnr
Remove unnecessary impl sorting in queries and metadata

Removes unnecessary impl sorting because queries already return their keys in HIR definition order: https://github.com/rust-lang/rust/issues/120371#issuecomment-1926422838

r? `@cjgillot` or `@lcnr` -- unless I totally misunderstood what was being asked for here? 😆

fixes #120371
2024-07-21 22:43:47 +00:00
Michael Goulet 6a9110aa5a Don't output test artifacts into working directory 2024-07-21 13:45:55 -04:00
Trevor Gross d12387835f Run `test-float-parse` as part of CI
With the previous improvements, it is now possible to run float parsing
tests as part of CI. Enable it here.

This only runs a subset of tests, which takes about one minute.
2024-07-21 11:57:10 -05:00
Ben Kimock 107cf981d5 Explain why the new setup can't deadlock 2024-07-21 12:31:25 -04:00
Matthias Krüger 5ab2e40294 add more tests 2024-07-21 17:50:57 +02:00
tiif 95f091693f Add test 2024-07-21 21:42:10 +08:00
Nadrieril 8a49d83db7 Explain why we require `_` for empty patterns 2024-07-21 15:24:27 +02:00
Nadrieril 710add58e2 Tweak `collect_non_exhaustive_tys` 2024-07-21 15:24:27 +02:00
Nilstrieb ae42efc522 Deal with invalid UTF-8 from `gai_strerror`
When the system is using a non-UTF-8 locale, the value will indeed not
be UTF-8. That sucks for everyone involved, but is no reason for panic.
We can "handle" this gracefully by just using from lossy, replacing the
invalid UTF-8 with the ? and keeping the accidentally valid UTF-8.
Good luck when debugging, but at least it's not a crash.

We already do this for `strerror_r`.
2024-07-21 13:22:03 +02:00
Guillaume Gomez 84db684f49 Update `source-code-page-code-scroll.goml` GUI test 2024-07-21 12:47:34 +02:00
Guillaume Gomez e4d701b1d3 Add regression test for stab display in doc blocks 2024-07-21 11:52:24 +02:00
bors 92c6c03805 Auto merge of #127993 - weihanglo:update-cargo, r=weihanglo
Update cargo

9 commits in a2b58c3dad4d554ba01ed6c45c41ff85390560f2..5f6b9a92201d78af75dc24f14662c3e2dacbbbe1
2024-07-16 00:52:02 +0000 to 2024-07-19 18:09:17 +0000
- Add `TomlPackage::new`, `Default` for `TomlWorkspace` (rust-lang/cargo#14271)
- fix(test): Move 'cargo_home' from 'install' to 'paths' (rust-lang/cargo#14270)
- fix(test)!: Clarify extension trait role with rename (rust-lang/cargo#14269)
- feat(test): Re-export ProcessBuilder (rust-lang/cargo#14268)
- fix(test): Move path2url to CargoPathExt::to_url (rust-lang/cargo#14266)
- Fix passing of links-overrides with target-applies-to-host and an implicit target (rust-lang/cargo#14205)
- fix(toml): Improve error on missing package and workspace (rust-lang/cargo#14261)
- Migrate global_cache_tracker snapbox (rust-lang/cargo#14244)
- make summary sync by using Arc not Rc (rust-lang/cargo#14260)
2024-07-21 09:06:47 +00:00
bors 9629b90b3f Auto merge of #127722 - BoxyUwU:new_adt_const_params_limitations, r=compiler-errors
Forbid borrows and unsized types from being used as the type of a const generic under `adt_const_params`

Fixes #112219
Fixes #112124
Fixes #112125

### Motivation

Currently the `adt_const_params` feature allows writing `Foo<const N: [u8]>` this is entirely useless as it is not possible to write an expression which evaluates to a type that is not `Sized`. In order to actually use unsized types in const generics they are typically written as `const N: &[u8]` which *is* possible to provide a value of.

Unfortunately allowing the types of const parameters to contain references is non trivial (#120961) as it introduces a number of difficult questions about how equality of references in the type system should behave. References in the types of const generics is largely only useful for using unsized types in const generics.

This PR introduces a new feature gate `unsized_const_parameters` and moves support for `const N: [u8]` and `const N: &...` from `adt_const_params` into it. The goal here hopefully is to experiment with allowing `const N: [u8]` to work without references and then eventually completely forbid references in const generics.

Splitting this out into a new feature gate means that stabilization of `adt_const_params` does not have to resolve #120961 which is the only remaining "big" blocker for the feature. Remaining issues after this are a few ICEs and naming bikeshed for `ConstParamTy`.

### Implementation

The implementation is slightly subtle here as we would like to ensure that a stabilization of `adt_const_params` is forwards compatible with any outcome of `unsized_const_parameters`. This is inherently tricky as we do not support unstable trait implementations and we determine whether a type is valid as the type of a const parameter via a trait bound.

There are a few constraints here:
- We would like to *allow for the possibility* of adding a `Sized` supertrait to `ConstParamTy` in the event that we wind up opting to not support unsized types and instead requiring people to write the 'sized version', e.g. `const N: [u8; M]` instead of `const N: [u8]`.
- Crates should be able to enable `unsized_const_parameters` and write trait implementations of `ConstParamTy` for `!Sized` types without downstream crates that only enable `adt_const_params` being able to observe this (required for std to be able to `impl<T> ConstParamTy for [T]`

Ultimately the way this is accomplished is via having two traits (sad), `ConstParamTy` and `UnsizedConstParamTy`. Depending on whether `unsized_const_parameters` is enabled or not we change which trait is used to check whether a type is allowed to be a const parameter.

Long term (when stabilizing `UnsizedConstParamTy`) it should be possible to completely merge these traits (and derive macros), only having a single `trait ConstParamTy` and `macro ConstParamTy`.

Under `adt_const_params` it is now illegal to directly refer to `ConstParamTy` it is only used as an internal impl detail by `derive(ConstParamTy)` and checking const parameters are well formed. This is necessary in order to ensure forwards compatibility with all possible future directions for `feature(unsized_const_parameters)`.

Generally the intuition here should be that `ConstParamTy` is the stable trait that everything uses, and `UnsizedConstParamTy` is that plus unstable implementations (well, I suppose `ConstParamTy` isn't stable yet :P).
2024-07-21 05:36:21 +00:00
bors a62ac152ad Auto merge of #127715 - klensy:tests-w, r=Mark-Simulacrum
reenable some windows tests

Locally passing on `x86_64-pc-windows-msvc`, fingers crossed for `*-pc-windows-gnu`.

try-job: x86_64-msvc
try-job: x86_64-mingw
2024-07-21 03:06:32 +00:00
bors 2430c48b57 Auto merge of #128011 - matthiaskrgr:rollup-0vmf75y, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #127720 ([`macro_metavar_expr_concat`] Allow `concat` in repetitions)
 - #127734 (Windows: move BSD socket shims to netc)
 - #127752 (Ignore allocation bytes in one more mir-opt test)
 - #127839 (Fix git safe-directory path for docker images)
 - #127867 (Add `wasm32-wasip2` to `build-manifest` tool)
 - #127958 (Cleanup rmake.rs setup in compiletest)
 - #127975 (Fix trait bounds display)
 - #128005 (Remove _tls_used hack)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-07-21 00:39:36 +00:00
René Kijewski 95335444f7 rustdoc: short descr. cause word-breaks in tables
The `.item-table` class is used to display name+description lists, e.g.
the exported functions, as a table. If the names are long and the
descriptions are short, then the width of the table does not expand to
the whole size, but only uses a fraction. This causes a some names to
break inside a word.

This change makes the table always use 100% of its parent width. The
`.width-limiter` wrapper already ensures that the used width still does
not become excessive.

Signed-off-by: René Kijewski <rene.kijewski@fu-berlin.de>
2024-07-21 02:28:04 +02:00