Commit Graph

261817 Commits

Author SHA1 Message Date
Oli Scherer e426f262fd Split up `visit_path` so `MutVisitor` has a `path_segment` method just like the immutable visitor 2024-07-22 14:01:23 +00:00
Oli Scherer 545553ca4f Pass id and span to `visit_fn`, just like for the immutable visitor 2024-07-22 14:01:23 +00:00
Oli Scherer 1b9ac0011f Make function items in mut visitors all go through the same visit_fn function, just like with immutable visitors 2024-07-22 14:01:23 +00:00
Oli Scherer c064b363b9 Track visit_param_bound in mut visit just like in the immutable visitor 2024-07-22 14:01:23 +00:00
Oli Scherer 5241d8bb19 Merge impl and trait item mut visitor methods to mirror immut visitor 2024-07-22 14:01:23 +00: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
Guillaume Gomez 7de26684e8 Add regression test for items list size (#128023) 2024-07-22 11:33:03 +02: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
Michael Howell cd0fd6314d rustdoc: revert spacing change in item-table
It really wasn't necessary for the bug fix,
and could reasonably be considered a functional regression.
2024-07-21 23:21:49 -07: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
Michael Goulet efde1c065b Fix tools 2024-07-21 22:34:37 -04:00
Michael Goulet e9e9495f21 Fix tools 2024-07-21 22:34:37 -04:00
Michael Goulet 897c4d3adb Move all error reporting into rustc_trait_selection 2024-07-21 22:34:35 -04:00
Michael Goulet ce8a625092 Move all error reporting into rustc_trait_selection 2024-07-21 22:34:35 -04:00
Michael Goulet f49738ba6c Move need_type_info too 2024-07-21 22:33:15 -04:00
Michael Goulet 5accaf3af4 Make type_var_origin take a vid 2024-07-21 22:33:15 -04:00
Michael Goulet fc1e7ceb4b Move some stuff to TypeErrCtxt 2024-07-21 22:33:15 -04:00
Michael Goulet 6dfc9f8886 Explain that coroutine can be marked static
And also point out the def span of the coroutine
2024-07-21 22:32:29 -04:00
Michael Goulet 023b583f6a Reword E0626 to mention static coroutine 2024-07-21 22:32:29 -04: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 1807580a49 Auto merge of #12772 - phi-gamma:redundant-struct-recreation, r=y21
add lint for recreation of an entire struct

This lint makes Clippy warn about situations where an owned struct is
essentially recreated by moving all its fields into a new instance of
the struct. The lint is not machine-applicable because the source
struct may have been partially moved.

This lint originated in something I spotted during peer review. While
working on their branch a colleague ended up with a commit where a
function returned a struct that 1:1 replicated one of its owned inputs
from its members. Initially I suspected they hadn’t run their code
through Clippy but AFAICS there is no lint for this situation yet.

changelog: new lint: [`redundant_owned_struct_recreation`]

### New lint checklist

- \[+] Followed [lint naming conventions][lint_naming]
- \[+] Added passing UI tests (including committed `.stderr` file)
- \[+] `cargo test` passes locally
- \[+] Executed `cargo dev update_lints`
- \[+] Added lint documentation
- \[+] Run `cargo dev fmt`
2024-07-21 23:02:38 +00:00
bors 5f3d385421 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
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
Pavel Grigorenko b74f426e07 Fix some `#[cfg_attr(not(doc), repr(..))]`
Now that #90435 seems to have been resolved.
2024-07-22 01:10:06 +03: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