Uh oh!
There was an error while loading. Please reload this page.
delegation: simplify matches on FnKind, minor refactorings - #160853
Conversation
e9a04e2 to
e680d29CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
petrochenkov
commented
Aug 18, 2026
I'm generally skeptical about introduction of the extension trait. Removing unnecessary lifetime parameters (#160853 (comment)) will make things nicer if the current setup without the extension trait is kept. |
petrochenkov
commented
Aug 18, 2026
The logic behind the fn kind matching refactoring is also not very clear to me. |
aerooneqq
commented
Aug 19, 2026
Reverted creation of extension to
I think exhaustive matching does not allow to see the general strategy of handling different In In In So I like new matches more than old ones (wildcard patterns reduce thinking overhead which is needed when first-time looking at exhaustive pattern with 4 tuples of @rustbot ready |
petrochenkov
commented
Aug 21, 2026
✌️ @aerooneqq, you can now approve this pull request! If @petrochenkov told you to " |
rustbot
commented
Aug 21, 2026
Reminder, once the PR becomes ready for a review, use |
aerooneqq
commented
Aug 21, 2026
@bors squash |
This comment has been minimized.
This comment has been minimized.
* More concise matches on `FnKind`, some renamings * Move most of utility functions to extensions * Address review comments * Revert "Move most of utility functions to extensions" * Address review comments
🔨 5 commits were squashed into d6e4a1d. |
c5400fa to
d6e4a1dCompareaerooneqq
commented
Aug 21, 2026
@bors r=petrochenkov |
…es, r=petrochenkov delegation: simplify matches on `FnKind`, minor refactorings This PR refactors matches on `FnKind` making them smaller and more concise, next in all matches except `fn_kinds` function we no longer panic on delegation to inherent impls. And some minor renamings/refactorings. First step for rust-lang#160505. Part of rust-lang#118212. r? @petrochenkov
…es, r=petrochenkov delegation: simplify matches on `FnKind`, minor refactorings This PR refactors matches on `FnKind` making them smaller and more concise, next in all matches except `fn_kinds` function we no longer panic on delegation to inherent impls. And some minor renamings/refactorings. First step for rust-lang#160505. Part of rust-lang#118212. r? @petrochenkov
…uwer Rollup of 16 pull requests Successful merges: - #161259 (move some attribute related structs out of rustc_attr_ir) - #160853 (delegation: simplify matches on `FnKind`, minor refactorings) - #159899 ( `GenericArgs::types` triage + possible fixes) - #160459 (Use attribute parser for `deprecated` attribute checking) - #160813 (Optimize linked list iterator performance) - #161271 (doc: document safety requirements for core WTF-8) - #161317 (LLVM 24: configure float-abi via module flag) - #161320 (Only suggest `RUST_MIN_STACK` if maybe stack overflow) - #161369 (Add regression test for confusing lifetime error message issue) - #161393 (Configure LLM policy URL for triagebot) - #161403 (splat-fn-ptr-ptr-tuple.rs: add `let` to avoid UB) - #161409 (Add back `tests/rustdoc-gui/notable-trait.goml` test) - #161410 (Fix rustdoc remapping `documentation` scope documentation) - #161415 (Update expect messages in path docs to better follow guidelines) - #161438 (Change triagebot backport to ping T-libs-fcp) - #161442 (Add regression test for dead code on type alias used in impl self type) Failed merges: - #160509 (Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`)
Rollup of 20 pull requests Successful merges: - #161259 (move some attribute related structs out of rustc_attr_ir) - #160853 (delegation: simplify matches on `FnKind`, minor refactorings) - #161161 (proc_macro: add support for 16-bit targets) - #159899 ( `GenericArgs::types` triage + possible fixes) - #160459 (Use attribute parser for `deprecated` attribute checking) - #160536 (Inline `String::into_raw_parts` and reuse `from_utf16` optimization) - #160563 (Make `BorrowedCursor<'a, T>` covariant in `'a` and drop an indirection) - #160595 (Clarify `str::split_at` docs) - #160813 (Optimize linked list iterator performance) - #161271 (doc: document safety requirements for core WTF-8) - #161317 (LLVM 24: configure float-abi via module flag) - #161320 (Only suggest `RUST_MIN_STACK` if maybe stack overflow) - #161369 (Add regression test for confusing lifetime error message issue) - #161393 (Configure LLM policy URL for triagebot) - #161403 (splat-fn-ptr-ptr-tuple.rs: add `let` to avoid UB) - #161409 (Add back `tests/rustdoc-gui/notable-trait.goml` test) - #161410 (Fix rustdoc remapping `documentation` scope documentation) - #161415 (Update expect messages in path docs to better follow guidelines) - #161438 (Change triagebot backport to ping T-libs-fcp) - #161442 (Add regression test for dead code on type alias used in impl self type) Failed merges: - #160509 (Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`)
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #160853 - aerooneqq:delegation-fn-kind-matches, r=petrochenkov delegation: simplify matches on `FnKind`, minor refactorings This PR refactors matches on `FnKind` making them smaller and more concise, next in all matches except `fn_kinds` function we no longer panic on delegation to inherent impls. And some minor renamings/refactorings. First step for #160505. Part of #118212. r? @petrochenkov
Rollup of 20 pull requests Successful merges: - rust-lang/rust#161259 (move some attribute related structs out of rustc_attr_ir) - rust-lang/rust#160853 (delegation: simplify matches on `FnKind`, minor refactorings) - rust-lang/rust#161161 (proc_macro: add support for 16-bit targets) - rust-lang/rust#159899 ( `GenericArgs::types` triage + possible fixes) - rust-lang/rust#160459 (Use attribute parser for `deprecated` attribute checking) - rust-lang/rust#160536 (Inline `String::into_raw_parts` and reuse `from_utf16` optimization) - rust-lang/rust#160563 (Make `BorrowedCursor<'a, T>` covariant in `'a` and drop an indirection) - rust-lang/rust#160595 (Clarify `str::split_at` docs) - rust-lang/rust#160813 (Optimize linked list iterator performance) - rust-lang/rust#161271 (doc: document safety requirements for core WTF-8) - rust-lang/rust#161317 (LLVM 24: configure float-abi via module flag) - rust-lang/rust#161320 (Only suggest `RUST_MIN_STACK` if maybe stack overflow) - rust-lang/rust#161369 (Add regression test for confusing lifetime error message issue) - rust-lang/rust#161393 (Configure LLM policy URL for triagebot) - rust-lang/rust#161403 (splat-fn-ptr-ptr-tuple.rs: add `let` to avoid UB) - rust-lang/rust#161409 (Add back `tests/rustdoc-gui/notable-trait.goml` test) - rust-lang/rust#161410 (Fix rustdoc remapping `documentation` scope documentation) - rust-lang/rust#161415 (Update expect messages in path docs to better follow guidelines) - rust-lang/rust#161438 (Change triagebot backport to ping T-libs-fcp) - rust-lang/rust#161442 (Add regression test for dead code on type alias used in impl self type) Failed merges: - rust-lang/rust#160509 (Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`)
Rollup of 20 pull requests Successful merges: - rust-lang#161259 (move some attribute related structs out of rustc_attr_ir) - rust-lang#160853 (delegation: simplify matches on `FnKind`, minor refactorings) - rust-lang#161161 (proc_macro: add support for 16-bit targets) - rust-lang#159899 ( `GenericArgs::types` triage + possible fixes) - rust-lang#160459 (Use attribute parser for `deprecated` attribute checking) - rust-lang#160536 (Inline `String::into_raw_parts` and reuse `from_utf16` optimization) - rust-lang#160563 (Make `BorrowedCursor<'a, T>` covariant in `'a` and drop an indirection) - rust-lang#160595 (Clarify `str::split_at` docs) - rust-lang#160813 (Optimize linked list iterator performance) - rust-lang#161271 (doc: document safety requirements for core WTF-8) - rust-lang#161317 (LLVM 24: configure float-abi via module flag) - rust-lang#161320 (Only suggest `RUST_MIN_STACK` if maybe stack overflow) - rust-lang#161369 (Add regression test for confusing lifetime error message issue) - rust-lang#161393 (Configure LLM policy URL for triagebot) - rust-lang#161403 (splat-fn-ptr-ptr-tuple.rs: add `let` to avoid UB) - rust-lang#161409 (Add back `tests/rustdoc-gui/notable-trait.goml` test) - rust-lang#161410 (Fix rustdoc remapping `documentation` scope documentation) - rust-lang#161415 (Update expect messages in path docs to better follow guidelines) - rust-lang#161438 (Change triagebot backport to ping T-libs-fcp) - rust-lang#161442 (Add regression test for dead code on type alias used in impl self type) Failed merges: - rust-lang#160509 (Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`) implement [u8]::split_ascii_whitespace format fix
Rollup of 20 pull requests Successful merges: - rust-lang#161259 (move some attribute related structs out of rustc_attr_ir) - rust-lang#160853 (delegation: simplify matches on `FnKind`, minor refactorings) - rust-lang#161161 (proc_macro: add support for 16-bit targets) - rust-lang#159899 ( `GenericArgs::types` triage + possible fixes) - rust-lang#160459 (Use attribute parser for `deprecated` attribute checking) - rust-lang#160536 (Inline `String::into_raw_parts` and reuse `from_utf16` optimization) - rust-lang#160563 (Make `BorrowedCursor<'a, T>` covariant in `'a` and drop an indirection) - rust-lang#160595 (Clarify `str::split_at` docs) - rust-lang#160813 (Optimize linked list iterator performance) - rust-lang#161271 (doc: document safety requirements for core WTF-8) - rust-lang#161317 (LLVM 24: configure float-abi via module flag) - rust-lang#161320 (Only suggest `RUST_MIN_STACK` if maybe stack overflow) - rust-lang#161369 (Add regression test for confusing lifetime error message issue) - rust-lang#161393 (Configure LLM policy URL for triagebot) - rust-lang#161403 (splat-fn-ptr-ptr-tuple.rs: add `let` to avoid UB) - rust-lang#161409 (Add back `tests/rustdoc-gui/notable-trait.goml` test) - rust-lang#161410 (Fix rustdoc remapping `documentation` scope documentation) - rust-lang#161415 (Update expect messages in path docs to better follow guidelines) - rust-lang#161438 (Change triagebot backport to ping T-libs-fcp) - rust-lang#161442 (Add regression test for dead code on type alias used in impl self type) Failed merges: - rust-lang#160509 (Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`) implement [u8]::split_ascii_whitespace format fix
This PR refactors matches on
FnKindmaking them smaller and more concise, next in all matches exceptfn_kindsfunction we no longer panic on delegation to inherent impls. And some minor renamings/refactorings. First step for #160505.Part of #118212.
r? @petrochenkov