Commit Graph

263881 Commits

Author SHA1 Message Date
Ben Kimock
e1a82c9634 Delete compiletest support for gdbg 2024-08-18 12:39:07 -04:00
Ben Kimock
95ae9b8c84 Fix up a special case 2024-08-18 12:39:07 -04:00
Ben Kimock
fa0e8585d4 Replace gdbr with gdbg 2024-08-18 12:39:07 -04:00
Ben Kimock
4314661671 Delete gdbg commands 2024-08-18 12:39:06 -04:00
bors
f04f6ca36d Auto merge of #129230 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-08-18 13:05:32 +00:00
Ralf Jung
0708b289b7 fix build with bootstrap compiler 2024-08-18 13:36:11 +02:00
bors
c74ffd88cb Auto merge of #3820 - tiif:epoller, r=RalfJung
Add epollerr support

Fixes #3816

For socketpair, if the peer fd is closed while having data in its read buffer, ``EPOLLER`` will be thrown.

This is still WIP because I am currently finding a way to check if peer fd still has something in its ``readbuf`` when it is closed and add the ``EPOLLER`` flag In ``get_epoll_ready_events``.
2024-08-18 10:26:13 +00:00
tiif
483120d6ce Add EPOLLER support 2024-08-18 18:18:07 +08:00
bors
334e509912 Auto merge of #129227 - jieyouxu:no-dumping, r=Kobzol
Disable `dump-ice-to-disk` for i686-mingw (again)

To avoid blocking full CI or `i686-mingw` try jobs (failed in https://github.com/rust-lang/rust/pull/127679#issuecomment-2295184771).

At least we now have some context for why the assertion failed.

Anyone with r+ can approve this.
2024-08-18 09:47:46 +00:00
bors
93700208a8 Auto merge of #3818 - tiif:loseevents, r=RalfJung
epoll: iterate through output buffer then fetch an event from ready list

Fixes #3812
2024-08-18 09:45:00 +00:00
许杰友 Jieyou Xu (Joe)
ce7a70ade8 tests: disable dump-ice-to-disk for i686-mingw
To avoid blocking full CI.
2024-08-18 09:13:44 +00:00
tiif
6702f158fd epoll: iterate through output buffer then fetch an event from ready list 2024-08-18 17:12:57 +08:00
bors
8f2768b507 Auto merge of #3825 - RalfJung:epoll-miri, r=RalfJung
epoll test_socketpair_read: explicitly check real and Miri behavior
2024-08-18 09:09:58 +00:00
Ralf Jung
e614d7d51b epoll test_socketpair_read: explicitly check real and Miri behavior 2024-08-18 10:49:56 +02:00
bors
aea3cfd867 Auto merge of #3824 - tiif:maxeventeinval, r=RalfJung
Set EINVAL for epoll_wait maxevent value 0

Fixes #3821
2024-08-18 08:43:22 +00:00
Ralf Jung
f918de8c4a make sure we read all arguments before returning early 2024-08-18 10:41:58 +02:00
bors
7521bdaf5b Auto merge of #129225 - jieyouxu:rollup-xwtkwgr, r=jieyouxu
Rollup of 5 pull requests

Successful merges:

 - #129164 (Use `ar_archive_writer` for writing COFF import libs on all backends)
 - #129173 (Fix `is_val_statically_known` for floats)
 - #129185 (Port `run-make/libtest-json/validate_json.py` to Rust)
 - #129203 (Use cnum for extern crate data key)
 - #129221 (Remove JohnTitor from review rotation)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-18 07:22:33 +00:00
许杰友 Jieyou Xu (Joe)
f31f0f321e
Rollup merge of #129221 - ehuss:johntitor-rotation, r=jieyouxu
Remove JohnTitor from review rotation

This removes `@JohnTitor` from the review rotation. I haven't seen any comments from them in this repository since February, and PRs that get assigned to them tend to sit a few weeks until someone notices. I see that they are still semi-active with libc, but I haven't been able to reach them on Zulip. If `@JohnTitor` wants to get back on the rotation in the future, they are welcome (I don't want to pressure them, their support in the past was much appreciated).
2024-08-18 14:55:24 +08:00
许杰友 Jieyou Xu (Joe)
130cb9e30c
Rollup merge of #129203 - compiler-errors:extern_crate_data, r=jieyouxu
Use cnum for extern crate data key

Noticed this when fixing #129184. I still have yet to put up a fix for that (mostly because I'm too lazy to minimize a test, that will come soon though).
2024-08-18 14:55:23 +08:00
许杰友 Jieyou Xu (Joe)
4e087683e5
Rollup merge of #129185 - Zalathar:validate-json, r=jieyouxu
Port `run-make/libtest-json/validate_json.py` to Rust

This is a trivial Python script that simply tries to parse each line of stdin (i.e. the test process output) as JSON, to verify that the overall output is JSON Lines.

We can perform the same check directly in `rmake.rs` using `serde_json`.

r? ````@jieyouxu````
2024-08-18 14:55:23 +08:00
许杰友 Jieyou Xu (Joe)
42b54a98b6
Rollup merge of #129173 - beetrees:statically-known-float, r=compiler-errors
Fix `is_val_statically_known` for floats

The LLVM intrinsic name for floats differs from the LLVM type name, so handle them explicitly. Also adds support for `f16` and `f128`.

`f16`/`f128` tracking issue: #116909
2024-08-18 14:55:22 +08:00
许杰友 Jieyou Xu (Joe)
c4cf437fa1
Rollup merge of #129164 - ChrisDenton:comdat, r=jieyouxu
Use `ar_archive_writer` for writing COFF import libs on all backends

This is mostly the same as the llvm backend but with the cranelift version copy/pasted in place of the LLVM library.

try-job: x86_64-msvc
try-job: i686-msvc
try-job: i686-mingw
try-job: aarch64-gnu
try-job: aarch64-apple
try-job: test-various
try-job: armhf-gnu
2024-08-18 14:55:22 +08:00
tiif
8ae118dc0a Move the maxevents.try_into().unwrap() after value check 2024-08-18 13:36:56 +08:00
tiif
c0e799db1a Set EINVAL for epoll_wait maxevent value 0 2024-08-18 13:11:06 +08:00
bors
79f5c1605e Auto merge of #128982 - saethlin:windows-debuginfo-tests, r=compiler-errors
Re-enable more debuginfo tests on Windows

These tests used to be disabled on all Windows hosts. Now they're fully enabled or just disabled on windows-gnu with an issue citation that clearly explains why.

The changes in this PR are not tested by PR CI, but I've tested it using try-jobs below.

try-job: i686-msvc
try-job: i686-mingw
try-job: x86_64-mingw
try-job: x86_64-msvc
2024-08-18 04:56:00 +00:00
bors
23f762d3b1 Auto merge of #129115 - jieyouxu:reenable-dump-ice, r=estebank
Re-enable `dump-ice-to-disk` for Windows

This test was previously flakey on `i686-mingw` (reason unknown), but since some modifications (quarantining each ICE test in separate tmp dirs, adding/removing `RUSTC_ICE` env vars as suitable to prevent any kind of environmental influence), I could no longer make it fail on `i686-mingw`.

I tried running this test (without the `ignore-windows` of course) a bunch of times via `i686-mingw` try jobs and it refused to fail (see #128958). I was also never able to reproduce the failure locally.

In any case, if this turns out to be still flakey on `i686-mingw`, we can revert the removal of `ignore-windows` but this time we'll have way more context for why the test failed.

Running the `i686-mingw` alongside some Windows jobs for basic santiy check. But the try jobs succeeding is insufficient to guarantee reproducibility.

cc #129115 for backlink.

try-job: x86_64-msvc
try-job: x86_64-mingw
try-job: i686-msvc
try-job: i686-mingw
2024-08-18 02:25:33 +00:00
Eric Huss
f458886a40 Remove JohnTitor from review rotation 2024-08-17 17:34:52 -07:00
bors
8821108bf1 Auto merge of #3813 - tiif:epollfix, r=RalfJung
Testcase fix for epoll

Fixes #3811

This PR:
- Fixed the error in ``epoll_ctl_del`` test
- Simplified the logic in ``epoll_ctl_mod`` test
- Added a new test to check if flag that we don't register won't trigger notification (double negation sounds a bit confusing here, feel free to suggest a better one ;) )
- Use assert_eq(0) for epoll_ctl test
2024-08-17 22:49:47 +00:00
bors
37d56daac6 Auto merge of #128771 - carbotaniuman:stabilize_unsafe_attr, r=nnethercote
Stabilize `unsafe_attributes`

# Stabilization report

## Summary

This is a tracking issue for the RFC 3325: unsafe attributes

We are stabilizing `#![feature(unsafe_attributes)]`,  which makes certain attributes considered 'unsafe', meaning that they must be surrounded by an `unsafe(...)`, as in `#[unsafe(no_mangle)]`.

RFC: rust-lang/rfcs#3325
Tracking issue: #123757

## What is stabilized

### Summary of stabilization

Certain attributes will now be designated as unsafe attributes, namely, `no_mangle`, `export_name`, and `link_section` (stable only), and these attributes will need to be called by surrounding them in `unsafe(...)` syntax. On editions prior to 2024, this is simply an edition lint, but it will become a hard error in 2024. This also works in `cfg_attr`, but `unsafe` is not allowed for any other attributes, including proc-macros ones.

```rust
#[unsafe(no_mangle)]
fn a() {}

#[cfg_attr(any(), unsafe(export_name = "c"))]
fn b() {}
```

For a table showing the attributes that were considered to be included in the list to require unsafe, and subsequent reasoning about why each such attribute was or was not included, see [this comment here](https://github.com/rust-lang/rust/pull/124214#issuecomment-2124753464)

## Tests

The relevant tests are in `tests/ui/rust-2024/unsafe-attributes` and `tests/ui/attributes/unsafe`.
2024-08-17 22:48:42 +00:00
bors
feeba198f2 Auto merge of #128792 - compiler-errors:foreign-sig, r=spastorino
Use `FnSig` instead of raw `FnDecl` for `ForeignItemKind::Fn`, fix ICE for `Fn` trait error on safe foreign fn

Let's use `hir::FnSig` instead of `hir::FnDecl + hir::Safety` for `ForeignItemKind::Fn`. This consolidates some handling code between normal fns and foreign fns.

Separetly, fix an ICE where we weren't handling `Fn` trait errors for safe foreign fns.

If perf is bad for the first commit, I can rework the ICE fix to not rely on it. But if perf is good, I prefer we fix and clean up things all at once 👍

r? spastorino

Fixes #128764
2024-08-17 19:35:01 +00:00
Chris Denton
0156eb57a1
Always use ar_archive_writer for import libs 2024-08-17 19:10:46 +00:00
tiif
56eee8e870 Apply test fix
- Fix epoll_ctl_del test
- Simplified epoll_ctl_mod test and add test_no_notification_for_unregister_flag
- Use assert_eq(0) for epoll_ctl
2024-08-18 01:19:07 +08:00
bors
0f26ee4fd9 Auto merge of #129202 - matthiaskrgr:rollup-wev7uur, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #128989 (Emit an error for invalid use of the linkage attribute)
 - #129167 (mir/pretty: use `Option` instead of `Either<Once, Empty>`)
 - #129168 (Return correct HirId when finding body owner in diagnostics)
 - #129191 (rustdoc-json: Clean up serialization and printing.)
 - #129192 (Remove useless attributes in merged doctest generated code)
 - #129196 (Remove a useless ref/id/ref round-trip from `pattern_from_hir`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-17 17:09:33 +00:00
Michael Goulet
b2dd943d4b Use cnum for extern crate data 2024-08-17 12:50:18 -04:00
Matthias Krüger
4e6147d956
Rollup merge of #129196 - Zalathar:ref-id-ref, r=compiler-errors
Remove a useless ref/id/ref round-trip from `pattern_from_hir`

This re-lookup of `&hir::Pat` by its ID appears to be an artifact of earlier complexity that has since been removed from the compiler.

Merely deleting the let/match results in borrow errors, but sprinkling `'tcx` in the signature allows it to work again, so I suspect that this code's current function is simply to compensate for overly loose lifetimes in the signature. Perhaps it made more sense at a time when HIR lifetimes were not tied to `'tcx`.

I spotted this while working on some more experimental changes, which is why I've extracted it into its own PR.
2024-08-17 18:18:21 +02:00
Matthias Krüger
8a023b31bd
Rollup merge of #129192 - GuillaumeGomez:rm-useless-merged-doctest-attrs, r=notriddle
Remove useless attributes in merged doctest generated code

I took another look at the generated code for merged doctests and it seems like those attributes are only useful when running `rustc --test`, which isn't the case for merged doctests. Less code generated. \o/

r? `@notriddle`
2024-08-17 18:18:20 +02:00
Matthias Krüger
1a95a5f2db
Rollup merge of #129191 - aDotInTheVoid:rdj-serial-cleanup, r=GuillaumeGomez
rustdoc-json: Clean up serialization and printing.

Somewhat a followup to #128963, but makes sense regardless.

- Renames `out_path` to `out_dir` because it's not the path to the JSON, but the directory
  - Also adds a comment explaining `None`
- Renames `write` to `serialize_and_write` because it does both.
  - Also renames the self-profile activity name to be clear this measures both IO cost and serialization CPU cost
  - Expands the timer to cover flushing
- Renames `output` to `output_crate`, to emphasize it's the contents, not the `--output` flag.

r? `@GuillaumeGomez`
2024-08-17 18:18:19 +02:00
Matthias Krüger
ddbbda47eb
Rollup merge of #129168 - BoxyUwU:mismatched_ty_correct_id, r=compiler-errors
Return correct HirId when finding body owner in diagnostics

Fixes #129145
Fixes #128810

r? ```@compiler-errors```

```rust
fn generic<const N: u32>() {}

trait Collate<const A: u32> {
    type Pass;
    fn collate(self) -> Self::Pass;
}

impl<const B: u32> Collate<B> for i32 {
    type Pass = ();
    fn collate(self) -> Self::Pass {
        generic::<{ true }>()
        //~^ ERROR: mismatched types
    }
}
```

When type checking the `{ true }` anon const we would error with a type mismatch. This then results in diagnostics code attempting to check whether its due to a type mismatch with the return type. That logic was implemented by walking up the hir until we reached the body owner, except instead of using the `enclosing_body_owner` function it special cased various hir nodes incorrectly resulting in us walking out of the anon const and stopping at `fn collate` instead.

This then resulted in diagnostics logic inside of the anon consts `ParamEnv` attempting to do trait solving involving the `<i32 as Collate<B>>::Pass` type which ICEs because it is in the wrong environment.

I have rewritten this function to just walk up until it hits the `enclosing_body_owner` and made some other changes since I found this pretty hard to read/understand. Hopefully it's easier to understand now, it also makes it more obvious that this is not implemented in a very principled way and is definitely missing cases :)
2024-08-17 18:18:19 +02:00
Matthias Krüger
9c910ae7ee
Rollup merge of #129167 - cuviper:either-once-empty, r=Nadrieril
mir/pretty: use `Option` instead of `Either<Once, Empty>`

`Either` is wasteful for a one-or-none iterator, especially since `Once`
is already an `option::IntoIter` internally. We don't really need any of
the iterator mechanisms in this case, just a single conditional insert.
2024-08-17 18:18:18 +02:00
Matthias Krüger
cfeded47a4
Rollup merge of #128989 - s7tya:check-linkage-attribute-pos, r=petrochenkov
Emit an error for invalid use of the linkage attribute

fixes #128486

Currently, the use of the linkage attribute for Mod, Impl,... is incorrectly permitted. This PR will correct this issue by generating errors, and I've also added some UI test cases for it.

Related: #128552.
2024-08-17 18:18:18 +02:00
bors
6ac5bbbe02 Auto merge of #3823 - RalfJung:sync, r=RalfJung
simplify synchronization object creation logic
2024-08-17 15:42:23 +00:00
Ralf Jung
7c811203cd simplify synchronization object creation logic 2024-08-17 17:39:22 +02:00
bors
3e698d0287 Auto merge of #3822 - RalfJung:tls, r=RalfJung
tls_leak_main_thread_allowed: make test check target_thread_local

Instead of ignoring the test entirely on some targets, make the test check the `target_thread_local` flag to determine whether `thread_local!` statics can be tracked by Miri and hence can have main-thread-TLS leaks ignored.
2024-08-17 14:45:42 +00:00
Ralf Jung
bd4ef64a60 run TLS tests on Solarish 2024-08-17 16:44:05 +02:00
Ralf Jung
34e8245e4c tls_leak_main_thread_allowed: make test check target_thread_local 2024-08-17 16:41:53 +02:00
bors
9b318d2e93 Auto merge of #128786 - estebank:multiple-crate-versions, r=fee1-dead
Detect multiple crate versions on method not found

When a type comes indirectly from one crate version but the imported trait comes from a separate crate version, the called method won't be found. We now show additional context:

```
error[E0599]: no method named `foo` found for struct `dep_2_reexport::Type` in the current scope
 --> multiple-dep-versions.rs:8:10
  |
8 |     Type.foo();
  |          ^^^ method not found in `Type`
  |
note: there are multiple different versions of crate `dependency` in the dependency graph
 --> multiple-dep-versions.rs:4:32
  |
4 | use dependency::{do_something, Trait};
  |                                ^^^^^ `dependency` imported here doesn't correspond to the right crate version
  |
 ::: ~/rust/build/x86_64-unknown-linux-gnu/test/run-make/crate-loading/rmake_out/multiple-dep-versions-1.rs:4:1
  |
4 | pub trait Trait {
  | --------------- this is the trait that was imported
  |
 ::: ~/rust/build/x86_64-unknown-linux-gnu/test/run-make/crate-loading/rmake_out/multiple-dep-versions-2.rs:4:1
  |
4 | pub trait Trait {
  | --------------- this is the trait that is needed
5 |     fn foo(&self);
  |        --- the method is available for `dep_2_reexport::Type` here
```

Fix #128569, fix #110926, fix #109161, fix #81659, fix #51458, fix #32611. Follow up to #124944.
2024-08-17 14:40:04 +00:00
Zalathar
194ade1267 Remove a useless ref/id/ref round-trip from pattern_from_hir
This re-lookup of `&hir::Pat` by its ID appears to be an artifact of earlier
complexity that has since been removed from the compiler.
2024-08-17 22:18:37 +10:00
bors
c6f81a452e Auto merge of #126877 - GrigorenkoPV:clone_to_uninit, r=dtolnay
CloneToUninit impls

As per #126799.

Also implements it for `Wtf8` and both versions of `os_str::Slice`.

Maybe it is worth to slap `#[inline]` on some of those impls.

r? `@dtolnay`
2024-08-17 11:39:08 +00:00
Guillaume Gomez
7bde314de8 Remove useless attributes in merged doctest generated code 2024-08-17 13:24:38 +02:00
Alona Enraght-Moony
321d40f060 rustdoc-json: Clean up serialization and printing. 2024-08-17 11:00:26 +00:00