Commit graph

3056 commits

Author SHA1 Message Date
kilavvy
897c4ee406 Update README.md
- Update ui.md
- Update type-alias-impl-trait.md
- Update README.md
2025-06-29 12:29:28 +03:00
Jana Dönszelmann
20e47aafcc
Rollup merge of #142992 - workingjubilee:dont-validate-naughty-abis, r=jieyouxu
Convert some ABI tests to use `extern "rust-invalid"`
2025-06-25 22:14:56 +02:00
Jana Dönszelmann
69b11c64eb
Rollup merge of #142809 - KMJ-007:ad-type-analysis-flag, r=ZuseZ4
Add PrintTAFn flag for targeted type analysis printing

## Summary
This PR adds a new `PrintTAFn` flag to the `-Z autodiff` option that allows printing type analysis information for a specific function, rather than all functions.

## Changes

### New Flag
- Added `PrintTAFn=<function_name>` option to `-Z autodiff`
- Usage: `-Z autodiff=Enable,PrintTAFn=my_function_name`

### Implementation Details
- **Rust side**: Added `PrintTAFn(String)` variant to `AutoDiff` enum
- **Parser**: Updated `parse_autodiff` to handle `PrintTAFn=<function_name>` syntax with proper error handling
- **FFI**: Added `set_print_type_fun` function to interface with Enzyme's `FunctionToAnalyze` command line option
- **Documentation**: Updated help text and documentation for the new flag

### Files Modified
- `compiler/rustc_session/src/config.rs`: Added `PrintTAFn(String)` variant
- `compiler/rustc_session/src/options.rs`: Updated parser and help text (now shows `PrintTAFn` in the list)
- `compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs`: Added FFI function and static variable
- `compiler/rustc_codegen_llvm/src/back/lto.rs`: Added handling for new flag
- `src/doc/rustc-dev-guide/src/autodiff/flags.md`: Updated documentation
- `src/doc/unstable-book/src/compiler-flags/autodiff.md`: Updated documentation

## Testing
The flag can be tested with:
```bash
rustc +enzyme -Z autodiff=Enable,PrintTAFn=square test.rs
```

This will print type analysis information only for the function named "square" instead of all functions.

## Error Handling
The parser includes proper error handling:
- Missing argument: `PrintTAFn` without `=<function_name>` will show an error
- Unknown options: Invalid autodiff options will be reported

r? ```@ZuseZ4```
2025-06-25 22:14:55 +02:00
Jubilee Young
087dabfca7 Sprinkle breadcrumbs around to lead people to the rust-invalid ABI 2025-06-25 00:54:02 -07:00
Karan Janthe
7b1c89f2b5 added PrintTAFn flag for autodiff
Signed-off-by: Karan Janthe <karanjanthe@gmail.com>
2025-06-25 02:11:29 +00:00
Matthias Krüger
f63fdde764
Rollup merge of #141597 - Oneirical:unquestionable-instruction, r=jieyouxu
Document subdirectories of UI tests with README files

Part of rust-lang/rust#133895 and the [2025 Google Summer of Code](https://blog.rust-lang.org/2025/05/08/gsoc-2025-selected-projects/) associated project.

When adding a new UI test, one is faced with hundreds of subdirectories in `tests/ui` reflecting various categories. Knowing where to put the new test is not trivial, as many of the categories have slightly misleading names. For example, `moves` does not only refer to the `move` keyword but to functions taking ownership in general, whereas `allocator` does not refer to allocation in general but rather to the very specific `allocator_api` and `global_allocator` features.

Many contributors will therefore place their test at the top level of ̀`tests/ui` where it will be mixed with hundreds of unrelated tests.

This PR is a tentative move towards more clearly defined tag/categories, with a SUMMARY.md file documenting the true purpose of each subdirectory, placed inside `tests/ui`.

r? ``@jieyouxu``
2025-06-23 06:07:19 +02:00
Oneirical
b433aba3df Add a SUMMARY.md outlining immediate subdirectories of the ui test suite
Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
2025-06-22 12:18:22 -04:00
The rustc-dev-guide Cronjob Bot
d854d56344 Merge from rustc 2025-06-19 04:07:39 +00:00
The rustc-dev-guide Cronjob Bot
48b36ee8ad Preparing for merge from rustc 2025-06-19 04:07:21 +00:00
Manuel Drehwald
0a185e422c initial instructions for gpu offload 2025-06-18 17:22:50 -07:00
Tshepang Mbambo
4145596954
fix markup
That was intended to be a list.

Also, the order is not relevant.
2025-06-19 00:03:33 +02:00
bors
044514eb26 Auto merge of #142689 - Urgau:rollup-4ho6835, r=Urgau
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#135656 (Add `-Z hint-mostly-unused` to tell rustc that most of a crate will go unused)
 - rust-lang/rust#138237 (Get rid of `EscapeDebugInner`.)
 - rust-lang/rust#141614 (lint direct use of rustc_type_ir )
 - rust-lang/rust#142123 (Implement initial support for timing sections (`--json=timings`))
 - rust-lang/rust#142377 (Try unremapping compiler sources)
 - rust-lang/rust#142674 (remove duplicate crash test)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-18 21:19:39 +00:00
Urgau
bf38e5dee3
Rollup merge of #142377 - Urgau:unremap-rustc-dev, r=jieyouxu
Try unremapping compiler sources

See [#t-compiler/help > Span pointing to wrong file location (`rustc-dev` component)](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/Span.20pointing.20to.20wrong.20file.20location.20.28.60rustc-dev.60.20component.29/with/521087083).

This PR is a follow-up to rust-lang/rust#141751 regarding the compiler side.

Specifically we now take into account the `CFG_VIRTUAL_RUSTC_DEV_SOURCE_BASE_DIR` env from rust-lang/rust#141751 when trying to unremap sources from `$sysroot/lib/rustlib/rustc-src/rust` (the `rustc-dev` component install directory).

Best reviewed commit by commit.

cc ``@samueltardieu``
r? ``@jieyouxu``
2025-06-18 19:40:32 +02:00
Boxy
6c7830e75d
Merge pull request #2474 from BoxyUwU/ambig_unambig_ty_consts
Document Ambig vs Unambig Type/Consts
2025-06-18 15:30:14 +01:00
Boxy
39e98006ac Reviews 2025-06-18 15:28:44 +01:00
Jakub Beránek
48e52bb200
Fix compiletest and rustc-dev-guide 2025-06-18 15:07:36 +02:00
Boxy
c1506c0cc0 Add links 2025-06-17 18:09:06 +01:00
Boxy
42888bb018 Write chapter on Unambig vs Ambig Types/Consts 2025-06-17 18:09:06 +01:00
Boxy
d96b2d4398 Stub chapter and consolidate under /hir/ 2025-06-17 18:09:02 +01:00
lolbinarycat
8bc55da22e
Profiling with perf: specify the section of bootstrap settings. 2025-06-17 11:31:04 -05:00
Chris Bloodsworth
1dbf86a631 Remove hanging parenthesis from example signature.
Also replaced '→' symbol with '->' for consistency across the table.
2025-06-16 16:08:21 -04:00
Alice Ryhl
808d16c536
Use stage 1 for building docs 2025-06-16 17:03:33 +02:00
Urgau
268fbfed47 Un-remap rustc-dev component paths 2025-06-15 17:20:08 +02:00
Tshepang Mbambo
21a1e51704 do not inline links 2025-06-14 22:56:10 +02:00
Tshepang Mbambo
820e88a7c6 title case 2025-06-14 22:49:46 +02:00
Tshepang Mbambo
0834e48a11
use sentence case 2025-06-14 22:44:47 +02:00
Tshepang Mbambo
a70deb6e75 content has moved to another chapter 2025-06-14 22:16:51 +02:00
Tshepang Mbambo
9265493052
Merge pull request #2465 from xizheyin/rustc-query
Adjust some doc for Query System
2025-06-14 21:39:25 +02:00
Tshepang Mbambo
94d56d18fd
Merge pull request #2441 from rust-lang/tshepang-remove-title-case
use consistent title capitalization
2025-06-14 19:52:41 +02:00
Matthias Krüger
db23a76217
Rollup merge of #141811 - mejrs:bye_locals, r=compiler-errors
Unimplement unsized_locals

Implements https://github.com/rust-lang/compiler-team/issues/630

Tracking issue here: https://github.com/rust-lang/rust/issues/111942

Note that this just removes the feature, not the implementation, and does not touch `unsized_fn_params`. This is because it is required to support `Box<dyn FnOnce()>: FnOnce()`.

There may be more that should be removed (possibly in follow up prs)
- the `forget_unsized` function and `forget` intrinsic.
- the `unsized_locals` test directory; I've just fixed up the tests for now
- various codegen support for unsized values and allocas

cc ``@JakobDegen`` ``@oli-obk`` ``@Noratrieb`` ``@programmerjake`` ``@bjorn3``

``@rustbot`` label F-unsized_locals

Fixes rust-lang/rust#79409
2025-06-14 11:27:10 +02:00
xizheyin
a4c8ef9f34 Adjust some doc for Query System
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-06-13 22:51:25 +08:00
mejrs
c0e02e26b3 Unimplement unsized_locals 2025-06-13 01:16:36 +02:00
The rustc-dev-guide Cronjob Bot
6da0ebf087 Merge from rustc 2025-06-12 04:06:44 +00:00
The rustc-dev-guide Cronjob Bot
8a7fbded4d Preparing for merge from rustc 2025-06-12 04:06:27 +00:00
Matthias Krüger
57bb38b836
Rollup merge of #142297 - jieyouxu:needs-target-std, r=Kobzol
Implement `//@ needs-target-std` compiletest directive

Closes rust-lang/rust#141863.
Needed to unblock rust-lang/rust#139244 and rust-lang/rust#141856.

### Summary

This PR implements a `//@ needs-target-std` compiletest directive that gates test execution based on whether the target supports std or not. For some cases, this should be preferred over e.g. some combination of `//@ ignore-none`, `//@ ignore-nvptx` and more[^none-limit].

### Implementation limitation

Unfortunately, since there is currently [no reliable way to determine from metadata whether a given target supports std or not](https://github.com/rust-lang/rust/issues/142296), we have to resort to a hack. Bootstrap currently determines whether or not a target supports std by a naive target tuple substring comparison: a target supports std if its target tuple does *not* contain one of `["-none", "nvptx", "switch"]` substrings. This PR simply pulls that hack out into `build_helpers` to avoid reimplementing the same hack in compiletest, and uses that logic to inform `//@ needs-target-std`.

### Auxiliary changes

This PR additionally changes a few run-make tests to use `//@ needs-target-std` over an inconsistent combination of target-based `ignore`s. This should help with rust-lang/rust#139244.

---

r? bootstrap

[^none-limit]: Notably, `target_os = "none"` is **not** a sufficient condition for "target does not support std"
2025-06-11 13:48:11 +02:00
Tshepang Mbambo
dc41a1bd93
that was phrased like a separate sentence 2025-06-11 07:14:12 +02:00
lolbinarycat
c0978c497d
Using git § I changed a submodule by accident: be explicit
Rewriting git history is something that is often difficult for new contributors,
and we're already explaining the `<foo>` placeholder syntax,
so I think it makes sense to be explicit about what exactly the paths mean.
2025-06-10 12:48:05 -05:00
Jieyou Xu
c5b8123574
Document //@ needs-target-std in rustc-dev-guide 2025-06-10 22:17:57 +08:00
The rustc-dev-guide Cronjob Bot
7565e75591 Merge from rustc 2025-06-09 04:09:17 +00:00
The rustc-dev-guide Cronjob Bot
f598bbd66b Preparing for merge from rustc 2025-06-09 04:08:59 +00:00
cyrgani
ec62afcf77 remove the archived ICE ping groups 2025-06-08 21:49:54 +02:00
León Orell Valerian Liehr
f6270d2d92
Fix typo 2025-06-07 18:58:41 +02:00
León Orell Valerian Liehr
f56cf01ca7
Merge pull request #2298 from fmease/rustdoc-testing-addendum
rustdoc: Further improve chapters and sections on testing
2025-06-07 18:36:45 +02:00
León Orell Valerian Liehr
d281b45773
rustdoc: Further improve chapters and sections on testing 2025-06-07 18:35:40 +02:00
Matthias Krüger
cfe78d99ae
Rollup merge of #141970 - onur-ozkan:skip-stage1-std, r=Kobzol
implement new `x` flag: `--skip-std-check-if-no-download-rustc`

One of our developers (``@RalfJung)`` [reported](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Surprising.20stages.20for.20check.20build.20after.20stage.20reorg/with/521925606)[#t-infra/bootstrap > Surprising stages for check build after stage reorg](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Surprising.20stages.20for.20check.20build.20after.20stage.20reorg/with/521925606) that working on both the compiler and the library simultaneously with RA enabled is extremely difficult because checking library creates a heavy load on machines (by building stage1 compiler) on each modification. `--skip-std-check-if-no-download-rustc` flag is intended to reduce this heavy load on their IDE integration as much as possible.

Fixes: rust-lang/rust#141955
2025-06-05 12:21:34 +02:00
Jieyou Xu
94901629b4
triagebot: avoid unnecessary line break in PR welcome message 2025-06-04 21:25:15 +08:00
onur-ozkan
0ca1be9273 document skip-std-check-if-no-download-rustc in rustc-dev-guide
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-04 15:23:58 +03:00
许杰友 Jieyou Xu (Joe)
e80275489d
Merge pull request #2454 from rust-lang/tshepang-expand 2025-06-04 16:46:11 +08:00
Rageking8
bd9c30762a
Fix incorrect use of "recommend" over "recommended" 2025-06-04 16:30:02 +08:00
Tshepang Mbambo
94e0753504 expand meaning of ~? diagnostic annotation 2025-06-04 00:26:47 +02:00