Skip to content

Commit

Permalink
Auto merge of #135753 - compiler-errors:from-ty-const, r=oli-obk
Browse files Browse the repository at this point in the history
Get rid of `mir::Const::from_ty_const`

This function is strange, because it turns valtrees into `mir::Const::Value`, but the rest of the const variants stay as type system consts.

All of the callsites except for one in `instsimplify` (array length simplification of `ptr_metadata` call) just go through the valtree arm of the function, so it's easier to just create a `mir::Const` directly for those.

For the instsimplify case, if we have a type system const we should *keep* having a type system const, rather than turning it into a `mir::Const::Value`; it doesn't really matter in practice, though, bc `usize` has no padding, but it feels more principled.
  • Loading branch information
bors committed Jan 26, 2025
2 parents 1fe9353 + 9ee223d commit ab7fd87
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit ab7fd87

Please sign in to comment.