Commit graph

272757 commits

Author SHA1 Message Date
Guillaume Gomez
de16ed35a3 Correctly handle comments in attributes in doctests source code 2024-12-13 16:19:34 +01:00
bors
5a6036a180 Auto merge of #134137 - fmease:rollup-u1p7swx, r=fmease
Rollup of 9 pull requests

Successful merges:

 - #133583 (Fix type (exit → exist))
 - #134042 (Add the `power8-crypto` target feature)
 - #134094 (Tweak wording of non-const traits used as const bounds)
 - #134100 (Remove rustc_const_stable attribute on const NOOP)
 - #134103 (Don't ICE when encountering never in range pattern)
 - #134113 (run-make: Fix `assert_stderr_not_contains_regex`)
 - #134115 (rustc_target: ppc64 target string fixes for LLVM 20)
 - #134116 (stabilize const_nonnull_new)
 - #134120 (Remove Felix from ping groups and review rotation)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-11 05:31:46 +00:00
León Orell Valerian Liehr
e60f6cdd3d
Rollup merge of #134120 - oli-obk:push-vryonyoqmonv, r=oli-obk
Remove Felix from ping groups and review rotation
2024-12-10 20:16:07 +01:00
León Orell Valerian Liehr
e822dfc415
Rollup merge of #134116 - RalfJung:const_nonnull_new, r=jhpratt
stabilize const_nonnull_new

FCP passed in https://github.com/rust-lang/rust/issues/93235

Closes #93235
2024-12-10 20:16:06 +01:00
León Orell Valerian Liehr
6d17cb833d
Rollup merge of #134115 - durin42:ppc64-target-string, r=jieyouxu
rustc_target: ppc64 target string fixes for LLVM 20

LLVM continues to clean these up, and we continue to make this consistent. This is similar to 9caced7bad, e985396145, and
a10e744faf.

```@rustbot``` label: +llvm-main
2024-12-10 20:16:05 +01:00
León Orell Valerian Liehr
0b9e74af2e
Rollup merge of #134113 - jyn514:run-make-contains, r=jieyouxu
run-make: Fix `assert_stderr_not_contains_regex`

It asserted on **stdout**, not stderr.

r? ``@jieyouxu``
2024-12-10 20:16:04 +01:00
León Orell Valerian Liehr
c5a83862a2
Rollup merge of #134103 - compiler-errors:never-pat-range, r=oli-obk
Don't ICE when encountering never in range pattern

Fixes #133947

r? oli-obk
2024-12-10 20:16:04 +01:00
León Orell Valerian Liehr
f621be4ecc
Rollup merge of #134100 - eholk:noop-rustc-const-stable, r=dtolnay
Remove rustc_const_stable attribute on const NOOP

This was accidentally reintroduced while editing #133089.

r? dtolnay
2024-12-10 20:16:03 +01:00
León Orell Valerian Liehr
185440a375
Rollup merge of #134094 - estebank:const-trait-errors, r=compiler-errors
Tweak wording of non-const traits used as const bounds

Use verbose suggestions and add additional labels/notes.

r? ``@compiler-errors``
2024-12-10 20:16:02 +01:00
León Orell Valerian Liehr
0064e731a6
Rollup merge of #134042 - sayantn:power8-crypto, r=jieyouxu
Add the `power8-crypto` target feature

Add the `power8-crypto` target feature. This will enable adding some new PPC intrinsics in stdarch (specifically AES, SHA and CLMUL intrinsics). The implied target feature is from [here](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/PowerPC/PPC.td)

```@rustbot``` label A-target-feature O-PowerPC
2024-12-10 20:16:01 +01:00
León Orell Valerian Liehr
5bd9602e33
Rollup merge of #133583 - tbu-:pr_fix_typo2, r=compiler-errors
Fix type (exit → exist)
2024-12-10 20:16:00 +01:00
Oli Scherer
e1689e6807
Remove Felix from ping groups and review rotation 2024-12-10 17:06:45 +01:00
Tobias Bucher
bab1fcb30c Fix type (exit → exist) 2024-12-10 16:20:29 +01:00
bors
33c245b9e9 Auto merge of #134125 - fmease:rollup-u38o3ob, r=fmease
Rollup of 11 pull requests

Successful merges:

 - #133478 (jsondocck: Parse, don't validate commands.)
 - #133967 ([AIX] Pass -bnoipath when adding rust upstream dynamic crates)
 - #133970 ([AIX] Replace sa_sigaction with sa_union.__su_sigaction for AIX)
 - #133980 ([AIX] Remove option "-n" from AIX "ln" command)
 - #134008 (Make `Copy` unsafe to implement for ADTs with `unsafe` fields)
 - #134017 (Don't use `AsyncFnOnce::CallOnceFuture` bounds for signature deduction)
 - #134023 (handle cygwin environment in `install::sanitize_sh`)
 - #134041 (Use SourceMap to load debugger visualizer files)
 - #134065 (Move `write_graphviz_results`)
 - #134106 (Add compiler-maintainers who requested to be on review rotation)
 - #134123 (bootstrap: Forward cargo JSON output to stdout, not stderr)

Failed merges:

 - #134120 (Remove Felix from ping groups and review rotation)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-10 13:16:09 +00:00
León Orell Valerian Liehr
c42c248009
Rollup merge of #134123 - Zalathar:json-output, r=jieyouxu,clubby789
bootstrap: Forward cargo JSON output to stdout, not stderr

This fixes the RA errors I've been seeing on proc-macros after the re-landing of #134040.

r? clubby789
2024-12-10 13:51:14 +01:00
León Orell Valerian Liehr
0f1b827881
Rollup merge of #134106 - wesleywiser:update_compiler_review_queue_maintainers, r=jieyouxu
Add compiler-maintainers who requested to be on review rotation

r? ``@davidtwco``

cc ``@Noratrieb`` ``@SparrowLii``
2024-12-10 13:51:13 +01:00
León Orell Valerian Liehr
06107a20e3
Rollup merge of #134065 - nnethercote:mv-write_graphviz_results, r=tmiasko
Move `write_graphviz_results`

r? ``@tmiasko``
2024-12-10 13:51:12 +01:00
León Orell Valerian Liehr
599ff4d248
Rollup merge of #134041 - clubby789:debugvis-sourcemap, r=jieyouxu
Use SourceMap to load debugger visualizer files
2024-12-10 13:51:12 +01:00
León Orell Valerian Liehr
8e9953fc5c
Rollup merge of #134023 - onur-ozkan:132507, r=jieyouxu
handle cygwin environment in `install::sanitize_sh`

Resolves #132507
2024-12-10 13:51:11 +01:00
León Orell Valerian Liehr
193a95d30b
Rollup merge of #134017 - compiler-errors:call-once-deduction, r=jieyouxu
Don't use `AsyncFnOnce::CallOnceFuture` bounds for signature deduction

We shouldn't be using `AsyncFnOnce::CallOnceFuture` projection bounds to deduce anything about the return type of an async closure, **only** `AsyncFnOnce::Output`. This was accidental b/c all we were looking at was the def id of the trait, rather than the projection. This PR fixes that.

This doesn't affect stable code, since `CallOnceFuture` bounds cannot be written on stable.

Fixes #134015
2024-12-10 13:51:10 +01:00
León Orell Valerian Liehr
3eaa785daa
Rollup merge of #134008 - jswrenn:unsafe-fields-copy, r=compiler-errors
Make `Copy` unsafe to implement for ADTs with `unsafe` fields

As a rule, the application of `unsafe` to a declaration requires that use-sites of that declaration also entail `unsafe`. For example, a field declared `unsafe` may only be read in the lexical context of an `unsafe` block.

For nearly all safe traits, the safety obligations of fields are explicitly discharged when they are mentioned in method definitions. For example, idiomatically implementing `Clone` (a safe trait) for a type with unsafe fields will require `unsafe` to clone those fields.

Prior to this commit, `Copy` violated this rule. The trait is marked safe, and although it has no explicit methods, its implementation permits reads of `Self`.

This commit resolves this by making `Copy` conditionally safe to implement. It remains safe to implement for ADTs without unsafe fields, but unsafe to implement for ADTs with unsafe fields.

Tracking: #132922

r? ```@compiler-errors```
2024-12-10 13:51:10 +01:00
León Orell Valerian Liehr
ceaca6be47
Rollup merge of #133980 - xingxue-ibm:ln-option-aix, r=jieyouxu
[AIX] Remove option "-n" from AIX "ln" command

The option `-n` for the AIX `ln` command has a different purpose than it does on Linux. On Linux, the `-n` option is used to treat the destination path as normal file if it is a symbolic link to a directory, which is the default behavior of the AIX `ln` command.
2024-12-10 13:51:09 +01:00
León Orell Valerian Liehr
0ff8ee6d7e
Rollup merge of #133970 - xingxue-ibm:sigaction, r=nnethercote
[AIX] Replace sa_sigaction with sa_union.__su_sigaction for AIX

On AIX, the `sa_sigaction` member of `struct sigaction` is accessed as the union member `sa_union.__su_sigaction`.
2024-12-10 13:51:08 +01:00
León Orell Valerian Liehr
7459a4fdf1
Rollup merge of #133967 - daltenty:daltenty/bnoipath, r=jieyouxu
[AIX] Pass -bnoipath when adding rust upstream dynamic crates

Unlike ELF linkers, AIX doesn't feature `DT_SONAME` to override
the dependency name when outputing a shared library, which is something
we rely on for dylib crates.

See for reference:
bc145cec45/compiler/rustc_codegen_ssa/src/back/linker.rs (L464))

Thus, `ld` on AIX will use the full path to shared libraries as the dependency if passed it
by default unless `noipath` is passed, so pass it here so we don't end up with full path dependencies
for dylib crates.
2024-12-10 13:51:08 +01:00
León Orell Valerian Liehr
54165018af
Rollup merge of #133478 - aDotInTheVoid:finally, r=fmease
jsondocck: Parse, don't validate commands.

Centralizes knowledge of jsondocck syntax into the parser, so the checker doesn't need to know what the indexes are.

[Vaguely related zulip discussion](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/jsondocck.20rewrite)

I'm very happy this is negative LoC, despite adding a big, documented enum!

r? ``@fmease``
2024-12-10 13:51:07 +01:00
Zalathar
604ba9214d bootstrap: Forward cargo JSON output to stout, not stderr 2024-12-10 23:09:00 +11:00
Augie Fackler
0680155a17 rustc_target: ppc64 target string fixes for LLVM 20
LLVM continues to clean these up, and we continue to make this
consistent. This is similar to 9caced7bad,
e985396145, and
a10e744faf.

`@rustbot` label: +llvm-main
2024-12-10 05:54:08 -05:00
Ralf Jung
a8d11ea20e stabilize const_nonnull_new 2024-12-10 11:29:01 +01:00
bors
4996052717 Auto merge of #134108 - fmease:rollup-tbtwm6j, r=fmease
Rollup of 10 pull requests

Successful merges:

 - #131558 (Lint on combining `#[no_mangle]` and `#[export_name]`)
 - #133184 (wasi/fs: Improve stopping condition for <ReadDir as Iterator>::next)
 - #133456 (Add licenses + Run `cargo update`)
 - #133472 (Run TLS destructors for wasm32-wasip1-threads)
 - #133853 (use vendor sources by default on dist tarballs)
 - #133946 (coverage: Prefer to visit nodes whose predecessors have been visited)
 - #134010 (fix ICE on type error in promoted)
 - #134029 (coverage: Use a query to find counters/expressions that must be zero)
 - #134071 (Configure renovatebot)
 - #134102 (Miscellaneous fixes for nix-dev-shell)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-10 10:25:38 +00:00
jyn
9a6deba8af run-make: Fix assert_stderr_not_contains_regex
It asserted on **stdout**, not stderr.
2024-12-10 04:35:20 -05:00
León Orell Valerian Liehr
8434a6e2bb
Rollup merge of #134102 - WaffleLapkin:nix-dev-shell-fixups-2024-12-10, r=Noratrieb
Miscellaneous fixes for nix-dev-shell

this makes it so files in `src/nix-dev-shell` are *not* ignored, as they
should not be. note that `flake.lock` is still ignored globally.

r? `@Noratrieb`

See individual commits for more info.

cc #131176 (it added gitignore entries I'm changing).
2024-12-10 08:56:01 +01:00
León Orell Valerian Liehr
79a824cdeb
Rollup merge of #134071 - Kobzol:ci-renovatebot, r=MarcoIeni
Configure renovatebot

This PR adds a basic Renovatebot configuration. We would mostly like to use the bot for updating lockfiles. First, I want to try out if the built-in lockFileMaintenance will work for that. I'm a bit skeptical, because it is not very configurable, but it's worth a try. I set the schedule for Tuesday, so that we can test what happens tomorrow.

I also enabled the dependency dashboard, as I think it could be useful for us, to see a global state of our dependencies.

r? ```@MarcoIeni```
2024-12-10 08:56:00 +01:00
León Orell Valerian Liehr
bb8a20678c
Rollup merge of #134029 - Zalathar:zero, r=oli-obk
coverage: Use a query to find counters/expressions that must be zero

As of #133446, this query (`coverage_ids_info`) determines which counter/expression IDs are unused. So with only a little extra work, we can take the code that was using that information to determine which coverage counters/expressions must be zero, and move that inside the query as well.

There should be no change in compiler output.
2024-12-10 08:55:59 +01:00
León Orell Valerian Liehr
4d544d9443
Rollup merge of #134010 - RalfJung:promoted-type-error-ice, r=oli-obk
fix ICE on type error in promoted

Fixes https://github.com/rust-lang/rust/issues/133968

Ensure that when we turn a type error into a "this promoted failed to evaluate" error, we do record this as something that may happen even in "infallible" promoteds.
2024-12-10 08:55:59 +01:00
León Orell Valerian Liehr
b493369df8
Rollup merge of #133946 - Zalathar:ready-first, r=oli-obk
coverage: Prefer to visit nodes whose predecessors have been visited

In coverage instrumentation, we need to traverse the control-flow graph and decide what kind of counter (physical counter or counter-expression) should be used for each node that needs a counter.

The existing traversal order is complex and hard to tweak. This new traversal order tries to be a bit more principled, by always preferring to visit nodes whose predecessors have already been visited, which is a good match for how the counter-creation code ends up dealing with a node's in-edges and out-edges.

For several of the coverage tests, this ends up being a strict improvement in reducing the size of the coverage metadata, and also reducing the number of physical counters needed.

(The new traversal should hopefully also allow some further code simplifications in the future.)

---

This is made possible by the separate simplification pass introduced by #133849. Without that, almost any change to the traversal order ends up increasing the size of the expression table or the number of physical counters.
2024-12-10 08:55:58 +01:00
León Orell Valerian Liehr
ea64a5d811
Rollup merge of #133853 - onur-ozkan:use-vendor-directory-on-dist-build, r=Kobzol
use vendor sources by default on dist tarballs

Tarball sources are distributed with vendor sources along with the `.cargo/config.toml` file configured for vendor sources. This means we can use vendor sources by default unless explicitly disabled with `build.vendor=false` by the user. So, let's do that.
2024-12-10 08:55:57 +01:00
León Orell Valerian Liehr
ce8d241396
Rollup merge of #133472 - rust-wasi-web:master, r=joboet
Run TLS destructors for wasm32-wasip1-threads

The target wasm32-wasip1-threads has support for pthreads and allows registration of TLS destructors.

For spawned threads, this registers Rust TLS destructors by creating a pthreads key with an attached destructor function.
For the main thread, this registers an `atexit` handler to run the TLS destructors.

try-job: test-various
2024-12-10 08:55:57 +01:00
León Orell Valerian Liehr
b1122b5054
Rollup merge of #133456 - clubby789:cargo-update, r=ChrisDenton
Add licenses + Run `cargo update`

Replaces #131311

try-job: dist-x86_64-linux

License changes:
- `unicode_ident` 1.0.14 introduces `(MIT OR Apache-2.0) AND Unicode-3.0`, but `unicode_ident` 1.0.12 (`(MIT OR Apache-2.0) AND Unicode-DFS-2016`) is still in tree
- `instant` and its license exception are no longer used
```
compiler & tools dependencies:
    Updating allocator-api2 v0.2.18 -> v0.2.20
    Updating anyhow v1.0.92 -> v1.0.93
    Removing bitflags v1.3.2
    Updating blake3 v1.5.4 -> v1.5.5
    Updating bstr v1.10.0 -> v1.11.0
    Updating bytes v1.8.0 -> v1.9.0
    Updating cargo-platform v0.1.8 -> v0.1.9
    Updating cc v1.2.0 -> v1.2.2
    Updating clap v4.5.20 -> v4.5.21
    Updating clap_builder v4.5.20 -> v4.5.21
    Updating clap_complete v4.5.36 -> v4.5.38
    Updating clap_lex v0.7.2 -> v0.7.3
    Updating color-print v0.3.6 -> v0.3.7
    Updating color-print-proc-macro v0.3.6 -> v0.3.7
    Updating cpufeatures v0.2.14 -> v0.2.16
    Updating curl-sys v0.4.77+curl-8.10.1 -> v0.4.78+curl-8.11.0
    Updating errno v0.3.9 -> v0.3.10
    Updating fastrand v2.1.1 -> v2.2.0
    Updating flate2 v1.0.34 -> v1.0.35
    Updating handlebars v5.1.2 -> v6.2.0
      Adding icu_collections v1.5.0
      Adding icu_normalizer v1.5.0
      Adding icu_normalizer_data v1.5.0
      Adding icu_properties v1.5.1
      Adding icu_properties_data v1.5.0
    Updating idna v0.5.0 -> v1.0.3
      Adding idna_adapter v1.2.0
    Updating indexmap v2.6.0 -> v2.7.0
    Updating indicatif v0.17.8 -> v0.17.9
    Removing instant v0.1.13
    Updating itoa v1.0.11 -> v1.0.14
    Updating js-sys v0.3.72 -> v0.3.74
    Updating libc v0.2.164 -> v0.2.167
    Updating libloading v0.8.5 -> v0.8.6
    Updating litemap v0.7.3 -> v0.7.4
    Updating mdbook v0.4.40 -> v0.4.43
      Adding num-modular v0.6.1
      Adding num-order v1.2.0
    Updating pathdiff v0.2.2 -> v0.2.3
    Updating portable-atomic v1.9.0 -> v1.10.0
    Updating proc-macro2 v1.0.89 -> v1.0.92
    Updating regex-automata v0.4.8 -> v0.4.9
    Updating rustc-hash v2.0.0 -> v2.1.0
    Updating rustc_apfloat v0.2.1+llvm-462a31f5a5ab -> v0.2.2+llvm-462a31f5a5ab
    Updating rustix v0.38.38 -> v0.38.41
    Updating schannel v0.1.26 -> v0.1.27
    Updating serde v1.0.214 -> v1.0.215
    Updating serde_derive v1.0.214 -> v1.0.215
    Updating serde_json v1.0.132 -> v1.0.133
    Updating socket2 v0.5.7 -> v0.5.8
    Updating spdx v0.10.6 -> v0.10.7
    Updating syn v2.0.87 -> v2.0.90
    Updating tempfile v3.13.0 -> v3.14.0
    Updating terminal_size v0.4.0 -> v0.4.1
    Updating thiserror v1.0.66 -> v1.0.69 (available: v2.0.3)
    Updating thiserror-impl v1.0.66 -> v1.0.69
    Updating tokio v1.41.0 -> v1.41.1
    Updating tracing-attributes v0.1.27 -> v0.1.28
    Updating tracing-error v0.2.0 -> v0.2.1
    Removing unicode-bidi v0.3.17
    Updating unicode-ident v1.0.13 -> v1.0.14
    Updating url v2.5.2 -> v2.5.4
      Adding utf16_iter v1.0.5
      Adding utf8_iter v1.0.4
     Updating wasm-bindgen v0.2.95 -> v0.2.97
    Updating wasm-bindgen-backend v0.2.95 -> v0.2.97
    Updating wasm-bindgen-macro v0.2.95 -> v0.2.97
    Updating wasm-bindgen-macro-support v0.2.95 -> v0.2.97
    Updating wasm-bindgen-shared v0.2.95 -> v0.2.97
    Updating wasm-encoder v0.220.0 -> v0.221.0
      Adding wasmparser v0.221.0
    Updating wast v219.0.1 -> v221.0.0
    Updating wat v1.219.1 -> v1.221.0
      Adding web-time v1.1.0
      Adding write16 v1.0.0
    Updating yoke v0.7.4 -> v0.7.5
    Updating yoke-derive v0.7.4 -> v0.7.5
    Updating zerofrom v0.1.4 -> v0.1.5
    Updating zerofrom-derive v0.1.4 -> v0.1.5

library dependencies:
    Updating allocator-api2 v0.2.18 -> v0.2.20
    Updating cc v1.2.0 -> v1.2.2
    Updating libc v0.2.162 -> v0.2.164
    Updating unwinding v0.2.3 -> v0.2.4

rustbook dependencies:
    Updating anstream v0.6.17 -> v0.6.18
    Updating anyhow v1.0.92 -> v1.0.93
    Updating bstr v1.10.0 -> v1.11.0
    Updating cc v1.2.0 -> v1.2.2
    Updating clap v4.5.20 -> v4.5.21
    Updating clap_builder v4.5.20 -> v4.5.21
    Updating clap_complete v4.5.36 -> v4.5.38
    Updating clap_lex v0.7.2 -> v0.7.3
    Updating cpufeatures v0.2.14 -> v0.2.16
      Adding displaydoc v0.2.5
    Updating errno v0.3.9 -> v0.3.10
    Updating fastrand v2.1.1 -> v2.2.0
    Updating flate2 v1.0.34 -> v1.0.35
    Updating hashbrown v0.15.0 -> v0.15.2
      Adding icu_collections v1.5.0
      Adding icu_locid v1.5.0
      Adding icu_locid_transform v1.5.0
      Adding icu_locid_transform_data v1.5.0
      Adding icu_normalizer v1.5.0
      Adding icu_normalizer_data v1.5.0
      Adding icu_properties v1.5.1
      Adding icu_properties_data v1.5.0
      Adding icu_provider v1.5.0
      Adding icu_provider_macros v1.5.0
    Updating idna v0.5.0 -> v1.0.3
      Adding idna_adapter v1.2.0
    Updating indexmap v2.6.0 -> v2.7.0
    Updating itoa v1.0.11 -> v1.0.14
    Updating js-sys v0.3.72 -> v0.3.74
    Updating libc v0.2.161 -> v0.2.167
      Adding litemap v0.7.4
    Updating mdbook v0.4.42 -> v0.4.43
    Updating pathdiff v0.2.2 -> v0.2.3
    Updating proc-macro2 v1.0.89 -> v1.0.92
    Updating regex-automata v0.4.8 -> v0.4.9
    Updating rustix v0.38.38 -> v0.38.41
    Updating serde v1.0.214 -> v1.0.215
    Updating serde_derive v1.0.214 -> v1.0.215
    Updating serde_json v1.0.132 -> v1.0.133
      Adding stable_deref_trait v1.2.0
    Updating syn v2.0.87 -> v2.0.90
      Adding synstructure v0.13.1
    Updating tempfile v3.13.0 -> v3.14.0
    Updating terminal_size v0.4.0 -> v0.4.1
    Updating thiserror v1.0.66 -> v1.0.69
    Updating thiserror-impl v1.0.66 -> v1.0.69
      Adding tinystr v0.7.6
    Removing tinyvec v1.8.0
    Removing tinyvec_macros v0.1.1
    Removing unicode-bidi v0.3.17
    Updating unicode-ident v1.0.13 -> v1.0.14
    Removing unicode-normalization v0.1.24
    Updating url v2.5.2 -> v2.5.4
      Adding utf16_iter v1.0.5
      Adding utf8_iter v1.0.4
    Updating wasm-bindgen v0.2.95 -> v0.2.97
    Updating wasm-bindgen-backend v0.2.95 -> v0.2.97
    Updating wasm-bindgen-macro v0.2.95 -> v0.2.97
    Updating wasm-bindgen-macro-support v0.2.95 -> v0.2.97
    Updating wasm-bindgen-shared v0.2.95 -> v0.2.97
      Adding write16 v1.0.0
      Adding writeable v0.5.5
      Adding yoke v0.7.5
      Adding yoke-derive v0.7.5
      Adding zerofrom v0.1.5
      Adding zerofrom-derive v0.1.5
      Adding zerovec v0.10.4
      Adding zerovec-derive v0.10.3
```
2024-12-10 08:55:56 +01:00
León Orell Valerian Liehr
783362ddf9
Rollup merge of #133184 - osiewicz:wasm-fix-infinite-loop-in-remove-dir-all, r=Noratrieb
wasi/fs: Improve stopping condition for <ReadDir as Iterator>::next

When upgrading [Zed](https://github.com/zed-industries/zed/pull/19349) to Rust 1.82 I've encountered a test failure in our test suite. Specifically, one of our extension tests started hanging. I've tracked it down to a call to std::fs::remove_dir_all not returning when an extension is compiled with Rust 1.82 Our extension system uses WASM components, thus I've looked at the diff between 1.81 and 1.82 with respect to WASI and found 736f773844

As it turned out, calling remove_dir_all from extension returned io::ErrorKind::NotFound in 1.81; the underlying issue is that the ReadDir iterator never actually terminates iteration, however since it loops around, with 1.81 we'd come across an entry second time and fail to remove it, since it would've been removed previously. With 1.82 and 736f773844 it is no longer the case, thus we're seeing the hang. The tests do pass when everything but the extensions is compiled with 1.82.

This commit makes ReadDir::next adhere to readdir contract, namely it will no longer call readdir once the returned # of bytes is smaller than the size of a passed-in buffer. Previously we'd only terminate the loop if readdir returned 0.
2024-12-10 08:55:55 +01:00
León Orell Valerian Liehr
94d780d647
Rollup merge of #131558 - sassman:feat/warnin-for-no-mangle-together-with-export-name, r=Urgau
Lint on combining `#[no_mangle]` and `#[export_name]`

This is my very first contribution to the compiler, even though I read the [chapter about lints](https://rustc-dev-guide.rust-lang.org/diagnostics.html) I'm not very certain that this ~~new lint is done right as a builtin lint~~ PR is right. I appreciate any guidance on how to improve the code.

- Add test for issue #47446
- ~~Implement the new lint `mixed_export_name_and_no_mangle` as a builtin lint (not sure if that is the right way to go)~~ Extend `unused_attributes` lint
- Add suggestion how to fix it

<details>

<summary>Old proposed new lint</summary>

> The `mixed_export_name_and_no_mangle` lint detects usage of both `#[export_name]` and `#[no_mangle]` on the same item which results on `#[no_mangle]` being ignored.
>
> *warn-by-default*
>
> ### Example
>
> ```rust
> #[no_mangle] // ignored
> #[export_name = "foo"] // takes precedences
> pub fn bar() {}
> ```
>
> ### Explanation
>
> The compiler will not respect the `#[no_mangle]` attribute when generating the symbol name for the function, as the `#[export_name]` attribute takes precedence. This can lead to confusion and is unnecessary.

</details>
2024-12-10 08:55:54 +01:00
bors
b597d2a099 Auto merge of #133902 - Kobzol:ci-dist-arm-runner, r=MarcoIeni
CI: move `dist-arm-linux` to an ARM runner

First, I want to test whether we could actually move this to a free runner, vs moving to the 8-core ARM runner.

Fixes: https://github.com/rust-lang/infra-team/issues/181

r? `@MarcoIeni`

try-job: dist-arm-linux
2024-12-10 07:44:46 +00:00
bors
ff7906bfe1 Auto merge of #134096 - fmease:rollup-0asgoo8, r=fmease
Rollup of 9 pull requests

Successful merges:

 - #133996 (Move most tests for `-l` and `#[link(..)]` into `tests/ui/link-native-libs`)
 - #134012 (Grammar fixes)
 - #134032 (docs: better examples for `std::ops::ControlFlow`)
 - #134040 (bootstrap: print{ln}! -> eprint{ln}! (take 2))
 - #134043 (Add test to check unicode identifier version)
 - #134053 (rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 10))
 - #134055 (interpret: clean up deduplicating allocation functions)
 - #134073 (dataflow_const_prop: do not eval a ptr address in SwitchInt)
 - #134084 (Fix typo in RFC mention 3598 -> 3593)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-10 03:48:20 +00:00
Wesley Wiser
88c8b1056d Add compiler-maintainers who requested to be on review rotation 2024-12-09 20:47:44 -06:00
Michael Goulet
6e2e9f676c Don't ICE when encountering never in pattern 2024-12-10 01:08:18 +00:00
Esteban Küber
4007fc9a0f Tweak wording of non-const traits used as const bounds
Use verbose suggestions and add additional labels/notes.

Add more test cases for stable/nightly and feature enabled/disabled.
2024-12-10 00:38:05 +00:00
bors
974ccc12e6 Auto merge of #129514 - estebank:default-field-values, r=compiler-errors
Introduce `default_field_values` feature

Initial implementation of `#[feature(default_field_values]`, proposed in https://github.com/rust-lang/rfcs/pull/3681.

We now parse const expressions after a `=` in a field definition, to specify a `struct` field default value.

We now allow `Struct { field, .. }` where there's no base after `..`.

`#[derive(Default)]` now uses the default value if present, continuing to use `Default::default()` if not.

```rust
#[derive(Debug)]
pub struct S;

#[derive(Debug, Default)]
pub struct Foo {
    pub bar: S = S,
    pub baz: i32 = 42 + 3,
}

fn main () {
    let x = Foo { .. };
    let y = Foo::default();
    let z = Foo { baz: 1, .. };

    assert_eq!(45, x.baz);
    assert_eq!(45, y.baz);
    assert_eq!(1, z.baz);
}
```
2024-12-10 00:07:00 +00:00
Waffle Lapkin
05d83185c3
provide libz.so.1 in the nix-dev-shell
`libz.so.1` is needed for some (?) things...

i personally found myself in need of it when running `x t linkchecker`,
which failed when running cargo build script or something.

although there are also mentions of rustc itself needing it:
<https://github.com/NixOS/nixpkgs/issues/92946>
2024-12-10 00:24:21 +01:00
Waffle Lapkin
6058cdcccc
remove instructions to git exclude files in src/nix-dev-shell/envrc-*
this is no longer needed as `.gitignore` contains both `/.envrc` and
`flake.lock` (and also `/.direnv/`)
2024-12-10 00:11:27 +01:00
Eric Holk
b9afc78585
Remove rustc_const_stable attribute on const NOOP
This was accidentally reintroduced while editing #133089.
2024-12-09 15:08:30 -08:00
Waffle Lapkin
5f99e96fbb
only ignore {flake,default}.nix and {.envrc,.direnv/} in the root
this makes it so files in `src/nix-dev-shell` are *not* ignored, as they
should not be. note that `flake.lock` is still ignored globally.
2024-12-10 00:08:26 +01:00