Commit graph

308255 commits

Author SHA1 Message Date
reddevilmidzy
5d595cf8ba Expand pow docs with special-case tests 2025-11-10 14:56:05 +09:00
bors
e1243553b3 Auto merge of #147735 - yotamofek:pr/ssa/initialize_locals_opt, r=JonathanBrouwer
Micro-optimization in `FunctionCx::initialize_locals`

This showed up in a profile I was looking at, hoping this might improve perf by a little bit.
2025-10-19 03:31:46 +00:00
bors
377a931045 Auto merge of #147863 - matthiaskrgr:rollup-l4alyf0, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#138679 (Issue-125323: ICE non-ADT in struct pattern when long time constant evaluation is in for loop)
 - rust-lang/rust#146490 (Rehome 26 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [rust-lang/rust#5 of Batch rust-lang/rust#2])
 - rust-lang/rust#147438 (Rename "non-inline module" to "file module" in proc macro diagnostics)
 - rust-lang/rust#147724 (Fix ICE in pattern matching with generic const array length errors)
 - rust-lang/rust#147813 (Warn on unused_attributes in uitests )
 - rust-lang/rust#147816 (Do not error out for `download-rustc` if LTO is configured)
 - rust-lang/rust#147845 (Add regression test for 134355)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-19 00:17:12 +00:00
Matthias Krüger
54c693923c
Rollup merge of #147845 - reddevilmidzy:ice-bug, r=jdonszelmann
Add regression test for 134355

Closes rust-lang/rust#134355
2025-10-18 23:54:47 +02:00
Matthias Krüger
fa1a0c3bb4
Rollup merge of #147816 - Kobzol:bootstrap-download-rustc-lto, r=jieyouxu
Do not error out for `download-rustc` if LTO is configured

Noted [here](https://github.com/rust-lang/rust/issues/141953#issuecomment-3404838305). LTO should indeed be mostly a perf-only change.

r? ``@jieyouxu``
2025-10-18 23:54:46 +02:00
Matthias Krüger
2d59f53b88
Rollup merge of #147813 - JonathanBrouwer:unused_attributes, r=jdonszelmann
Warn on unused_attributes in uitests

r? ```@jdonszelmann```

Because:
- unused_attributes warnings are usually actual mistakes, rather than just unused code, and we want to notify test writers they may be accidentally making a mistake
- Because the lint was allowed by default previously, we missed real bugs, because the test coverage is worse
  1. https://github.com/rust-lang/rust/issues/147417
  2. https://github.com/rust-lang/rust/issues/147411
2025-10-18 23:54:46 +02:00
Matthias Krüger
e53b361d33
Rollup merge of #147724 - chenyukang:yukang-fix-139815-ice, r=jdonszelmann
Fix ICE in pattern matching with generic const array length errors

Fixes rust-lang/rust#139815
2025-10-18 23:54:45 +02:00
Matthias Krüger
48db5270a0
Rollup merge of #147438 - reddevilmidzy:rename-non-inline-module-in-msg, r=fee1-dead
Rename "non-inline module" to "file module" in proc macro diagnostics

This PR updates diagnostic messages to use "file module" instead of "non-inline module". because the term "non-inline module" can be confusing, especially for non-native English speakers.

follow up PR rust-lang/rust#147395
related of rust-lang/rust#147314, [#general > Rename "non-inline modules" to "external modules"](https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/.E2.9C.94.20Rename.20.22non-inline.20modules.22.20to.20.22external.20modules.22/near/543361244)

cc ```@Kivooeo```
2025-10-18 23:54:44 +02:00
Matthias Krüger
5559313a14
Rollup merge of #146490 - Oneirical:uncountable-integer-12, r=jieyouxu
Rehome 26 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#5 of Batch #2]

Part of rust-lang/rust#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that Kivooeo was using.

r? ```@jieyouxu```
2025-10-18 23:54:44 +02:00
Matthias Krüger
8f11852e78
Rollup merge of #138679 - Shunpoco:issue-125323, r=oli-obk
Issue-125323: ICE non-ADT in struct pattern when long time constant evaluation is in for loop

This PR fixes #125323

## Context
According to the issue, the ICE happens since #121206.
In the PR, some error methods were reorganized. For example, has_errors() was renamed to has_errors_exclude_lint_errors(). However, some codes which used the original has_errors() were not switched to has_errors_exclude_lint_errors(). I finally found that report_error() in writeback.rs causes this ICE. Currently the method uses tainted_by_errors() to get guar (ErrorGuaranteed), but originally it used dcx().has_errors() but it wasn't changed to has_errors_exclude_lint_errors() when changes in #121206 were merged. I don't think I fully understand how an error is propagated, but I suppose that the error from long time constant evaluation is unexpectedly propagated other parts (in this ICE, for loop), then cause the non-ADT in struct pattern ICE.

## Change
- Fix report_error() in writeback.rs: use dcx().has_errors_exclude_lint_errors() instead of tainted_by_errors() to prevent error propagation from constant evaluation.
- Add test for the ICE
- Modify some tests to align the change: Due to this fix, E0282 error happens (or not happen anymore) in some tests.

## NOTE
The 4th commit aims to revert the fix in #123516 because I confirmed that the ICE solved by the PR doesn't happen if I modify report_error(). I think the root cause of that ICE is the same as #125323 . But I can discard this commit since we can fix #125323 without it.
2025-10-18 23:54:43 +02:00
Jonathan Brouwer
66b8a9db1f
Update uitests with new unused_attributes warnings
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-10-18 21:17:48 +02:00
Jonathan Brouwer
e3dd4c1987
Warn on unused_attributes in tests
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-10-18 21:13:52 +02:00
bors
6380899f32 Auto merge of #147842 - matthiaskrgr:rollup-b4gp4p4, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#146509 (Result/Option layout guarantee clarifications)
 - rust-lang/rust#147494 (std::thread spawn: Docs: Link to Builder::spawn; Make same.)
 - rust-lang/rust#147532 ( Port `#[cfg_attr]` to the new attribute parsing infrastructure)
 - rust-lang/rust#147783 (bootstrap: migrate to object 0.37)
 - rust-lang/rust#147792 (Fix autodiff incorrectly applying fat-lto to proc-macro crates )
 - rust-lang/rust#147809 (rustdoc: Fix passes order so intra-doc links are collected after stripping passes)

Failed merges:

 - rust-lang/rust#147813 (Warn on unused_attributes in uitests )

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-18 15:48:08 +00:00
reddevilmidzy
0c2e7ce3b4 Add regression test for 134355 2025-10-18 23:45:19 +09:00
Matthias Krüger
27b00187b2
Rollup merge of #147809 - GuillaumeGomez:fix-rustdoc-passes, r=fmease
rustdoc: Fix passes order so intra-doc links are collected after stripping passes

Fixes regression I introduced in https://github.com/rust-lang/rust/pull/147153.

This PR puts back the intra-doc link collecting pass after the stripping items pass, preventing lints to be emitted on non-visible items.

Although, might be nice to add a way to change this behaviour. To be discussed later on.

cc ``@ojeda``
r? ``@fmease``
2025-10-18 15:09:05 +02:00
Matthias Krüger
7fa2030d18
Rollup merge of #147792 - osamakader:fix-autodiff-proc-macro-lto, r=petrochenkov
Fix autodiff incorrectly applying fat-lto to proc-macro crates

Fixes rust-lang/rust#147487
2025-10-18 15:09:05 +02:00
Matthias Krüger
063b26adda
Rollup merge of #147783 - durin42:object-unification, r=Zalathar
bootstrap: migrate to object 0.37

I noticed we had a mix of 0.37 and 0.36 at work, and this was why. As far as I can tell everything still builds and works correctly.
2025-10-18 15:09:04 +02:00
Matthias Krüger
2b582ea0ba
Rollup merge of #147532 - JonathanBrouwer:cfg_attr2, r=jdonszelmann
Port `#[cfg_attr]` to the new attribute parsing infrastructure

This work in progress, not ready for review.
PR mostly for ci/perf runs
2025-10-18 15:09:03 +02:00
Matthias Krüger
55a3df8cee
Rollup merge of #147494 - evanj:evan.jones/thread-spawn-link, r=joboet
std::thread spawn: Docs: Link to Builder::spawn; Make same.

Replace "use this API instead" with a link to Builder::spawn. Edit the paragraph to make it slightly clearer.

The Scope::spawn method already included a link to `Builder::spawn_scoped`. Make the docs for `Scope::spawn` and `thread::spawn` nearly the same.
2025-10-18 15:09:03 +02:00
Matthias Krüger
32d21cb0b2
Rollup merge of #146509 - RalfJung:res-opt-layout-guarantees, r=traviscross
Result/Option layout guarantee clarifications

- It seems worth spelling out that this guarantee allows particular transmutes.
- After the `Result` section was written, the `Option` section it referenced gained *more* guarantees, saying that `None` is represented as `[0u8; N]`. Those guarantees were not meant to apply to `Result`. Make the `Result` section more self-contained to make this more clear.
- "Type has no fields" is unclear since there is no general definition of what the fields of some arbitrary type are. Replace that by a more accurate description of the actual check implemented [here](e379c77586/compiler/rustc_lint/src/types.rs (L828-L838)).

r? `@traviscross`
2025-10-18 15:09:02 +02:00
bors
0c0f27afd4 Auto merge of #147695 - cjgillot:deduce-param-freeze, r=tmiasko
deduced_param_attrs: check Freeze on monomorphic types.

`deduced_param_attrs` currently checks `Freeze` bound on polymorphic MIR. This pessimizes the deduction, as generic types are not `Freeze` by default.

This moves the check to the ABI adjustment.
2025-10-18 12:37:45 +00:00
bors
c8a31b780d Auto merge of #147654 - dianqk:simplify-const-condition, r=cjgillot
Simplify trivial constants in SimplifyConstCondition

After `InstSimplify-after-simplifycfg` with `-Zub_checks=false`, there are many of the following patterns.

```
_13 = const false;
assume(copy _13);
_12 = unreachable_unchecked::precondition_check() -> [return: bb1, unwind unreachable];
```

Simplifying them to unreachable early should make CFG simpler.
2025-10-18 09:29:51 +00:00
bors
ab1d244453 Auto merge of #147838 - matthiaskrgr:rollup-r8r148d, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#140153 (Implement `Debug` for `EncodeWide`)
 - rust-lang/rust#145724 (the `#[track_caller]` shim should not inherit `#[no_mangle]`)
 - rust-lang/rust#147258 (iter repeat: panic on last)
 - rust-lang/rust#147454 (Fix backtraces with `-C panic=abort` on qnx; emit unwind tables by default)
 - rust-lang/rust#147468 (Implement fs api set_times and set_times_nofollow)
 - rust-lang/rust#147764 (Undo CopyForDeref assertion in const qualif)
 - rust-lang/rust#147805 (use module_child index as disambiguator for external items)
 - rust-lang/rust#147824 (docs: update Motor OS target docs)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-18 06:23:31 +00:00
Matthias Krüger
706f5fbf7f
Rollup merge of #147824 - moturus:motor-os-docs, r=Urgau
docs: update Motor OS target docs

Update the docs to reflect that [Motor OS std library PR](https://github.com/rust-lang/rust/pull/147000) has been merged.
2025-10-18 08:08:40 +02:00
Matthias Krüger
5695a88298
Rollup merge of #147805 - LorrensP-2158466:extern-mod-disamb, r=petrochenkov
use module_child index as disambiguator for external items

When defining the items of an external module, if that item is an underscore we use it's index as the disambiguator. This is needed for parallel import resolution, which is being worked on in rust-lang/rust#145108.

r? `@petrochenkov`
2025-10-18 08:08:39 +02:00
Matthias Krüger
756d3a0fb7
Rollup merge of #147764 - beepster4096:oopsies_sorry, r=saethlin
Undo CopyForDeref assertion in const qualif

Fixes rust-lang/rust#147733 caused by rust-lang/rust#145513

This code in fact does not run only on runtime MIR.
2025-10-18 08:08:38 +02:00
Matthias Krüger
fc6502976c
Rollup merge of #147468 - chenyukang:yukang-api-set-times, r=joshtriplett
Implement fs api set_times and set_times_nofollow

implementation of rust-lang/rust#147455

r? ````@joshtriplett````
2025-10-18 08:08:38 +02:00
Matthias Krüger
8527b5471f
Rollup merge of #147454 - ferrocene:hoverbear/panic-abort-uwtables-qnx, r=wesleywiser
Fix backtraces with `-C panic=abort` on qnx; emit unwind tables by default

While syncing https://github.com/rust-lang/rust/pull/143613 into Ferrocene as part of https://github.com/ferrocene/ferrocene/pull/1803, we noted a failure on our QNX targets:

```
---- [ui] tests/ui/panics/panic-abort-backtrace-without-debuginfo.rs stdout ----

error: test did not exit with success! code=Some(134) so test would pass with `run-crash`
status: exit status: 134
command: RUSTC="/home/ci/project/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUST_TEST_THREADS="1" "/home/ci/project/build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-client" "run" "0" "/home/ci/project/build/x86_64-unknown-linux-gnu/test/ui/panics/panic-abort-backtrace-without-debuginfo/a"
--- stdout -------------------------------
uploaded "/home/ci/project/build/x86_64-unknown-linux-gnu/test/ui/panics/panic-abort-backtrace-without-debuginfo/a", waiting for result
died due to signal 6
------------------------------------------
--- stderr -------------------------------

thread 'main' (1) panicked at /home/ci/project/tests/ui/panics/panic-abort-backtrace-without-debuginfo.rs:39:9:
ERROR: no `this_function_must_be_in_the_backtrace` in stderr! actual stderr:
thread 'main' (1) panicked at /home/ci/project/tests/ui/panics/panic-abort-backtrace-without-debuginfo.rs:27:5:
generate panic backtrace
stack backtrace:
   0:       0x4e66a53643 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h55e010263b1e3169
   1:       0x4e66a68cd2 - core::fmt::write::h0d6e2e8752abc333
   2:       0x4e66a16919 - std::io::Write::write_fmt::h71c4c024d832b384
   3:       0x4e66a1f8e2 - std::sys::backtrace::BacktraceLock::print::hdd80dfdf90bb7100
   4:       0x4e66a221e0 - std::panicking::default_hook::{{closure}}::h77758f25a686500f
   5:       0x4e66a21f69 - std::panicking::default_hook::ha63f7d476af6c267
   6:       0x4e66a22999 - std::panicking::panic_with_hook::h3a36a8a0f0dd8ccd
   7:       0x4e66a21cac - std::panicking::begin_panic::{{closure}}::h570dedb92e232392
   8:       0x4e66a1fa69 - std::sys::backtrace::__rust_end_short_backtrace::h5366eec354f92733
   9:       0x4e669f9589 - std::panicking::begin_panic::h04a4bd4c33dd4056
  10:       0x4e66a00aca - panic_abort_backtrace_without_debuginfo::and_this_function_too::h5b034b94cbe9c3d3

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
------------------------------------------

---- [ui] tests/ui/panics/panic-abort-backtrace-without-debuginfo.rs stdout end ----

failures:
    [ui] tests/ui/panics/panic-abort-backtrace-without-debuginfo.rs

test result: FAILED. 19958 passed; 1 failed; 328 ignored; 0 measured; 0 filtered out; finished in 1827.71s

Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-pc-nto-qnx710
Build completed unsuccessfully in 0:43:28

Exited with code exit status 1
```

This patch applies the same fix as the one found in https://github.com/rust-lang/rust/pull/143613 of adding the `default_uwtable: true` to the target.

I've run it locally, when https://github.com/ferrocene/ferrocene/pull/1803 merges we'll know it has passed within our CI, which is about a close an analog as I can offer to Rust.
2025-10-18 08:08:37 +02:00
Matthias Krüger
cb3c6edc9b
Rollup merge of #147258 - hkBst:panic-last-repeat, r=scottmcm
iter repeat: panic on last

https://github.com/rust-lang/rust/issues/146660#issuecomment-3356842371
2025-10-18 08:08:36 +02:00
Matthias Krüger
a5d38ede1d
Rollup merge of #145724 - folkertdev:track-caller-drop-no-mangle, r=fee1-dead
the `#[track_caller]` shim should not inherit `#[no_mangle]`

fixes https://github.com/rust-lang/rust/issues/143162

builds on https://github.com/rust-lang/rust/pull/143293 which introduced a mechanism to strip attributes from shims.

cc `@Jules-Bertholet` `@workingjubilee` `@bjorn3`

---

Summary:

This PR fixes an interaction between `#[track_caller]`, `#[no_mangle]`, and casting to a function pointer.

A function annotated with `#[track_caller]` internally has a hidden extra argument for the panic location. The `#[track_caller]` attribute is only allowed on `extern "Rust"` functions. When a function is annotated with both `#[no_mangle]` and `#[track_caller]`, the exported symbol has the signature that includes the extra panic location argument. This works on stable rust today:

```rust
extern "Rust" {
    #[track_caller]
    fn rust_track_caller_ffi_test_tracked() -> &'static Location<'static>;
}

mod provides {
    use std::panic::Location;
    #[track_caller] // UB if we did not have this!
    #[no_mangle]
    fn rust_track_caller_ffi_test_tracked() -> &'static Location<'static> {
        Location::caller()
    }
}
```

When a `#[track_caller]` function is converted to a function pointer, a shim is added to drop the additional argument. So this is a valid program:

```rust
#[track_caller]
fn foo() {}

fn main() {
    let f = foo as fn();
    f();
}
```

The issue arises when `foo` is additionally annotated with `#[no_mangle]`, the generated shim currently inherits this attribute, also exporting a symbol named `foo`, but one without the hidden panic location argument. The linker rightfully complains about a duplicate symbol.

The solution of this PR is to have the generated shim drop the `#[no_mangle]` attribute.
2025-10-18 08:08:36 +02:00
Matthias Krüger
b46db5c6b7
Rollup merge of #140153 - thaliaarchi:encode-wide-debug, r=ChrisDenton
Implement `Debug` for `EncodeWide`

Since `std::os::windows::ffi::EncodeWide` was reexported from `std::sys_common::wtf8::EncodeWide`, which has `#![allow(missing_debug_implementations)]` in the parent module, it did not implement `Debug`. When it was moved to `core`, a placeholder impl was added; fill it in.

This becomes insta-stable.

r? libs-api
2025-10-18 08:08:35 +02:00
bors
32892a37b4 Auto merge of #146913 - camsteffen:refactor-lint-syntax, r=fee1-dead
mismatched_lifetime_syntax lint refactors and optimizations

I found several opportunities to return early so I'm hoping those will have a perf improvement. Otherwise, it's various refactors for simplicity.
2025-10-18 03:18:09 +00:00
reddevilmidzy
a1a9113aa8 Rename "non-inline module" to "file module" in proc macro diagnostics 2025-10-18 11:54:57 +09:00
Travis Cross
73f5fe78d4 Revise Result/Option guarantee docs
The notation used here (e.g. "transmute `t: T` to `Option<T>`") felt
maybe a bit heavy, in the context of the library documentation, so
let's elaborate this a bit.

Also, in the `Option` docs, we talk about this being true for "the
following types `T`", but it felt this caveat might get a bit lost in
the next sentence that talks about the valid transmutations, so let's
reiterate the caveat.

While we're touching the line, we can improve:

> The only difference is the implied semantics:

This sentence was a bit awkward due to the mismatched plurality and
not identifying the difference being spoken to.  We'll reword this to
make it more clear.

We'll wrap to 80, since the existing text and most of the doc comments
in these files are wrapped this way.
2025-10-18 00:59:17 +00:00
bors
2170b4da84 Auto merge of #144607 - camsteffen:impl-trait-header-option, r=lcnr
Limit impl_trait_header query to only trait impls

Changes `impl_trait_header` to panic on inherent impls intstead of returning None. A few downstream functions are split into option and non-option returning functions. This gets rid of a lot of unwraps where we know we have a trait impl, while there are still some cases where the Option is helpful.

Summary of changes to tcx methods:
* `impl_is_of_trait` (new)
* `impl_trait_header` -> `impl_trait_header`/`impl_opt_trait_header`
* `impl_trait_ref` -> `impl_trait_ref`/`impl_opt_trait_ref`
* `trait_id_of_impl` -> `impl_trait_id`/`impl_opt_trait_id`
2025-10-18 00:08:18 +00:00
Ralf Jung
058f08dd78 have Result docs match ABI docs 2025-10-17 23:18:14 +00:00
Ralf Jung
781432e355 clarify 'no fields' 2025-10-17 23:18:14 +00:00
Ralf Jung
29a19f84c2 Result/Option layout guarantee clarifications 2025-10-17 23:18:14 +00:00
Camille Gillot
0b02102dc0 Attempt to compress representation. 2025-10-17 21:20:50 +00:00
bors
28fad95989 Auto merge of #142540 - cjgillot:renumber-cfg, r=fee1-dead
Pre-compute MIR CFG caches for borrowck and other analyses

I was puzzled that https://github.com/rust-lang/rust/pull/142390 introduces additional computations of CFG traversals: borrowck computes them, right?

It turns out that borrowck clones the MIR body, so doesn't share its cache with other analyses.

This PR:
- forces the computation of all caches in `mir_promoted` query;
- modifies region renumbering to avoid dropping that cache.
2025-10-17 21:01:25 +00:00
Camille Gillot
73264f21e9 Restrict drop to empty projections. 2025-10-17 21:00:12 +00:00
U. Lasiotus
2e33760daf docs: update Motor OS target docs
Update the docs to reflect that
[Motor OS std library PR](https://github.com/rust-lang/rust/pull/147000)
has been merged.
2025-10-17 13:16:14 -07:00
Shunpoco
845ff73d39 address review 2025-10-17 18:20:21 +01:00
Shunpoco
8e59e3ba33 treat an error taint from const eval lint in late_lint and check_mod_deathness
error from const eval lint causes ICE at check_pat in late_lint, because the function expects the typeck result isn't tainted by error but it is.
To avoid the ICE, check_pat returns earlier if the typeck_result is tainted.

check_mod_deathness also has an issue from the same reason. visit_body for making live symbols expects the typeck result has no error.
So this commit adds a check in visit_nested_body to avoid the ICE.
However, if visit_nested_body just returns without doing anything, all codes with the error are marked as dead, because live_symbols is empty.
To avoid this side effect, visit_nested_body and other visit_* functions in MarkSymbolVistior should return appropriate error.
If a function returns ControlFlow::Break, live_symbols_and_ignore_derived_traits returns earlier with error,
then check_mod_deathness, the caller of the function returns earlier without pushing everything into dead_codes.
2025-10-17 18:20:21 +01:00
Camille Gillot
97f88f5603 Generalize the non-freeze and needs_drop handling. 2025-10-17 16:28:37 +00:00
Jakub Beránek
ce320bb35a
Do not error out for download-rustc if LTO is configured 2025-10-17 18:15:09 +02:00
LorrensP-2158466
8492b24424 use module_child index as disambiguator for external items 2025-10-17 18:04:28 +02:00
bors
f46475914d Auto merge of #147660 - notriddle:stringdex-002, r=GuillaumeGomez
rustdoc-search: stringdex 0.0.2

Two index format tweaks that reduce the size of the standard library, compiler, and wordnet dictionary when I test it.

CC rust-lang/rust#146048

FF Profiler output: https://share.firefox.dev/4onH5xP

Preview: https://notriddle.com/rustdoc-html-demo-12/stringdex-002/std/index.html
2025-10-17 15:42:33 +00:00
Guillaume Gomez
b3bb7500b6 Add regression tests for intra-doc links 2025-10-17 15:55:28 +02:00
Osama Abdelkader
e67d502d4e Fix autodiff incorrectly applying fat-lto to proc-macro crates
When -Z autodiff=Enable is used, the compiler automatically enables
fat-lto for all crates. However, proc-macro crates cannot use fat-lto
without the -Zdylib-lto flag, causing compilation errors.

This commit modifies the lto() method in Session to exclude proc-macro
crates from fat-lto when autodiff is enabled, while preserving the
existing behavior for all other crate types.

The fix ensures that:
- Non-proc-macro crates still get fat-lto when autodiff is enabled
- Proc-macro crates are excluded from fat-lto when autodiff is enabled
- Existing autodiff functionality remains unchanged for regular crates

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
2025-10-17 16:52:55 +03:00