Skip to content

Small refactorings in need_type_info module#159002

Merged
rust-bors[bot] merged 6 commits into
rust-lang:mainfrom
WaffleLapkin:need_type_info_refactors
Jul 13, 2026
Merged

Small refactorings in need_type_info module#159002
rust-bors[bot] merged 6 commits into
rust-lang:mainfrom
WaffleLapkin:need_type_info_refactors

Conversation

@WaffleLapkin

Copy link
Copy Markdown
Member

r? @lcnr

This supports low priority impl diagnostic.

There is only one place where `SourceKindSubdiag` is used without
`SourceKindMultiSuggestion`; it doesn't seem useful to distinguish
between them (I have no idea what either of the names means tbh)
@rustbot

rustbot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in need_type_info.rs

cc @lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 9, 2026
};

if !have_turbofish {
let suggestion = have_turbofish.not().then(|| {

@lcnr lcnr Jul 13, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would you be fine with just using an if else here

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do prefer .then as imo it makes it more clearer when exactly is suggestion Some. That being said, an if is also fine, changed the code to use it.

@lcnr

lcnr commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

r=me after nit :>

@WaffleLapkin
WaffleLapkin force-pushed the need_type_info_refactors branch from 4b19bc6 to 2aa1ae4 Compare July 13, 2026 11:58
This makes it clear that (what used to be called) `GenericLabel` and
other generic variants are related -- the latter are suggestions, which
can sometimes be present in *addition* to the label.

Although this mainly helps future cleanups.
This simplifies things a bunch, as we don't need any mutable state to
track subdiagnostics now. Also, this makes it clearer which diagnostics
are possible.
@WaffleLapkin
WaffleLapkin force-pushed the need_type_info_refactors branch from 2aa1ae4 to 4706067 Compare July 13, 2026 12:07
@WaffleLapkin

Copy link
Copy Markdown
Member Author

@bors r=lcnr

@rust-bors

rust-bors Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 4706067 has been approved by lcnr

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 13, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 13, 2026
…ors, r=lcnr

Small refactorings in `need_type_info` module

r? @lcnr

This supports low priority impl diagnostic.
rust-bors Bot pushed a commit that referenced this pull request Jul 13, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #159039 (resolve: fix effective visibilities for items in ambiguous glob sets)
 - #157706 (Deny `todo!()` in tidy)
 - #156712 (Pointer authentication config and user facing options)
 - #158535 (Support `#[track_caller]` on EII declarations)
 - #158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder))
 - #159002 (Small refactorings in `need_type_info` module)
 - #159202 (Bump rustc-demangle to 0.1.28)
 - #159216 (Avoid using probe self_ty for delegation arguments)
 - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too)
 - #156609 (Consider structurally impossible Sized predicates in MIR)
 - #158854 (Add `#[rustc_test_entrypoint_marker]`)
 - #158998 (Some minor ast validation and visiting cleanups)
 - #159123 (doc: clarify attr parser APIs)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 13, 2026
…ors, r=lcnr

Small refactorings in `need_type_info` module

r? @lcnr

This supports low priority impl diagnostic.
rust-bors Bot pushed a commit that referenced this pull request Jul 13, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #159039 (resolve: fix effective visibilities for items in ambiguous glob sets)
 - #157706 (Deny `todo!()` in tidy)
 - #158535 (Support `#[track_caller]` on EII declarations)
 - #158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder))
 - #158846 (Fix unused variable warnings for diverging expressions)
 - #159002 (Small refactorings in `need_type_info` module)
 - #159202 (Bump rustc-demangle to 0.1.28)
 - #159216 (Avoid using probe self_ty for delegation arguments)
 - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too)
 - #156609 (Consider structurally impossible Sized predicates in MIR)
 - #157993 (Expose more info about ADTs and functions in rustc_public)
 - #158854 (Add `#[rustc_test_entrypoint_marker]`)
 - #158998 (Some minor ast validation and visiting cleanups)
 - #159123 (doc: clarify attr parser APIs)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 13, 2026
…ors, r=lcnr

Small refactorings in `need_type_info` module

r? @lcnr

This supports low priority impl diagnostic.
rust-bors Bot pushed a commit that referenced this pull request Jul 13, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - #159039 (resolve: fix effective visibilities for items in ambiguous glob sets)
 - #157706 (Deny `todo!()` in tidy)
 - #156047 (Fix trait method resolution on an adjusted never type)
 - #158535 (Support `#[track_caller]` on EII declarations)
 - #158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder))
 - #158846 (Fix unused variable warnings for diverging expressions)
 - #159002 (Small refactorings in `need_type_info` module)
 - #159202 (Bump rustc-demangle to 0.1.28)
 - #159216 (Avoid using probe self_ty for delegation arguments)
 - #156609 (Consider structurally impossible Sized predicates in MIR)
 - #157993 (Expose more info about ADTs and functions in rustc_public)
 - #158804 (Clarify `as_uninit_mut` may point to uninitialized memory)
 - #158854 (Add `#[rustc_test_entrypoint_marker]`)
 - #158998 (Some minor ast validation and visiting cleanups)
 - #159123 (doc: clarify attr parser APIs)
rust-bors Bot pushed a commit that referenced this pull request Jul 13, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #157706 (Deny `todo!()` in tidy)
 - #158535 (Support `#[track_caller]` on EII declarations)
 - #158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder))
 - #158846 (Fix unused variable warnings for diverging expressions)
 - #159002 (Small refactorings in `need_type_info` module)
 - #159202 (Bump rustc-demangle to 0.1.28)
 - #159216 (Avoid using probe self_ty for delegation arguments)
 - #156609 (Consider structurally impossible Sized predicates in MIR)
 - #157993 (Expose more info about ADTs and functions in rustc_public)
 - #158804 (Clarify `as_uninit_mut` may point to uninitialized memory)
 - #158854 (Add `#[rustc_test_entrypoint_marker]`)
 - #158998 (Some minor ast validation and visiting cleanups)
 - #159123 (doc: clarify attr parser APIs)
@rust-bors
rust-bors Bot merged commit 3bd0126 into rust-lang:main Jul 13, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 13, 2026
rust-timer added a commit that referenced this pull request Jul 13, 2026
Rollup merge of #159002 - WaffleLapkin:need_type_info_refactors, r=lcnr

Small refactorings in `need_type_info` module

r? @lcnr

This supports low priority impl diagnostic.
@WaffleLapkin
WaffleLapkin deleted the need_type_info_refactors branch July 14, 2026 09:48
@WaffleLapkin
WaffleLapkin restored the need_type_info_refactors branch July 14, 2026 09:48
@WaffleLapkin
WaffleLapkin deleted the need_type_info_refactors branch July 14, 2026 09:50
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Jul 16, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - rust-lang/rust#157706 (Deny `todo!()` in tidy)
 - rust-lang/rust#158535 (Support `#[track_caller]` on EII declarations)
 - rust-lang/rust#158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder))
 - rust-lang/rust#158846 (Fix unused variable warnings for diverging expressions)
 - rust-lang/rust#159002 (Small refactorings in `need_type_info` module)
 - rust-lang/rust#159202 (Bump rustc-demangle to 0.1.28)
 - rust-lang/rust#159216 (Avoid using probe self_ty for delegation arguments)
 - rust-lang/rust#156609 (Consider structurally impossible Sized predicates in MIR)
 - rust-lang/rust#157993 (Expose more info about ADTs and functions in rustc_public)
 - rust-lang/rust#158804 (Clarify `as_uninit_mut` may point to uninitialized memory)
 - rust-lang/rust#158854 (Add `#[rustc_test_entrypoint_marker]`)
 - rust-lang/rust#158998 (Some minor ast validation and visiting cleanups)
 - rust-lang/rust#159123 (doc: clarify attr parser APIs)
@Kobzol

Kobzol commented Jul 21, 2026

Copy link
Copy Markdown
Member

@rust-timer build 3281f09

For #159246.

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (3281f09): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

@bors rollup=never rustc-perf
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.8% [-2.5%, -0.5%] 14
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.6%, secondary -19.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.6% [2.6%, 2.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-19.9% [-23.4%, -11.7%] 13
All ❌✅ (primary) 2.6% [2.6%, 2.6%] 1

Cycles

Results (primary 2.6%, secondary -14.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.6% [2.6%, 2.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-14.0% [-19.6%, -5.7%] 13
All ❌✅ (primary) 2.6% [2.6%, 2.6%] 1

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 488.117s -> 489.161s (0.21%)
Artifact size: 389.87 MiB -> 389.87 MiB (0.00%)

@WaffleLapkin

Copy link
Copy Markdown
Member Author

The changes here are only on error path, so the perf change must be noise, right?

@Kobzol

Kobzol commented Jul 21, 2026

Copy link
Copy Markdown
Member

Yes, the serde-4threads benchmark was improved on all unrolled perf. builds from its containing rollup for some reason (not sure why). Nothing to see here, sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants