Skip to content

fix: replace TODO placeholders in next-solver IrPrint with proper formatting#21779

Open
Albab-Hasan wants to merge 2 commits intorust-lang:masterfrom
Albab-Hasan:fix/next-solver-ir-print
Open

fix: replace TODO placeholders in next-solver IrPrint with proper formatting#21779
Albab-Hasan wants to merge 2 commits intorust-lang:masterfrom
Albab-Hasan:fix/next-solver-ir-print

Conversation

@Albab-Hasan
Copy link
Contributor

seven IrPrint::print_debug implementations in the next-solver were placeholder stubs that returned "TODO: " instead of meaningful output. these are called via the Display impl (and Debug for PatternKind) of these types so any solver trace log containing them was unreadable.

implemented proper formatting for each:

  • TraitPredicate -> "T: Trait" / "!T: Trait"
  • HostEffectPredicate -> "const T: Trait" / "[const] T: Trait"
  • NormalizesTo -> "AliasTerm(...) -> Term"
  • SubtypePredicate -> "A <: B"
  • CoercePredicate -> "A -> B"
  • FnSig -> "fn([inputs]) -> output"
  • PatternKind -> "start..=end" / "or([...])" / "!null"

also removed the unused type_name_of_val import.

seven IrPrint::print_debug implementations in the next-solver were
placeholder stubs that returned "TODO: <typename>" instead of meaningful
output. these are called via the Display impl (and Debug for PatternKind)
of these types, so any solver trace log containing them was unreadable.

implemented proper formatting for each:
- TraitPredicate      -> "T: Trait" / "!T: Trait"
- HostEffectPredicate -> "const T: Trait" / "[const] T: Trait"
- NormalizesTo        -> "AliasTerm(...) -> Term"
- SubtypePredicate    -> "A <: B"
- CoercePredicate     -> "A -> B"
- FnSig               -> "fn([inputs]) -> output"
- PatternKind         -> "start..=end" / "or([...])" / "!null"

also removed the now-unused type_name_of_val import.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 7, 2026
Copy link
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

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

t: &ty::CoercePredicate<Self>,
fmt: &mut std::fmt::Formatter<'_>,
) -> std::fmt::Result {
fmt.write_str(&format!("TODO: {:?}", type_name_of_val(t)))
Copy link
Contributor

Choose a reason for hiding this comment

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

This prints the same as NormalizesTo, so I think it's better to qualify both, e.g. something like CoercePredicate({:?} -> {:?}).

@Albab-Hasan
Copy link
Contributor Author

@ChayimFriedman2 done

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants