100 Commits
Author SHA1 Message Date
Guillaume Gomez 45592688cf Update askama version to 0.15 in generate-copyright 2025-12-28 20:49:17 +01:00
Guillaume Gomez 5c1df0d0fa Update askama version to 0.15 in citool 2025-12-28 20:47:23 +01:00
Guillaume Gomez ac5a9d8815 Update askama version to 0.15 in librustdoc 2025-12-28 20:45:28 +01:00
Guillaume Gomez c054e52bc9 Add GUI test for copying code when line numbers are displayed in code examples 2025-12-26 20:24:50 +01:00
Guillaume Gomez 7f550f6f37 Fix "copy code" button 2025-12-26 20:24:50 +01:00
Guillaume Gomez 99836fc6d4 Add GUI regression test for disabled line numbers 2025-12-26 20:13:27 +01:00
Guillaume Gomez f4e2f4991f If line number setting is disabled, do not make line numbers take space 2025-12-26 17:52:35 +01:00
Guillaume Gomez 3d92872170 Clean up utils.goml file 2025-12-26 17:20:55 +01:00
Guillaume Gomez d5b6bd87ec Merge commit '02f889aec5dc9b4e51d4cfd86c67ce5e4a0bbf72' 2025-12-21 00:13:38 +01:00
Guillaume Gomez c039edd414 Fix typo 2025-12-20 00:32:56 +01:00
Guillaume Gomez c820f46122 Generate macro expansion for rust compiler crates docs 2025-12-18 08:28:31 +01:00
Guillaume Gomez 2114b21070 Improve code by using iterator::sum instead of looping 2025-12-17 23:27:38 +01:00
Guillaume Gomez 851f1698ab Fix invalid handling of field followed by negated macro call 2025-12-17 17:06:47 +01:00
Guillaume Gomez 854f619d6a Correctly encode doc attribute metadata 2025-12-15 14:53:20 +01:00
Guillaume Gomez d025cdef7d If there are too many suggestions for malformed attribute, do not suggest them 2025-12-12 14:55:17 +01:00
Guillaume Gomez 51806323f9 Do not error if there are duplicated doc attributes 2025-12-11 01:35:28 +01:00
Guillaume Gomez 2bc2a0db69 For now, ignore target checking for doc attributes in attr_parsing 2025-12-10 20:18:42 +01:00
Guillaume Gomez fb9d3a5db4 Simplify the sorting of impls and use CSS classes instead of plain JS to show/hide implementors 2025-12-10 17:42:29 +01:00
Guillaume Gomez 13091ddc93 Make implementors list visible only when filled 2025-12-10 16:18:22 +01:00
Guillaume Gomez 985178dacf Add GUI test to ensure that negative impls are correctly sorted 2025-12-10 16:18:22 +01:00
Guillaume Gomez 450916305f Put negative implementors first and apply same ordering logic to foreign implementors 2025-12-10 16:18:20 +01:00
Guillaume Gomez 4d697d2433 Remove "tidy" tool for tests/rustdoc testsuite 2025-12-10 16:16:13 +01:00
Guillaume Gomez 9fdec8194e Fix new merge conflict 2025-12-10 12:35:17 +01:00
Guillaume Gomez 503b34ab0d Update clippy code 2025-12-10 12:28:08 +01:00
Guillaume Gomez 3ea9462167 Remove Cfg::matches and use eval_config_entry instead 2025-12-10 12:28:08 +01:00
Guillaume Gomez 64aaeacd71 Update to new API, allowing to remove check_doc_cfg.rs file from librustdoc 2025-12-10 12:28:08 +01:00
Guillaume Gomez 40907f522d Fix doc alias suggestion 2025-12-10 12:28:08 +01:00
Guillaume Gomez 6230b56eaa Update clippy code 2025-12-10 12:28:08 +01:00
Guillaume Gomez 4191e94715 Improve spans for auto_cfg(hide/show) errors 2025-12-10 12:28:08 +01:00
Guillaume Gomez 1da7684c7d Improve code and add more comments 2025-12-10 12:28:07 +01:00
Guillaume Gomez 06238bd93e Update rustdoc JSON output to new attribute API 2025-12-10 12:28:07 +01:00
Guillaume Gomez 2340f8054c Update to new lint API 2025-12-10 12:28:07 +01:00
Guillaume Gomez 8d4f59bed7 Clean up code 2025-12-10 12:28:07 +01:00
Guillaume Gomez 348d9d98e0 Correctly iterate doc comments in intra-doc resolution in rustc_resolve 2025-12-10 12:28:07 +01:00
Guillaume Gomez 4936973d49 Fix ui tests 2025-12-10 12:28:05 +01:00
Guillaume Gomez e013f772da Update clippy code to new doc attribute API 2025-12-10 12:27:34 +01:00
Guillaume Gomez aa3bf6fde9 Update rustc_resolve unit tests 2025-12-10 12:27:34 +01:00
Guillaume Gomez a36c462fb8 Update clippy code to new doc attribute API 2025-12-10 12:27:34 +01:00
Guillaume Gomez 3fa499bab0 Sort fluent messages 2025-12-10 12:27:34 +01:00
Guillaume Gomez e4f57dd4b3 Finish fixing ui tests 2025-12-10 12:27:34 +01:00
Guillaume Gomez d1277ccffa Update check_doc_cfg pass in rustdoc, remove old rustc_attr_parsing::cfg_matches API 2025-12-10 12:27:34 +01:00
Guillaume Gomez 9c8c67bfdd Fix warning messages 2025-12-10 12:27:34 +01:00
Guillaume Gomez 976d45452a Update rustdoc unit tests 2025-12-10 12:27:34 +01:00
Guillaume Gomez 5c47240ad1 Correctly handle doc(test(attr(...))) 2025-12-10 12:27:34 +01:00
Guillaume Gomez 57870b7242 Fix doc(auto_cfg) attribute parsing 2025-12-10 12:27:34 +01:00
Guillaume Gomez d35ec316c5 Keep a list of CfgEntry instead of just one 2025-12-10 12:27:33 +01:00
Guillaume Gomez 368a103902 Fix Cfg add/or operations 2025-12-10 12:27:33 +01:00
Guillaume Gomez 92edc499a6 Correctly handle doc items inlining 2025-12-10 12:27:33 +01:00
Guillaume Gomez 148e522112 Correctly differentiate between sugared and raw doc comments 2025-12-10 12:27:33 +01:00
Guillaume Gomez 04bcd83eb5 Move doc = "" parsing out of DocParser to keep doc attributes order 2025-12-10 12:27:33 +01:00
Guillaume Gomez 131323f910 Migrate doc(cfg) to new Attribute API 2025-12-10 12:27:33 +01:00
Guillaume Gomez acb32df7b1 Continue migration to new Attribute API for doc attribute 2025-12-10 12:27:33 +01:00
Guillaume Gomez 06500aa2dd Add message when running clippy with --no-default-features for cg_gcc 2025-12-09 17:59:24 +01:00
Guillaume Gomez e6143962f9 Fix clippy lint in cg_gcc 2025-12-09 16:26:10 +01:00
Guillaume Gomez 4501327be4 Fix clippy lint in cg_gcc 2025-12-09 16:26:10 +01:00
Guillaume Gomez 4c6544b06e Run clippy both with and without default features on the GCC backend 2025-12-09 14:52:15 +01:00
Guillaume Gomez 897099e693 Regenerate intrinsics 2025-12-04 17:53:01 +01:00
Guillaume Gomez 701b9ba0fb Merge commit 'dab6863ce82346cf56c88b6f90a146200358207f' into subtree-update_cg_gcc_2025-12-04 2025-12-04 14:53:08 +01:00
Guillaume Gomez 94f1bfe1fc Merge commit 'dab6863ce82346cf56c88b6f90a146200358207f' into subtree-update_cg_gcc_2025-12-04 2025-12-04 14:53:08 +01:00
Guillaume Gomez 110649f0a8 Fix display of dropdown menu "buttons" 2025-11-28 13:09:08 +01:00
Guillaume Gomez f94e90f01c Remove outdated comment for libgccjit.so.0 2025-11-27 20:11:19 +01:00
Guillaume Gomez c939e90a6d Remove the extra .0 at the end of the libgccjit.so file 2025-11-27 17:59:48 +01:00
Guillaume Gomez 8059907cef Update GCC submodule 2025-11-26 20:11:43 +01:00
Guillaume Gomez 15b6fde930 Update GCC submodule 2025-11-26 20:11:43 +01:00
Guillaume Gomez a7ea98bf2c Update GCC commit 2025-11-26 19:43:53 +01:00
Guillaume Gomez 9776f45265 Update GCC commit 2025-11-26 19:43:53 +01:00
Guillaume Gomez 2af849a6e5 Merge commit '55171cfa8b53970e06dcd2f5f2e2b8d82eeb0885' into subtree-update_cg_gcc_2025-11-26 2025-11-26 19:41:43 +01:00
Guillaume Gomez 9fce61b21b Merge commit '55171cfa8b53970e06dcd2f5f2e2b8d82eeb0885' into subtree-update_cg_gcc_2025-11-26 2025-11-26 19:41:43 +01:00
Guillaume Gomez 53dcfce670 Update gccjit dependency 2025-11-26 14:33:14 +01:00
Guillaume Gomez 3181c21b6c Improve variable naming 2025-11-24 17:01:32 +01:00
Guillaume Gomez a21affabf8 Fix invalid link generation for type alias methods 2025-11-24 17:01:32 +01:00
Guillaume Gomez c524ed710d Make more functions return fmt::Result and reduce number of .unwrap() calls 2025-11-24 11:41:03 +01:00
Guillaume Gomez 228b49e791 Rollup merge of #149151 - mu001999-contrib:test/use-path-kw, r=petrochenkov
Add test for importing path-segment keyword

Adding new test to make a snapshot of current compiler's behavior. See https://github.com/rust-lang/rust/pull/146972#issuecomment-3532148571

r? `@petrochenkov`
2025-11-21 21:34:29 +01:00
Guillaume Gomez b2f5cc7827 Rollup merge of #149098 - Jamesbarford:fix/148919-tuple-struct-lint, r=JonathanBrouwer
Fix error message for calling a non-tuple struct

This feels a bit odd checking for `"0"` but I can't see how else to check for it being a Tuple

closes https://github.com/rust-lang/rust/issues/148919
2025-11-21 21:34:28 +01:00
Guillaume Gomez 629a283b98 Rollup merge of #149043 - aDotInTheVoid:is-this-real-is-this-out-of-spite-does-it-matter, r=GuillaumeGomez
rustdoc-json: add rlib path to ExternalCrate to enable robust crate resolution

Historically, it's not been possible to robustly resolve a cross-crate item in rustdoc-json. If you had a `Id` that wasn't in `Crate::index` (because it was defined in a different crate), you could only look it up it `Crate::paths`. But there, you don't get the full information, only an `ItemSummary`. This tells you the `path` and the `crate_id`.

But knowing the `crate_id` isn't enough to be able to build/find the rustdoc-json output with this item. It's only use is to get a `ExternalCrate` (via `Crate::external_crates`). But that only tells you the `name` (as a string). This isn't enough to uniquely identify a crate, as there could be multiple versions/features [^1] [^2].

This was originally proposed to be solved via `@LukeMathWalker's` `--orchestrator-id` proposal (https://github.com/rust-lang/compiler-team/issues/635). But that requires invasive changes to cargo/rustc. This PR instead implements `@Urgau's` proposal to re-use the path to a crate's rmeta/rlib as a unique identifer. Callers can use that to determine which package it corresponds to in the language of the build-system above rustc. E.g. for cargo, `cargo rustdoc --message-format=json --output-format=json -Zunstable-options`).

(Once you've found the right external crate's rustdoc-json output, you still need to resolve the path->id in that crate. But that's """just""" a matter of walking the module tree. We should probably still make that nicer (by, for example, allowing sharing `Id`s between rustdoc-json document), but that's a future concern)

For some notes from RustWeek 2025, where this was designed, see https://hackmd.io/0jkdguobTnW7nXoGKAxfEQ

CC `@obi1kenobi` (who wants this for cargo-semver-checks [^3]), `@epage` (who's conversations on what and wasn't possible with cargo informed taking this approach to solve this problem)

r? `@GuillaumeGomez`

## TODO:

- [x] Docs: [Done](https://github.com/rust-lang/rust/compare/e4cdd0c24a994fed354081b5f907680a11f2ddc5..457ed4edb184997d5d6f879c6a220bc4d69ff6fd)
- [x] Tests: [Done](https://github.com/rust-lang/rust/compare/2e1b954dc52bf7e5a6e9311394df760db37d383f..4d00c1a7ee5e03d1e78801cc01a85dac08ab603b)

[^1]: https://github.com/rust-lang/compiler-team/issues/635#issue-1714254865 § Problem
[^2]: https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/Identifying.20external.20crates.20in.20Rustdoc.20JSON/with/352701211
[^3]: https://github.com/obi1kenobi/cargo-semver-checks/issues/638
2025-11-21 21:34:26 +01:00
Guillaume Gomez 110471b229 Rollup merge of #149028 - GuillaumeGomez:unify-anchor, r=lolbinarycat
[rustdoc] Remove `UrlFragment::render` method to unify `clean::types::links` and `anchor`

Fixes https://github.com/rust-lang/rust/issues/148648.
First part of https://github.com/rust-lang/rust/issues/148547.

The last part will be about handle `AssocItemLink` differently (either remove it or change how we do it).

r? `@lolbinarycat`
2025-11-21 21:34:25 +01:00
Guillaume Gomez 8d66eb5001 Rollup merge of #148795 - karolzwolak:rustflags-bootstrap-toml, r=Kobzol
add `rust.rustflags` and per target `rustflags` options to `bootstrap.toml`

Part of rust-lang/rust#148782; see also rust-lang/rust#148708

Add new options `rust.rustflags` for all targets and `rustflags` par target that will pass specified flags to rustc for all stages. Target specific flags override (are passed after) global `rust.rustflags` ones.

This makes easy to persistently pass any flag to the compiler when building rustc. For example you can use a different linker by putting the following in `bootstrap.toml`:
```toml
[rust]
rustflags = ["-Clinker=clang", "-Clink-arg=--ld-path=wild"]
```
r? bootstrap
2025-11-21 21:34:24 +01:00
Guillaume Gomez 60ed1ab0ec Rollup merge of #148719 - Nadrieril:poly-drop-glue, r=saethlin
Allow unnormalized types in drop elaboration

I work on a [rustc driver](https://github.com/AeneasVerif/charon) that aims to extract the full polymorphic MIR of a crate. Currently the one thing I can't get is drop glue because it fails on unnormalizable types like the fields of `Cow` or `NonZero`.

This PR removes the one check for unnormalized types in drop elaboration. It's a `span_delay_bug` so only there to help catch mistakes. I think that's fine to remove? If something downstream relies on types being normalized the right approach is for MIR validation to check for normalized types, not that one random check.
2025-11-21 21:34:23 +01:00
Guillaume Gomez 33d11ef7b1 Rollup merge of #146978 - mu001999-contrib:fix/path-kw-as-cfg-pred, r=petrochenkov
Emit error when using path-segment keyword as cfg pred

Fixes rust-lang/rust#146968

Emit error `CfgPredicateIdentifier` if the word is path-segment keyword.

Detailed change description - https://github.com/rust-lang/rust/pull/146978#issuecomment-3437353950.

r? petrochenkov
2025-11-21 21:34:22 +01:00
Guillaume Gomez 8f76773041 Return impl Display instead of String in fragment 2025-11-21 19:49:19 +01:00
Guillaume Gomez a5f972ec47 Remove UrlFragment::render method to unify clean::types::links and anchor 2025-11-18 18:30:47 +01:00
Guillaume Gomez e9ed626090 Add support for variant fields in rustdoc::html::format::print_anchor 2025-11-18 18:30:47 +01:00
Guillaume Gomez f6cfdd93a5 Remove one DOM level for lint name filter input and controls 2025-11-18 15:32:10 +01:00
Guillaume Gomez 1e0ed3ee77 Remove one DOM level for filters menu 2025-11-18 15:20:46 +01:00
Guillaume Gomez 6120f0d54b Rollup merge of #149049 - Zalathar:only-elf, r=clubby789
compiletest: Use JSON "binary-format" to decide `//@ only-elf` and `//@ ignore-elf`

Some tests only apply to ELF targets, or want to enable different test revisions for ELF and non-ELF targets. So compiletest supports the `//@ only-elf` and `//@ ignore-elf` directives to make that possible.

Historically, deciding whether the current target is an ELF target relied on a handful of ad-hoc string comparisons against the target tuple.

However, nowadays compiletest has access to the output of `--print=all-target-specs-json`, and that JSON output specifies the binary format of each target, making it much easier to determine whether a target is ELF or not.
2025-11-18 14:14:40 +01:00
Guillaume Gomez 1fd16b19fc Rollup merge of #149026 - GuillaumeGomez:test-for-reexported-variant, r=lolbinarycat
Add test for href of reexported enum variant

Working on https://github.com/rust-lang/rust/issues/148648 and realized that we actually didn't test for enum variants reexports, so here we are.

I also think I'll do rust-lang/rust#148648 at the same time as https://github.com/rust-lang/rust/issues/148547.

r? `@lolbinarycat`
2025-11-18 14:14:39 +01:00
Guillaume Gomez abf6d307ae Rollup merge of #149020 - RalfJung:flush_delayed, r=nnethercote
flush_delayed: add note about stashed diagnostics

r? `@nnethercote`
Is `emit_stashed_diagnostics` the right advice to give? The other option seems to be to call `finish_diagnostics`. That's what I ended up doing (for now) in https://github.com/rust-lang/miri/pull/4702 because it best matches what happens during normal compilation.
2025-11-18 14:14:39 +01:00
Guillaume Gomez ff262bcb29 Rollup merge of #148970 - Ayush1325:uefi-fs-stat, r=joboet
std: sys: fs: uefi: Implement stat

- Implement std::fs::metadata function.
- Tested on qemu ovmf
2025-11-18 14:14:38 +01:00
Guillaume Gomez d7064dcea9 Improve display of "no script" warning 2025-11-18 14:13:10 +01:00
Guillaume Gomez 8642d82ff5 Add test for href of reexported enum variant 2025-11-18 12:23:32 +01:00
Guillaume Gomez 2a1bd47a4a Move tests/rustdoc/import_trait_associated_functions.rs into the reexport folder 2025-11-18 12:23:32 +01:00
Guillaume Gomez 044245c6c8 Add regression test for #148008 2025-11-13 15:34:49 +01:00
Guillaume Gomez 101ef2bf81 Correctly link to associated trait items in reexports 2025-11-13 15:34:47 +01:00
Guillaume Gomez 866de5fdcc Ignore tests/ui/lto/lto-global-allocator.rs for GCC backend 2025-11-13 15:23:14 +01:00
Guillaume Gomez 4d3d3b39bd Improve code 2025-11-11 18:45:36 +01:00
Guillaume Gomez f4e1ffc55e Add missing documentation 2025-11-11 17:41:17 +01:00
Guillaume Gomez dacabcd20d Update jump to def macro link generation test 2025-11-11 17:41:17 +01:00
Guillaume Gomez 04f798b83a Fix invalid jump to def macro link generation 2025-11-11 17:41:17 +01:00
Guillaume Gomez 66b4e93ba8 Add instructions on what to do in case casts other than to integers is ever working for function pointers 2025-11-10 20:44:33 +01:00
Guillaume Gomez 1839cdb167 Remove unneeded allow(rustc::potential_query_instability) 2025-11-10 16:39:45 +01:00