-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
remove CTFE loop detector #54384
Copy link
Copy link
Closed
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The plan changed to removing the loop detector.
Original issue
The code at https://github.com/rust-lang/rust/blob/master/src/librustc_mir/interpret/snapshot.rs leaves me puzzled and confused after wasting about two hours on it. Open questions are:
AllocIdSnapshotanOption? What does it mean when there is aNonethere and when does that happen?EvalSnapshot::newmake a deep copy, and then it has a methodEvalSnapshot::snapshotthat does a snapshot (of theEvalSnapshot, confusing naming)? That method is called inPartialEq::eq, doesn't that mean we do tons of allocations and copies every time we compare?I tried fixing the second point (making a snapshot when
EvalSnapshotis created, not when it is compared), but failed to do so as the thing produced by theSnapshottrait isn't actually a snapshot (which I would expect to be a deep, independent copy), but something full of references to somewhere (couldn't figure out where though, just saw the lifetime).Documentation (inline in the code) should be improved to answer these questions, and if the part about allocating during comparison is correct, that should be fixed.
Cc @oli-obk @brunocodutra