Commit Graph

322597 Commits

Author SHA1 Message Date
Shagun Agrawal 9d96a269bf Re-use existing Fira(Sans) license for Mono fonts 2026-04-06 16:52:33 +05:30
Shagun Agrawal 29d70d4dc2 Update license-metadata with FiraMono license 2026-04-04 20:42:45 +05:30
Shagun Agrawal e7a00dfa67 Update Fira Mono License Information 2026-04-04 19:40:57 +05:30
bors 2972b5e59f Auto merge of #152369 - Bryntet:lint_attrs, r=JonathanBrouwer,jdonszelmann
Port lint attributes to attribute parser

*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/152369)*

Tracking issue: rust-lang/rust#131229

Ports `#[allow]`, `#[deny]`, `#[expect]`, `#[forbid]`, and `#[warn]` to being parsed attrs

I tried my best to make this PR as small as possible, it was difficult. I hope it isn't too difficult to review

r? @JonathanBrouwer 
r? @jdonszelmann
2026-04-03 13:51:50 +00:00
bors f908263775 Auto merge of #154746 - matthiaskrgr:rollup-uWUN35u, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#154696 (rustdoc_missing_doc_code_examples: lint on macro_rules macros)
 - rust-lang/rust#154698 (Improve workings of the `desc` query modifier and custom query cycle handlers)
 - rust-lang/rust#154713 (Stop compiling when we get resolving crate failure)
 - rust-lang/rust#154736 (Add a regression test for the duplicated `crate` keyword in path suggestions)
 - rust-lang/rust#154739 (ci: update upload-artifact action to v7)
 - rust-lang/rust#154741 (Enforce `#![warn(unreachable_pub)]` in compiletest source)

Failed merges:

 - rust-lang/rust#154605 (Make `span_suggestions` always verbose)
2026-04-03 10:41:16 +00:00
Jonathan Brouwer ce7c492589 fix rebase 2026-04-03 11:12:15 +02:00
Edvin Bryntesson 852df886fa deduplicate unused expect lints 2026-04-03 11:08:11 +02:00
Edvin Bryntesson bcebd2c909 don't parse attributes in pre-expansion lints
also buffer any lints coming from pre-expansion, so that they are
emitted with proper lint level
2026-04-03 11:08:11 +02:00
Edvin Bryntesson bd864efa70 bless tests and tidy
also removes E0452 and splits
`tests/rustdoc-ui/lints/renamed-lint-still-applies` into 2 tests

this is because of delayed warn lint being lost on compiler aborting on
error
2026-04-03 11:08:11 +02:00
Edvin Bryntesson d884f92b04 integrate parsed lint attrs into clippy 2026-04-03 11:08:10 +02:00
Edvin Bryntesson 345a3eb08b Port #[allow], #[deny], #[expect], #[forbid], #[warn] to attr parser
also changes method `parse_limited_all` to take Iterator as an input,
to avoid needing to do expensive allocation
2026-04-03 11:08:10 +02:00
Edvin Bryntesson cd88c395c8 make lint_index mandatory in LintExpectationId
also add attr_id to `Stable` variant directly, instead of having to
iterate over all the attrs on the hir_id to find it
2026-04-03 11:08:10 +02:00
Edvin Bryntesson 0fa6b55198 Decouple CheckLintNameResult from rustc_lint 2026-04-03 11:08:10 +02:00
Edvin Bryntesson 58168028f9 add field attr_id to attr parser's AcceptContext 2026-04-03 11:08:10 +02:00
Edvin Bryntesson 4ab05bc659 make tools on AttributeParser hold reference to RegisteredTools 2026-04-03 11:08:10 +02:00
Edvin Bryntesson 3f34c31af9 add variant ExpectedNameValueAsLastArgument to AttributeParseErrorReason 2026-04-03 11:08:06 +02:00
Matthias Krüger 1dd0f3565c Rollup merge of #154741 - Zalathar:unreachable-pub, r=jieyouxu
Enforce `#![warn(unreachable_pub)]` in compiletest source

The actual public API surface of compiletest is restricted to two specific modules, `cli` and `rustdoc_gui_test`.

Other items have no reason to be `pub`.

There should be no change to compiletest behaviour.
2026-04-03 09:30:20 +02:00
Matthias Krüger c2d0094e65 Rollup merge of #154739 - xtqqczze:GH154738, r=jieyouxu
ci: update upload-artifact action to v7

Closes https://github.com/rust-lang/rust/issues/154738
2026-04-03 09:30:19 +02:00
Matthias Krüger 85c072edf4 Rollup merge of #154736 - jakubadamw:issue-115858, r=chenyukang
Add a regression test for the duplicated `crate` keyword in path suggestions

The issue has (long) been fixed, but needs a test.

Closes rust-lang/rust#115858.
2026-04-03 09:30:19 +02:00
Matthias Krüger c0c22d1eb6 Rollup merge of #154713 - chenyukang:yukang-fix-154096-missing-crate-noise, r=kivooeo
Stop compiling when we get resolving crate failure

Fixes rust-lang/rust#154096

closes rust-lang/rust#118130
2026-04-03 09:30:18 +02:00
Matthias Krüger 4cb5357438 Rollup merge of #154698 - nnethercote:rm-desc-cache-modules-2, r=Zalathar
Improve workings of the `desc` query modifier and custom query cycle handlers

This PR does two things involving query modifiers.
- It changes how the `desc` query modifier is handled, eliminating the generated `_description_fns` module.
- It adds a new `handle_cycle_error` query modifier for queries that do custom cycle handling.

Details are in the individual commits.

r? @Zalathar
2026-04-03 09:30:17 +02:00
Matthias Krüger 7a740135c2 Rollup merge of #154696 - lolbinarycat:rustdoc-missing_doc_code_examples-macro_rules, r=GuillaumeGomez
rustdoc_missing_doc_code_examples: lint on macro_rules macros

part of rust-lang/rust#154640

accidentally built this on top of rust-lang/rust#154644, but since that PR is already approved it should be fine if we just wait for it to be merged.

r? @GuillaumeGomez
2026-04-03 09:30:17 +02:00
bors 5bbdeaa9a8 Auto merge of #154740 - jhpratt:rollup-ovaeVhE, r=jhpratt
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#154444 (rustdoc ICE fix: When collecting `Deref` impls with their targets, skip the negative ones)
 - rust-lang/rust#154590 (Make #[cfg] suggest any or all on #[cfg(a, b)])
 - rust-lang/rust#154691 (core: Update the feature gate on `TryFrom<integer> for bool`)
 - rust-lang/rust#154697 (rustdoc: fix href of extern crates in search results)
 - rust-lang/rust#154728 (rustdoc: Improve internal function name)
 - rust-lang/rust#154732 (fix(std): avoid AT_MINSIGSTKSZ on uclibc targets)

Failed merges:

 - rust-lang/rust#154722 (fix(lints): Improve `ill_formed_attribute_input` with better help message)
2026-04-03 04:04:25 +00:00
Nicholas Nethercote 15c6e6e092 Add a handle_cycle_error query modifier.
This modifier indicates that a query has a custom handler for cycles.
That custom handler must be found at
`rustc_query_impl::handle_cycle_error::$name`.

This eliminates the need for `specialize_query_vtables`, which is the
current hack to install custom handlers. It's more lines of code in
total, but indicating special treatment of a query via a modifier in
`queries.rs` is more consistent with how other aspects of queries are
handled.
2026-04-03 13:44:12 +11:00
Nicholas Nethercote d913766757 Remove the _description_fns module.
`rustc_queries` generates a macro and two modules. One of the modules
looks like this:
```
mod _description_fns {
    ...

    #[allow(unused_variables)]
    pub fn hir_module_items<'tcx>(tcx: TyCtxt<'tcx>, key: LocalModDefId) -> String {
	format!("getting HIR module items in `{}`", tcx.def_path_str(key))
    }

    ...
}
```
Members of this module are then used in `TaggedQueryKey::description`.

This commit removes the `_description_fns` module entirely. For each
query we now instead generate a description closure that is used
instead. This closure is passed in the modifiers list.

This change simplifies `rustc_queries` quite a bit. It requires adding
another query modifier, but query modifiers are how other query-specific
details are already passed to the declarative macros, so it's more
consistent.
2026-04-03 13:44:10 +11:00
Nicholas Nethercote aebce4c73f Process query modifiers in alphabetical order everywhere. 2026-04-03 13:10:55 +11:00
Nicholas Nethercote b651ab0d6c Add a useful comment.
I previously tried to remove this field because it seemed useless.
2026-04-03 13:10:55 +11:00
Zalathar 14c7788a16 Enforce #![warn(unreachable_pub)] in compiletest source 2026-04-03 12:53:48 +11:00
yukang cd95593755 ignore compiler injected crate loading failure 2026-04-03 09:16:26 +08:00
Jacob Pratt 53af5aba8f Rollup merge of #154732 - xtqqczze:GH154679, r=tgross35
fix(std): avoid AT_MINSIGSTKSZ on uclibc targets

Closes https://github.com/rust-lang/rust/issues/154679

`AT_MINSIGSTKSZ` is not defined on uclibc.

r? @tgross35
2026-04-02 20:53:34 -04:00
Jacob Pratt 325340ea91 Rollup merge of #154728 - aDotInTheVoid:doc-cfgz-nuts-gotem, r=GuillaumeGomez
rustdoc: Improve internal function name

This functions name totally contradicted what it did. And the only places it was used immediatly `!`ed it. Push the `!` into the function, and rename it to make sense.

Should hopefully result in less head-scratching next time someone looks at this.

r? @GuillaumeGomez
2026-04-02 20:53:34 -04:00
Jacob Pratt 6f336f9732 Rollup merge of #154697 - lolbinarycat:rustdoc-renamed-crate, r=GuillaumeGomez
rustdoc: fix href of extern crates in search results

To avoid modifying the search index, I instead overloaded an existing field that is always unused for extern crate items.

fixes rust-lang/rust#148300

r? @GuillaumeGomez
2026-04-02 20:53:33 -04:00
Jacob Pratt e1cd0ad490 Rollup merge of #154691 - tgross35:bool-try-from-int, r=cuviper
core: Update the feature gate on `TryFrom<integer> for bool`

This implementation was added recently in f12288ec26 ("TryFrom<integer> for bool") but used an old feature gate and stabilization version. Update to reflect when these were actually added.
2026-04-02 20:53:33 -04:00
Jacob Pratt 62a9658ca5 Rollup merge of #154590 - scrabsha:push-xzmtpsntoxwm, r=jdonszelmann
Make #[cfg] suggest any or all on #[cfg(a, b)]
2026-04-02 20:53:32 -04:00
Jacob Pratt e5e3c25df2 Rollup merge of #154444 - jakubadamw:issue-128801, r=fmease
rustdoc ICE fix: When collecting `Deref` impls with their targets, skip the negative ones

rustdoc assumed every `Deref` impl has an associated `Target` type, but negative impls (e.g. `impl !Deref for T {}`) have none.

Skip them in both the trait-impl collection pass and the HTML render pass to avoid panicking on the missing `Target`.

Closes rust-lang/rust#128801.
2026-04-02 20:53:31 -04:00
xtqqczze 8798ba6943 ci: update upload-artifact action to v7 2026-04-03 01:24:33 +01:00
Jacob Adam e2461cf2ad Add a regression test for the duplicated crate keyword in path suggestions 2026-04-02 23:59:33 +01:00
xtqqczze b0c4b6ef46 fix(std): avoid AT_MINSIGSTKSZ on uclibc targets 2026-04-02 23:03:28 +01:00
Alona Enraght-Moony e469da4f84 rustdoc: Improve internal function name
This functions name totally contradicted what it did. And the only
places it was used immediatly `!`ed it. Push the `!` into the function,
and rename it to make sense.

Should hopefully result in less head-scratching next time someone looks
at this.
2026-04-02 21:03:25 +00:00
bors 55e86c9968 Auto merge of #154727 - JonathanBrouwer:rollup-I3Rg5V6, r=JonathanBrouwer
Rollup of 20 pull requests

Successful merges:

 - rust-lang/rust#153105 (Compute the result of a projection type with region errors)
 - rust-lang/rust#153532 (Attributes containing rustc)
 - rust-lang/rust#153960 (Make `layout_of` cycles fatal errors)
 - rust-lang/rust#154527 (Emit pre-expansion feature gate warnings for negative impls and specialization)
 - rust-lang/rust#154666 (Remove `StableHashContext` impls)
 - rust-lang/rust#154669 (Introduce #[diagnostic::on_move] on `Arc`)
 - rust-lang/rust#154710 (opaque_generic_const_args -> generic_const_args)
 - rust-lang/rust#154712 (Revert "`-Znext-solver` Remove the forced ambiguity hack from search graph")
 - rust-lang/rust#153614 (`FindParamInClause` handle edge-cases)
 - rust-lang/rust#154213 (tidy-alphabetical: fix line number in error message)
 - rust-lang/rust#154425 (Migrate transmute tests)
 - rust-lang/rust#154442 (Export `derive` at the crate root: `core::derive` and `std::derive`)
 - rust-lang/rust#154469 (mGCA: Lower spans for literal const args)
 - rust-lang/rust#154578 (Rename `probe_ty_var` to `try_resolve_ty_var`)
 - rust-lang/rust#154615 (Moving issues)
 - rust-lang/rust#154644 (rustdoc: seperate methods and associated functions in sidebar)
 - rust-lang/rust#154660 (Avoid creating async return opaques for foreign async fns)
 - rust-lang/rust#154671 (Add a test for a past ICE when calling a const fn of an unresolved type with the wrong number of args)
 - rust-lang/rust#154680 ([rustdoc] Replace `DocContext` with `TyCtxt` wherever possible)
 - rust-lang/rust#154709 (Revert `Ty` type alias in `rustc_type_ir`)
2026-04-02 20:14:41 +00:00
Jonathan Brouwer d9e0301801 Rollup merge of #154709 - Jamesbarford:chore/revert-ty-type-alias, r=lcnr
Revert `Ty` type alias in `rustc_type_ir`

Reverting (rust-lang/rust#154270) the creation and use of `Ty` type alias in `rustc_type_ir` that was causing problems with Rust Analyser, see [discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/.23154270.20.28Ty.20alias.29.20triggers.20many.20bogus.20RA.20errors/with/583209227) for more

r? @lcnr
2026-04-02 22:13:58 +02:00
Jonathan Brouwer a788dd0f4c Rollup merge of #154680 - GuillaumeGomez:doccontext-cleanup, r=Urgau
[rustdoc] Replace `DocContext` with `TyCtxt` wherever possible

In a lot of places, we pass down `DocContext` but actually only use its `tcx` field (`TyCtxt`). To make it more obvious what's actually being done, I replaced `DocContext` with `TyCtxt` (which implements `Copy`) in the function arguments. It created quite the cascade effect so I ended up with a lot more changes I expected.

Because it's a lot of changes, I made small commits which are easy to go through, so I strongly recommend reviewing this PR one commit at a time.

r? @Urgau
2026-04-02 22:13:58 +02:00
Jonathan Brouwer 39ba2cd294 Rollup merge of #154671 - jakubadamw:issue-127423, r=Kivooeo
Add a test for a past ICE when calling a const fn of an unresolved type with the wrong number of args

The ICE is fixed, but there needs to be a regression test for it.

Closes rust-lang/rust#127423.
2026-04-02 22:13:57 +02:00
Jonathan Brouwer ce8a3e0a85 Rollup merge of #154660 - mu001999-contrib:fix/146754, r=Kivooeo
Avoid creating async return opaques for foreign async fns

Fixes https://github.com/rust-lang/rust/issues/146754

Previously, def collection created the desugared async return opaque for foreign `async fn` items, but AST lowering won't lower that opaque for foreign items. That left a `DefId` without a corresponding HIR owner, which later caused an ICE during analysis.
2026-04-02 22:13:57 +02:00
Jonathan Brouwer 878c36b3e9 Rollup merge of #154644 - lolbinarycat:rustdoc-sidebar-assoc-items, r=GuillaumeGomez
rustdoc: seperate methods and associated functions in sidebar

fixes rust-lang/rust#154602

r? @fmease

before:
<img width="340" height="591" alt="image" src="https://github.com/user-attachments/assets/79268155-5260-4bb9-a826-46f459fc81eb" />

after:
<img width="514" height="588" alt="image" src="https://github.com/user-attachments/assets/b56b5ca6-28d7-45a7-86a9-ad6bf37f608a" />

example of type with both (`Box`):
<img width="410" height="760" alt="image" src="https://github.com/user-attachments/assets/a74dd536-e931-4d8f-af95-275bfcf48285" />
2026-04-02 22:13:56 +02:00
Jonathan Brouwer 0b7a11ff96 Rollup merge of #154615 - aryannrd:moving-issues, r=Kivooeo
Moving issues
2026-04-02 22:13:56 +02:00
Jonathan Brouwer 1c155950d7 Rollup merge of #154578 - jdonszelmann:rename-probe, r=lcnr,boxyuwu
Rename `probe_ty_var` to `try_resolve_ty_var`

r? @lcnr
2026-04-02 22:13:55 +02:00
Jonathan Brouwer 2eb2c90148 Rollup merge of #154469 - reddevilmidzy:mgca-lower, r=BoxyUwU
mGCA: Lower spans for literal const args

resolve: https://github.com/rust-lang/rust/issues/152653
resolve: https://github.com/rust-lang/rust/issues/154636
2026-04-02 22:13:54 +02:00
Jonathan Brouwer f0ce20c438 Rollup merge of #154442 - nik-contrib:derive-root, r=jhpratt
Export `derive` at the crate root: `core::derive` and `std::derive`

This PR makes the `derive` macro available at the crate root:

```rust
#[std::derive(Clone)]
#[core::derive(Copy)]
struct X;
```

ACP: https://github.com/rust-lang/libs-team/issues/766

Tracking issue: https://github.com/rust-lang/rust/issues/154645
2026-04-02 22:13:54 +02:00
Jonathan Brouwer d7d8255d50 Rollup merge of #154425 - ujjwalvishwakarma2006:migrate-transmute-tests, r=Kivooeo,Teapot4195
Migrate transmute tests

I have made the following changes in this PR:

- `tests/ui/issues/issue-23477.rs` ➝ `tests/ui/transmute/transmute-slice-to-dst.rs`
- `tests/ui/issues/issue-28625.{rs,stderr}` ➝ `tests/ui/transmute/transmute-associated-type-to-slice.{rs,stderr}`

The reason I changed the trait name from `trait Bar` to `trait MyTrait` and `type Bar` to `type MyType` is that the same name (i.e., `Bar`) for the trait and associated type was making it harder to follow the test. It was confusing for me, at least.

r? Kivooeo
2026-04-02 22:13:53 +02:00