Skip to content

Conversation

@theemathas
Copy link
Contributor

This makes it consistent with other const traits in the standard library with supertraits.

I am currently unsure if const FnMut should require const FnOnce or not. See zulip discussion.

@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 21, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 21, 2025

r? @lcnr

rustbot has assigned @lcnr.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer


fn main() {
(const || (()).foo())();
// ^ ERROR: cannot call non-const method `<() as Foo>::foo` in constant functions
Copy link
Contributor

Choose a reason for hiding this comment

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

We sometimes leave these in to keep some context for when someone fixes the test. Fine here tho

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

we should also dedup super traits for constness goals, like we already do for traits.

View changes since this review

@lcnr
Copy link
Contributor

lcnr commented Oct 23, 2025

idk if that should be part of this PR, regardless

r? @oli-obk

@rustbot rustbot assigned oli-obk and unassigned lcnr Oct 23, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 23, 2025

oli-obk is not on the review rotation at the moment.
They may take a while to respond.

@oli-obk
Copy link
Contributor

oli-obk commented Dec 16, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Dec 16, 2025

📌 Commit 28819e0 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors 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 Dec 16, 2025
bors added a commit that referenced this pull request Dec 16, 2025
…uwer

Rollup of 11 pull requests

Successful merges:

 - #147939 (Make `const BorrowMut` require `const Borrow` and make `const Fn` require `const FnMut`)
 - #149734 (Mirror GCC 9.5.0)
 - #149767 (Tidying up tests/ui/issues 33 tests [4/N])
 - #149804 (chore: fix some minor issues in the comments)
 - #149967 (custom `VaList` layout for Hexagon)
 - #150025 (dont create unnecessary `DefId`s under mgca)
 - #150032 (Use annotate-snippet as default emitter on stable)
 - #150033 (Add try_as_dyn and try_as_dyn_mut)
 - #150042 (rustc-dev-guide subtree update)
 - #150063 (Remove deny of manual-let-else)
 - #150064 (std: io: error: Add comment for UEFI unpacked repr use)

Failed merges:

 - #150044 (Avoid unhelpful suggestion when crate name is invalid)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d93b93b into rust-lang:main Dec 17, 2025
11 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 17, 2025
rust-timer added a commit that referenced this pull request Dec 17, 2025
Rollup merge of #147939 - theemathas:add-const-supertrait, r=oli-obk

Make `const BorrowMut` require `const Borrow` and make `const Fn` require `const FnMut`

This makes it consistent with other const traits in the standard library with supertraits.

I am currently unsure if `const FnMut` should require `const FnOnce` or not. See [zulip discussion](https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/.5Bconst.5D.20implied.20bounds.20for.20implicit.20trait.20bounds/near/546152748).
@theemathas theemathas deleted the add-const-supertrait branch December 17, 2025 01:14
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Dec 17, 2025
…uwer

Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#147939 (Make `const BorrowMut` require `const Borrow` and make `const Fn` require `const FnMut`)
 - rust-lang/rust#149734 (Mirror GCC 9.5.0)
 - rust-lang/rust#149767 (Tidying up tests/ui/issues 33 tests [4/N])
 - rust-lang/rust#149804 (chore: fix some minor issues in the comments)
 - rust-lang/rust#149967 (custom `VaList` layout for Hexagon)
 - rust-lang/rust#150025 (dont create unnecessary `DefId`s under mgca)
 - rust-lang/rust#150032 (Use annotate-snippet as default emitter on stable)
 - rust-lang/rust#150033 (Add try_as_dyn and try_as_dyn_mut)
 - rust-lang/rust#150042 (rustc-dev-guide subtree update)
 - rust-lang/rust#150063 (Remove deny of manual-let-else)
 - rust-lang/rust#150064 (std: io: error: Add comment for UEFI unpacked repr use)

Failed merges:

 - rust-lang/rust#150044 (Avoid unhelpful suggestion when crate name is invalid)

r? `@ghost`
`@rustbot` modify labels: rollup
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. T-libs Relevant to the library 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