Commit Graph

21219 Commits

Author SHA1 Message Date
Jana Dönszelmann
9acc63a48c port #[debugger_visualizer] to the new attribute system 2025-09-21 21:30:16 -07:00
Iris Shi
52e6998a18 Move test file 2025-09-22 11:47:12 +08:00
Iris Shi
8f1a1f8533 Update tests/rustdoc/private-mod-override-re-export.rs
Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com>
2025-09-22 05:45:23 +02:00
ltdk
055e05a338 Mark float intrinsics with no preconditions as safe 2025-09-21 20:37:51 -04:00
Jules Bertholet
f1d6e000b5 Bless UI tests 2025-09-21 17:26:39 -04:00
Matthias Krüger
7148a4f543 Rollup merge of #143857 - Periodic1911:macro-export, r=jdonszelmann
Port #[macro_export] to the new attribute parsing infrastructure

Ports macro_export to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197

r? ``@oli-obk``

cc ``@JonathanBrouwer`` ``@jdonszelmann``
2025-09-21 22:20:25 +02:00
U. Lasiotus
0138bbd495 Add x86_64-unknown-motor (Motor OS) tier 3 target
Add the initial no-std Motor OS compiler target.

Motor OS has been developed for several years in the open:
https://github.com/moturus/motor-os.

It has a more or less full implementation of Rust std library,
as well as tokio/mio ports.

Build instructions can be found here:
https://github.com/moturus/motor-os/blob/main/docs/build.md.

Signed-off-by: U. Lasiotus <lasiotus@motor-os.org>
2025-09-21 12:43:13 -07:00
Folkert de Vries
3565b0699d emit attribute for readonly non-pure inline assembly 2025-09-21 21:16:06 +02:00
Jens Reidel
b3c2435688 Make mips64el-unknown-linux-muslabi64 link dynamically
I missed this target when I changed all the other tier 3 targets. Only
realized that this one was still statically linked when I looked at the
list of targets in the test later.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-09-21 21:13:15 +02:00
The 8472
5f0a68eb22 regression test for https://github.com/rust-lang/rust/issues/117763 2025-09-21 19:54:43 +02:00
Ben Kimock
aef02fb864 Explain tests and setting cfgs 2025-09-21 13:28:01 -04:00
Ben Kimock
df58fd8cf7 Change the cfg to a dash 2025-09-21 13:12:20 -04:00
Ben Kimock
888679013d Add panic=immediate-abort 2025-09-21 13:12:18 -04:00
bors
7e4b8d702f Auto merge of #146659 - cjgillot:impossible-taint, r=oli-obk
Consider errors in MIR as impossible predicates to empty the body.

The ICEs come from elaborating drops or performing state transform in MIR bodies that fail typeck or borrowck.

If the body is tainted, replace it with `unreachable`.

Fixes https://github.com/rust-lang/rust/issues/122630
Fixes https://github.com/rust-lang/rust/issues/122904
Fixes https://github.com/rust-lang/rust/issues/125185
Fixes https://github.com/rust-lang/rust/issues/139556
2025-09-21 16:28:12 +00:00
Jonathan Brouwer
f7fa83ec62 Changes to uitests for macro_export port
Co-authored-by: Anne Stijns <anstijns@gmail.com>
2025-09-21 10:42:47 -04:00
bors
1d23da6b73 Auto merge of #146779 - GuillaumeGomez:gcc-ignore-test_ui_abi, r=Kobzol,jieyouxu
Ignore tests in `tests/ui/abi` for the GCC backend

Needed for https://github.com/rust-lang/rust/pull/146414.

Currently we ignore them in the GCC backend and until this situation changes, it'll block rust-lang/rust#146414.

r? `@Kobzol`
2025-09-21 07:52:56 +00:00
Taiki Endo
f4b876867d Support ctr and lr as clobber-only registers in PowerPC inline assembly 2025-09-21 13:48:22 +09:00
Stuart Cook
92ea947c78 Rollup merge of #146793 - folkertdev:naked-asm-func-end, r=Amanieu
naked_asm: emit a label starting with `func_end`

The `cargo asm` tool (`cargo install cargo-show-asm`) pattern matches on such labels to figure out where functions end: normal functions generated by LLVM always do have such a label. We don't guarantee that naked functions emit such a label, but having `cargo asm` work is convenient.

be45f67454/src/asm/statements.rs (L897-L901)

To make the label name unique it's suffixed with the name of the current symbol.

r? ```@Amanieu```
2025-09-21 14:42:35 +10:00
Stuart Cook
6333a8b9fe Rollup merge of #146551 - folkertdev:cmse-entry-c-variadic, r=workingjubilee
fix issue with `cmse-nonsecure-entry` ABI being both async and c-variadic

tracking issue: https://github.com/rust-lang/rust/issues/75835
fixes https://github.com/rust-lang/rust/issues/132142

An `extern "cmse-nonsecure-entry"` function cannot be c-variadic (or, in any case, clang/LLVM does not support it, see  https://godbolt.org/z/MaPjzGcE1). So just stop looking at the type if we know it'll be invalid anyway.

I'm not entirely sure how to test this. The ICE is only possible on the `thumbv8m.main-none-eabi` and some related targets. I think using `minicore` is the most convenient, but use of `async` requires quite a long list of lang items to be present. Maybe we want that anyway though? On the other hand, it's extra `minicore` surface that might go out of date.

An alternative is `run-make`, that should work, but is much less convenient. See also [#t-compiler/help > &#96;async fn&#96; and &#96;minicore&#96;](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.60async.20fn.60.20and.20.60minicore.60/with/539427262).

r? `@ghost`
2025-09-21 14:42:34 +10:00
Stuart Cook
b0c55c8554 Rollup merge of #145664 - Darksonn:stab-file-with-nul, r=Mark-Simulacrum
Stabilize `std::panic::Location::file_as_c_str`

Closes: rust-lang/rust#141727

Nominating this for T-lang as per ```@traviscross```  https://github.com/rust-lang/rust/issues/141727#issuecomment-3201318429
2025-09-21 14:42:34 +10:00
Camille Gillot
3934fc9eb2 Consider errors in MIR as impossible predicates. 2025-09-21 03:26:21 +00:00
Guillaume Gomez
fd7f8b2b25 [GCC backend] Ignore failing ui abi tests 2025-09-20 17:58:32 +02:00
Matthias Krüger
8904ff135f Rollup merge of #146762 - madsmtm:test-apple-sim, r=jieyouxu
Fix and provide instructions for running test suite on Apple simulators

The following now works:

```sh
./x test --host='' --target aarch64-apple-ios-sim --skip tests/debuginfo
./x test --host='' --target aarch64-apple-tvos-sim --skip tests/debuginfo
./x test --host='' --target aarch64-apple-watchos-sim --skip tests/debuginfo
./x test --host='' --target aarch64-apple-visionos-sim --skip tests/debuginfo
```

I have documented the setup I used [in the `rustc-dev-guide`](https://rustc-dev-guide.rust-lang.org/tests/running.html#testing-on-emulators), it's fairly standard use of `remote-test-server` (with a small fix to library load paths which I've made in the first commit).

I first tried the somewhat simpler `target.aarch64-apple-ios-sim.runner = "xcrun simctl spawn $UDID"`, but that doesn't work as required libraries etc. also need to be copied to the device.

The debuginfo tests fail, I think because the debug info in `.dSYM` isn't available. I am yet unsure exactly how to fix this, either we need to copy that directory to the target as well, or we need to configure `lldb` somehow to read it from the host.

I decided to not add this to our CI, since I suspect we wouldn't gain much from it? Running on the simulator still uses the host Darwin kernel, it's basically just configured to run in another mode with more restricted permissions and different system libraries.

r? jieyouxu
CC ``@simlay,`` you're a lot more familiar with `xcrun simctl` than I.
2025-09-20 17:55:04 +02:00
Iris Shi
2a75cb9d6c add private module override re-export test 2025-09-20 16:12:29 +08:00
Matthias Krüger
02faee6044 Rollup merge of #146781 - joshtriplett:mbe-derive-fix-feature-gate, r=wesleywiser
mbe: Fix feature gate for `macro_derive`
2025-09-19 22:53:56 +02:00
Folkert de Vries
b27942853e naked_asm: emit a label starting with func_end
The `cargo asm` tool pattern matches on such labels to figure out where functions end: normal functions generated by LLVM always do have such a label. We don't guarantee that naked functions emit such a label, but having `cargo asm` work is convenient
2025-09-19 21:53:06 +02:00
Scott Schafer
4f02ec2cea test: Use SVG for terminal url test 2025-09-19 12:28:44 -06:00
Scott Schafer
82eed00d39 chore(compiletest): Use newest anstyle-svg version 2025-09-19 12:28:44 -06:00
Augie Fackler
e32b975e84 tests: relax expectations after llvm change 902ddda120a5
LLVM 22 is able to drop assumes that seem to not help further
optimizations, which actually seems to dramatically _help_ further
optimizations in some of our small test cases.
2025-09-19 13:56:19 -04:00
Josh Triplett
3ab89abac4 mbe: Fix feature gate for macro_derive 2025-09-19 23:17:12 +08:00
Stuart Cook
ff8d63ae43 Rollup merge of #146541 - joboet:simplify-lookup-host, r=tgross35
std: simplify host lookup

The logic for splitting up a string into a hostname and port is currently duplicated across (nearly) all of the networking implementations in `sys`. Since it does not actually rely on any system internals, this PR moves it to the `ToSocketAddr` implementation for `&str`, making it easier to discover and maintain.

On the other hand, the `ToSocketAddr` implementation (or rather the `resolve_socket_addr` function) contained logic to overwrite the port on the socket addresses returned by `LookupHost`, even though `LookupHost` is already aware of the port and sets the port already on Xous. This PR thus removes this logic by moving the responsibility of setting the port to the system-specific `LookupHost` implementation.

As a consequence of these changes, there remains only one way of creating `LookupHost`, hence I've removed the `TryFrom` implementations in favour of a `lookup_host` function, mirroring other, public iterator-based features.

And finally, I've simplified the parsing logic responsible for recognising IP addresses passed to `<(&str, u16)>::to_socket_addrs()` by using the `FromStr` impl of `IpAddr` rather than duplicating the parsing for both IP versions.
2025-09-19 22:31:51 +10:00
Mads Marquart
37be93497e Fix test suite in iOS/tvOS/watchOS/visionOS simulator 2025-09-19 13:55:03 +02:00
joboet
09d3120a99 std: simplify host lookup 2025-09-19 11:30:27 +02:00
Karan Janthe
4520926bb5 autodiff: recurion added for typetree 2025-09-19 04:11:35 +00:00
Karan Janthe
4f3f0f48e7 autodiff: fixed test to be more precise for type tree checking 2025-09-19 04:11:35 +00:00
Karan Janthe
574f0b97d6 autodiff: struct support in typetree 2025-09-19 04:11:35 +00:00
Karan Janthe
7c5fbfbdbb autodiff: tuple support in typetree 2025-09-19 04:11:35 +00:00
Karan Janthe
be3617b040 autodiff: slice support in typetree 2025-09-19 04:11:35 +00:00
Karan Janthe
31541feb6f autodiff: add TypeTree support for arrays 2025-09-19 04:11:35 +00:00
Karan Janthe
664e83b3e7 added typetree support for memcpy 2025-09-19 04:02:20 +00:00
Karan Janthe
5d3ebc3804 Add TypeTree tests for scalar types
- Add specific tests for f32, f64, i32, f16, f128 TypeTree generation
  - Verify correct enzyme_type metadata for each scalar type
  - Ensure TypeTree metadata matches expected Enzyme format

Signed-off-by: Karan Janthe <karanjanthe@gmail.com>
2025-09-19 04:02:19 +00:00
Karan Janthe
beba6b9b86 Update TypeTree tests to verify metadata attachment
- Fix nott-flag test to emit LLVM IR and check enzyme_type attributes
  - Replace TODO comments with actual TypeTree metadata verification
  - Test that NoTT flag properly disables TypeTree generation
  - Test that TypeTree enabled generates proper enzyme_type attributes

Signed-off-by: Karan Janthe <karanjanthe@gmail.com>
2025-09-19 04:02:19 +00:00
Karan Janthe
e1258e79d6 autodiff: Add basic TypeTree with NoTT flag
Signed-off-by: Karan Janthe <karanjanthe@gmail.com>
2025-09-19 04:02:19 +00:00
bors
0c0c58b8e4 Auto merge of #146727 - matthiaskrgr:rollup-98812uj, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#146434 (c-variadic: allow c-variadic inherent and trait methods)
 - rust-lang/rust#146487 (Improve `core::num` coverage)
 - rust-lang/rust#146597 (Add span for struct tail recursion limit error)
 - rust-lang/rust#146622 (Add regression test for issue rust-lang/rust#91831)
 - rust-lang/rust#146717 (Clean up universe evaluation during type test evaluation)
 - rust-lang/rust#146723 (Include patch in release notes)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-18 16:55:05 +00:00
Matthias Krüger
f28730fcd4 Rollup merge of #146622 - aklaiber:91831_add_regression_test, r=jdonszelmann
Add regression test for issue #91831

The requested test for rust-lang/rust#91831. I'm unsure about the filename, the file structure in `tests/ui/lifetimes/lifetime-errors/` isn't entirely clear to me. Any suggestions?

Closes rust-lang/rust#91831
2025-09-18 17:20:58 +02:00
Matthias Krüger
b7ab58eb4d Rollup merge of #146597 - modhanami:add-struct-tail-recursion-limit-span, r=oli-obk
Add span for struct tail recursion limit error

Fixes rust-lang/rust#135629

Changes
1. Add span to RecursionLimitReached
2. Add ObligationCause parameter to struct_tail_raw
4. Update call sites to pass nearby ObligationCause or create one
5. Update affected .stderr
2025-09-18 17:20:57 +02:00
Matthias Krüger
185926c99f Rollup merge of #146434 - folkertdev:c-variadic-inherent-methods, r=workingjubilee
c-variadic: allow c-variadic inherent and trait methods

tracking issue: https://github.com/rust-lang/rust/issues/44930

Continuing the work of https://github.com/rust-lang/rust/pull/146342, allow inherent and trait methods to be c-variadic. However, a trait that contains a c-variadic method is no longer dyn-compatible.

There is, presumably, some way to make c-variadic methods dyn-compatible. However currently, we don't have confidence that it'll work reliably: when methods from a `dyn` object are cast to a function pointer, a `ReifyShim` is created. If that shim is c-variadic, it would need to forward the C variable argument list.

That does appear to work, because the `va_list` is not represented in MIR at all in this case, so the registers from the call site are untouched by the shim and can be read by the actual implementation. That just does not seem like a solid implementation.

Also, intuitively, why would c-variadic function, primarily needed for FFI, need to be used with `dyn` objects at all? We can revisit this limitation if a need arises.

r? `@workingjubilee`
2025-09-18 17:20:56 +02:00
bors
4cd91ef822 Auto merge of #145993 - lcnr:allow-calling-opaques, r=BoxyUwU
`-Znext-solver` allow `ExprKind::Call` for not-yet defined opaques

Based on https://github.com/rust-lang/rust/pull/146329. Revival of rust-lang/rust#140496. See the comment on `OpaqueTypesJank`. I've used the following document while working on this https://hackmd.io/Js61f8PRTcyaiyqS-fH9iQ.

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/181. It does introduce one subtle footgun we may want to handle before stabilization, opened https://github.com/rust-lang/trait-system-refactor-initiative/issues/230 for that. Also cc https://github.com/rust-lang/trait-system-refactor-initiative/issues/231 for deref and index operations

r? `@BoxyUwU`
2025-09-18 13:49:53 +00:00
Jules Bertholet
389907a17e Enforce E0719 only for trait aliases 2025-09-18 09:16:58 -04:00
lcnr
3b2bbcd87e internal constraints are better than placeholder outlives 2025-09-18 13:57:42 +02:00