Commit Graph

269144 Commits

Author SHA1 Message Date
Frank Rehwinkel
4560606602 epoll: change clock to be per event 2024-10-09 12:26:22 -04:00
bors
8e8dd57ac2 Auto merge of #3953 - YohDeadfall:glibc-thread-name, r=RalfJung
Fixed pthread_getname_np impl for glibc

The behavior of `glibc` differs a bit different for `pthread_getname_np` from other implementations. It requires the buffer to be at least 16 bytes wide without exception.

[Docs](https://www.man7.org/linux/man-pages/man3/pthread_setname_np.3.html):

```
The pthread_getname_np() function can be used to retrieve the
name of the thread.  The thread argument specifies the thread
whose name is to be retrieved.  The buffer name is used to return
the thread name; size specifies the number of bytes available in
name.  The buffer specified by name should be at least 16
characters in length.  The returned thread name in the output
buffer will be null terminated.
```

[Source](https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_getname.c;hb=dff8da6b3e89b986bb7f6b1ec18cf65d5972e307#l37):

```c
int
__pthread_getname_np (pthread_t th, char *buf, size_t len)
{
  const struct pthread *pd = (const struct pthread *) th;

  /* Unfortunately the kernel headers do not export the TASK_COMM_LEN
     macro.  So we have to define it here.  */
#define TASK_COMM_LEN 16
  if (len < TASK_COMM_LEN)
    return ERANGE;
```
2024-10-09 15:56:10 +00:00
Yoh Deadfall
f64c9c6416 Fixed pthread_getname_np impl for glibc 2024-10-09 18:47:14 +03:00
bors
3e42fc5596 Auto merge of #18247 - jhgg:lsp/fix-something-to-resolve, r=Veykril
lsp: fix completion_item something_to_resolve not being a latch to true

while looking at #18245 i noticed that `something_to_resolve` could technically flap between true -> false if some subsequent fields that were requested to be resolved were empty.

this fixes that by using `|=` instead of `=` when assigning to `something_to_resolve` which will prevent it from going back to false once set.

although some cases it's simply assigning to `true` i opted to continue to use `|=` there for uniformity sake. but happy to change those back to `=`'s.

cc `@SomeoneToIgnore`
2024-10-09 15:35:33 +00:00
bors
bd1c7e99d6 Auto merge of #18246 - ChayimFriedman2:fix-18238, r=Veykril
fix: Fix `prettify_macro_expansion()` when the node isn't the whole file

Fixes #18238.
2024-10-09 15:20:47 +00:00
Ralf Jung
7a9a9cba3f epoll: rename blocking_epoll_callback since it is not just called after unblocking 2024-10-09 16:20:39 +02:00
Matthias Krüger
6774856e0c add more crash tests 2024-10-09 15:34:45 +02:00
Eric Huss
de60931645 Add "reference" as a known compiletest header
This adds the "reference" compiletest header so that the Rust reference
can add annotations to the test suite in order to link tests to
individual rules in the reference.

Tooling in the reference repo will be responsible for collecting these
annotations and linking to the tests.

More details are in MCP 783: https://github.com/rust-lang/compiler-team/issues/783
2024-10-09 06:01:25 -07:00
Nicola Krumschmidt
01e248ff97
Decouple WASIp2 sockets from WasiFd 2024-10-09 14:39:28 +02:00
bors
87058a4990 Auto merge of #3955 - RalfJung:review-bot, r=RalfJung
CONTRIBUTING.md: explain the review bot use
2024-10-09 12:21:58 +00:00
bors
a1eceec00b Auto merge of #131429 - Zalathar:needs-profiler-runtime, r=jieyouxu
Rename directive `needs-profiler-support` to `needs-profiler-runtime`

The rest of the compiler mostly refers to this as `profiler_runtime`, so having a directive named `needs-profiler-support` was causing a lot of confusion.

r? jieyouxu
2024-10-09 12:20:11 +00:00
Ralf Jung
f90c97c915 explain the review bot use 2024-10-09 14:20:02 +02:00
许杰友 Jieyou Xu (Joe)
becf664e49 Match std RUSTFLAGS for host and target for mir-opt test 2024-10-09 18:52:28 +08:00
Zalathar
7a0e8bd1fd No need to cache the profiler_runtime flag
This cache struct entry was a relic from when profiler availability was
communicated via an environment variable rather than a command-line flag.
2024-10-09 20:58:27 +11:00
Zalathar
8320a0116b Rename profiler_support to profiler_runtime throughout compiletest 2024-10-09 20:58:27 +11:00
Zalathar
622d5898c2 Rename directive needs-profiler-support to needs-profiler-runtime 2024-10-09 20:58:27 +11:00
ultrabear
461b49d96d
stabilize {slice,array}::from_mut 2024-10-09 00:38:01 -07:00
bors
64f510cc3d Auto merge of #18269 - jhgg:hir-ty/change-struct-constructor-formatting, r=flodiebold
hir-ty: change struct + enum variant constructor formatting.

before, when formatting struct constructor for `struct S(usize, usize)` it would format as:

    extern "rust-call" S(usize, usize) -> S

but after this change, we'll format as:

    fn S(usize, usize) -> S

likewise the second commit, also makes this uniform for enum variants as well.

fixes #18259
2024-10-09 07:09:06 +00:00
许杰友 Jieyou Xu (Joe)
fe87487b36 Ignore broken-pipe-no-ice on apple for now 2024-10-09 05:34:49 +00:00
bors
4203c68613 Auto merge of #131434 - onur-ozkan:fix-if-unchanged-test, r=onur-ozkan
fix `ci_rustc_if_unchanged_logic` test

Kind a typo from https://github.com/rust-lang/rust/pull/122709, which makes `ci_rustc_if_unchanged_logic` test to fail in any PR that has a change in "library" tree (e.g., https://github.com/rust-lang/rust/pull/131418#issuecomment-2400878904). This fixes that.

r? ghost
2024-10-09 05:31:49 +00:00
onur-ozkan
4474018500 fix ci_rustc_if_unchanged_logic test
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-09 07:45:48 +03:00
Yuri Astrakhan
a278f15724 Update library/std/src/sys/pal/unix/process/process_vxworks.rs
Co-authored-by: Josh Stone <cuviper@gmail.com>
2024-10-08 23:26:30 -04:00
Yuri Astrakhan
442d766cc1 fix ref in process_vxworks.rs 2024-10-08 23:26:30 -04:00
Yuri Astrakhan
d2f93c9707 Update library/std/src/sys/pal/unix/process/process_unix.rs
Co-authored-by: Josh Stone <cuviper@gmail.com>
2024-10-08 23:26:30 -04:00
Yuri Astrakhan
f2d1edfea5 Change a few &Option<T> into Option<&T> 2024-10-08 23:26:29 -04:00
bors
883f9a2c8f Auto merge of #131421 - weihanglo:update-cargo, r=weihanglo
Update cargo

8 commits in ad074abe3a18ce8444c06f962ceecfd056acfc73..15fbd2f607d4defc87053b8b76bf5038f2483cf4
2024-10-04 18:18:15 +0000 to 2024-10-08 21:08:11 +0000
- initial version of checksum based freshness (rust-lang/cargo#14137)
- feat: Add custom completer for completing registry name (rust-lang/cargo#14656)
- Document build-plan as being deprecated (rust-lang/cargo#14657)
- fix(complete): Don't complete files for any value (rust-lang/cargo#14653)
- Add more SAT resolver tests (rust-lang/cargo#14614)
- fix: avoid inserting duplicate `dylib_path_envvar` when calling `cargo run` recursively (rust-lang/cargo#14464)
- chore(deps): bump gix-path from 0.10.9 to 0.10.11 (rust-lang/cargo#14489)
- improve error reporting when feature not found in `activated_features` (rust-lang/cargo#14647)

---

This also adds three license exceptions to Cargo.

* arrayref — BSD-2-Clause
* blake3 — CC0-1.0 OR Apache-2.0 OR Apache-2.0 WITH LLVM-exception
* constant_time_eq — CC0-1.0 OR MIT-0 OR Apache-2.0

These exceptions were added to rustc in rust-lang/rust#126930, so should be fine for Cargo as well.
2024-10-09 01:56:43 +00:00
Frank Rehwinkel
6f854ce343 epoll: test case showing too much clock sync 2024-10-08 21:35:46 -04:00
bors
1f8f982f22 Auto merge of #13504 - samueltardieu:needless-raw-strings, r=Alexendoo
Check for needless raw strings in `format_args!()` template as well

changelog: [`needless_raw_strings`, `needless_raw_string_hashes`]: check `format_args!()` template as well

Fix #13503
2024-10-09 01:35:08 +00:00
Josh Stone
af5a704548 Fix quotation marks around debug line in src/ci/run.sh
Without this change, the markdown-style backticks are treated as a shell
command substitution, which fails like so:

    /checkout/src/ci/run.sh: line 58: DISABLE_CI_RUSTC_IF_INCOMPATIBLE: command not found
    debug:  configured.
2024-10-08 18:31:44 -07:00
Jubilee Young
43e198a3ae compiler: Seal off the rustc_target::abi enum glob imports 2024-10-08 18:24:56 -07:00
Jubilee Young
d92aee556d cg_gcc: Factor out rustc_target::abi 2024-10-08 18:24:56 -07:00
Jubilee Young
b3beb4efc7 cg_clif: Factor out rustc_target::abi 2024-10-08 18:24:56 -07:00
Jubilee Young
1379ef592a compiler: Factor rustc_target::abi out of cg_llvm 2024-10-08 18:24:56 -07:00
Jubilee Young
839cf1c1a4 compiler: Factor rustc_target::abi out of cg_ssa 2024-10-08 18:24:56 -07:00
Jubilee Young
ff17ce2f6a compiler: Factor rustc_target::abi out of hir_typeck 2024-10-08 18:24:56 -07:00
Jubilee Young
9d95c8bd16 compiler: Factor rustc_target::abi out of const_eval 2024-10-08 18:24:56 -07:00
Jubilee Young
11c48bee11 compiler: Factor rustc_target::abi::* out of ty_utils 2024-10-08 18:24:38 -07:00
Jubilee Young
8da92b5ce2 compiler: Factor rustc_target::abi::* out of middle::ty::layout 2024-10-08 18:14:48 -07:00
Peter Jaszkowiak
321a5db7d4 Reserve guarded string literals (RFC 3593) 2024-10-08 18:21:16 -06:00
Weihang Lo
7018a99172
Update cargo
This also adds three license exceptions to Cargo.

* arrayref — BSD-2-Clause
* blake3 — CC0-1.0 OR Apache-2.0 OR Apache-2.0 WITH LLVM-exception
* constant_time_eq — CC0-1.0 OR MIT-0 OR Apache-2.0

These exceptions were added to rustc in rust-lang/rust#126930,
so should be fine for Cargo as well.
2024-10-08 20:16:04 -04:00
bors
18deb53874 Auto merge of #131155 - jieyouxu:always-kill, r=onur-ozkan
Prevent building cargo from invalidating build cache of other tools due to conditionally applied `-Zon-broken-pipe=kill` via tracked `RUSTFLAGS`

This PR fixes #130980 where building cargo invalidated the tool build caches of other tools (such as rustdoc) because `-Zon-broken-pipe=kill` was conditionally passed via `RUSTFLAGS` for other tools *except* for cargo. The differing `RUSTFLAGS` triggered tool build cache invalidation as `RUSTFLAGS` is a tracked env var -- any changes in `RUSTFLAGS` requires a rebuild.

`-Zon-broken-pipe=kill` is load-bearing for rustc and rustdoc to not ICE on broken pipes due to usages of raw std `println!` that panics without the flag being set, which manifests in ICEs.

I can't say I like the changes here, but it is what it is...

See detailed discussions and history of `-Zon-broken-pipe=kill` usage in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Internal.20lint.20for.20raw.20.60print!.60.20and.20.60println!.60.3F/near/474593815.

## Approach

This PR fixes the tool build cache invalidation by informing the `rustc` binary shim when to apply `-Zon-broken-pipe=kill` (i.e. when the rustc binary shim is not used to build cargo). This information is not communicated by `RUSTFLAGS`, which is an env var tracked by cargo, and instead uses an untracked env var `UNTRACKED_BROKEN_PIPE_FLAG` so we won't trigger tool build cache invalidation. We preserve bootstrap's behavior of not setting that flag for cargo by conditionally omitting setting `UNTRACKED_BROKEN_PIPE_FLAG` when building cargo.

Notably, the `-Zon-broken-pipe=kill` instance in 1e5719bdc4/src/bootstrap/src/core/build_steps/compile.rs (L1058) is not modified because that is used to build rustc only and not cargo itself.

Thanks to `@cuviper` for the idea!

## Testing

### Integration testing

This PR introduces a run-make test for rustc and rustdoc that checks that when they do not ICE/panic when they encounter a broken pipe of the stdout stream.

I checked this test will catch the broken pipe ICE regression for rustc on Linux (at least) by commenting out 1e5719bdc4/src/bootstrap/src/core/build_steps/compile.rs (L1058), and the test failed because rustc ICE'd.

### Manual testing

I have manually tried:

1. `./x clean && `./x test build --stage 1` -> `rustc +stage1 --print=sysroot | false`: no ICE.
2. `./x clean` -> `./x test run-make` twice: no stage 1 cargo rebuilds.
3. `./x clean` -> `./x build rustdoc` -> `rustdoc +stage1 --version | false`: no panics.
4. `./x test src/tools/cargo`: tests pass, notably `build::close_output` and `cargo_command::closed_output_ok` do not fail which would fail if cargo was built with `-Zon-broken-pipe=kill`.

## Related discussions

Thanks to everyone who helped!
- https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Applying.20.60-Zon-broken-pipe.3Dkill.60.20flags.20in.20bootstrap.3F
- https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Modifying.20run-make.20tests.20unnecessarily.20rebuild.20stage.201.20.2E.2E.2E
- https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Internal.20lint.20for.20raw.20.60print!.60.20and.20.60println!.60.3F

Fixes https://github.com/rust-lang/rust/issues/130980
Closes https://github.com/rust-lang/rust/issues/131059

---

try-job: aarch64-apple
try-job: x86_64-msvc
try-job: x86_64-mingw
2024-10-08 23:25:47 +00:00
Christopher Serr
4b30d25d21 Only Highlight Exit Points on async Token
This ensures that when being on an `await` token, it still only
highlights the yield points and not the exit points.
2024-10-08 23:30:05 +02:00
Noa
35d9bdbcde
Use throw intrinsic from stdarch in wasm libunwind 2024-10-08 15:50:37 -05:00
Michael Goulet
17eca60c24 Dont ICE when encountering post-mono layout cycle error 2024-10-08 16:46:16 -04:00
bors
6f4ae0f345 Auto merge of #131412 - matthiaskrgr:rollup-478o6h6, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #131378 (CI: rfl: move job forward to Linux v6.12-rc2)
 - #131400 (Simplify the compiletest directives for ignoring coverage-test modes)
 - #131408 (Remove unneeded argument of `LinkCollector::verify_disambiguator`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-08 20:45:49 +00:00
Noa
5db54bee68
Stabilize Pin::as_deref_mut 2024-10-08 15:00:15 -05:00
Jake
35e268d406
include fn prefix for all callable defs 2024-10-08 11:37:08 -07:00
Matthias Krüger
cb252eef79
Rollup merge of #131408 - GuillaumeGomez:more-intra-doc-cleanup, r=notriddle
Remove unneeded argument of `LinkCollector::verify_disambiguator`

Still working on https://github.com/rust-lang/rust/pull/130278. ^^'

r? `@notriddle`
2024-10-08 20:13:13 +02:00
Matthias Krüger
bb7232ec1c
Rollup merge of #131400 - Zalathar:ignore-coverage, r=jieyouxu
Simplify the compiletest directives for ignoring coverage-test modes

Follow-up to #131346.

Given that these directives are now restricted to ignoring coverage-test modes only, we can drop the clunky `ignore-mode-*` naming convention, and just call them `ignore-coverage-map` and `ignore-coverage-run`.

r? jieyouxu
2024-10-08 20:13:12 +02:00
Matthias Krüger
7e9da42d53
Rollup merge of #131378 - ojeda:ci-rfl, r=lqd
CI: rfl: move job forward to Linux v6.12-rc2

r? `@Kobzol`

try-job: x86_64-rust-for-linux
2024-10-08 20:13:11 +02:00