Skip to content

resolve instances in ctfe based on current const context#156454

Open
fee1-dead wants to merge 2 commits into
rust-lang:mainfrom
fee1-dead-contrib:const-min-spec-not-nonconst
Open

resolve instances in ctfe based on current const context#156454
fee1-dead wants to merge 2 commits into
rust-lang:mainfrom
fee1-dead-contrib:const-min-spec-not-nonconst

Conversation

@fee1-dead
Copy link
Copy Markdown
Member

@fee1-dead fee1-dead commented May 11, 2026

Need to figure out what to do with the duplicated code from codegen_select_candidate.

Fixes #148200.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 11, 2026

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels May 11, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 11, 2026

r? @mu001999

rustbot has assigned @mu001999.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 17 candidates

@fee1-dead fee1-dead marked this pull request as draft May 11, 2026 13:18
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 11, 2026
@fee1-dead fee1-dead force-pushed the const-min-spec-not-nonconst branch from f8e940c to 7ffb868 Compare May 11, 2026 13:19
Comment thread compiler/rustc_const_eval/src/interpret/machine.rs Outdated
@rust-log-analyzer

This comment has been minimized.

@fee1-dead fee1-dead force-pushed the const-min-spec-not-nonconst branch from 99ddb40 to fc87f6c Compare May 13, 2026 10:57
@fee1-dead fee1-dead marked this pull request as ready for review May 13, 2026 10:57
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 13, 2026
Comment on lines +117 to +118
let candidate = if constness == Constness::Const && tcx.next_trait_solver_globally() {
tcx.codegen_select_candidate_for_ctfe(input)
Copy link
Copy Markdown
Contributor

@oli-obk oli-obk May 13, 2026

Choose a reason for hiding this comment

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

How riddiculous would it be to just always use the next trait solver for this? Does mixing the trait solvers like that get us into any trouble that is more problematic than min_spec unsoundness?

View changes since the review

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

Labels

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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

min_specialization with const traits can call non-const function in consteval

6 participants