-
Notifications
You must be signed in to change notification settings - Fork 13.4k
emit ConstEquate
in TypeRelating<D>
#107434
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @lcnr (rustbot has picked a reviewer for you, use r? to override) |
r? compiler-contributors |
892f120
to
f2c24af
Compare
r? @compiler-errors @bors r+ yeet |
📌 Commit f2c24afe0fd510f8c592e737a5c06a42c6109ca1 has been approved by It is now in the queue for this repository. |
⌛ Testing commit f2c24afe0fd510f8c592e737a5c06a42c6109ca1 with merge 90c1e6c689773c8d55031328f01ca276da9d157d... |
💔 Test failed - checks-actions |
@bors retry spurious |
⌛ Testing commit f2c24afe0fd510f8c592e737a5c06a42c6109ca1 with merge c907399ed72f3a206817be8ac1085d06741f7c78... |
💔 Test failed - checks-actions |
@bors retry |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit f2c24afe0fd510f8c592e737a5c06a42c6109ca1 has been approved by It is now in the queue for this repository. |
@bors retry |
⌛ Testing commit f2c24afe0fd510f8c592e737a5c06a42c6109ca1 with merge 6ebe0f75c272d590ed38cbb30d1cde018f65c95b... |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
f2c24af
to
d85d906
Compare
@bors r=compiler-errors maybe rebasing will fix everything magically |
This comment has been minimized.
This comment has been minimized.
☀️ Test successful - checks-actions |
Finished benchmarking commit (2a6ff72): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
This comment has been minimized.
This comment has been minimized.
This introduces an ICE. See #107898 |
emitting
ConstEquate
during mir typeck is useful since it can help catch bugs in hir typeck incase our impl ofConstEquate
is wrong.doing this did actually catch a bug, when relating
Expr::Call
we==
the types of all the argument consts which spuriously returns false if the type contains const projections/aliases which causes us to fall through to theexpected_found
error arm.Generally its an ICE if the
Const
'sTy
s arent equal butConstKind::Expr
is kind of special since they are sort of like const items that areconst CALL<F: const Fn(...), const N: F>
though we dont actually explicitly represent theF
type param explicitly inExpr::Call
so I just made us relate theConst
's ty field to avoid getting ICEs from the tests I added and the following existing test:which has us relate two
ConstKind::Value
one for the fn item ofsize_of::<Foo<T>>
and one for the fn item ofsize_of::<T>()
, these only differ by theirTy
and if we don't relate theTy
we'll end up getting an ICE from the checks that ensure thety
fields always match.In theory
Expr::UnOp
has the same problem so I added a call torelate
for the ty's, although I was unable to create a repro test.