{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/54384","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/54384/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/54384/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/54384/events","html_url":"https://github.com/rust-lang/rust/issues/54384","id":362109057,"node_id":"MDU6SXNzdWUzNjIxMDkwNTc=","number":54384,"title":"Document and maybe fix CTFE loop detector","user":{"login":"RalfJung","id":330628,"node_id":"MDQ6VXNlcjMzMDYyOA==","avatar_url":"https://avatars1.githubusercontent.com/u/330628?v=4","gravatar_id":"","url":"https://api.github.com/users/RalfJung","html_url":"https://github.com/RalfJung","followers_url":"https://api.github.com/users/RalfJung/followers","following_url":"https://api.github.com/users/RalfJung/following{/other_user}","gists_url":"https://api.github.com/users/RalfJung/gists{/gist_id}","starred_url":"https://api.github.com/users/RalfJung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RalfJung/subscriptions","organizations_url":"https://api.github.com/users/RalfJung/orgs","repos_url":"https://api.github.com/users/RalfJung/repos","events_url":"https://api.github.com/users/RalfJung/events{/privacy}","received_events_url":"https://api.github.com/users/RalfJung/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-20T09:55:31Z","updated_at":"2018-09-20T11:33:35Z","closed_at":null,"author_association":"MEMBER","body":"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:\r\n\r\n* Why is `AllocIdSnapshot` an `Option`? What does it mean when there is a `None` there and when does that happen?\r\n* Why does `EvalSnapshot::new` make a deep copy, and then it has a method `EvalSnapshot::snapshot` that does a snapshot (of the `EvalSnapshot`, confusing naming)? That method is called in `PartialEq::eq`, doesn't that mean we do tons of allocations and copies every time we compare?\r\n* Where and how does it avoid snapshotting the same allocation twice in one snapshot?\r\n\r\nI tried fixing the second point (making a snapshot when `EvalSnapshot` is created, not when it is compared), but failed to do so as the thing produced by the `Snapshot` trait 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).\r\n\r\nDocumentation (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.\r\n\r\nCc @oli-obk @brunocodutra "},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/423150297","html_url":"https://github.com/rust-lang/rust/issues/54384#issuecomment-423150297","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/54384","id":423150297,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzE1MDI5Nw==","user":{"login":"RalfJung","id":330628,"node_id":"MDQ6VXNlcjMzMDYyOA==","avatar_url":"https://avatars1.githubusercontent.com/u/330628?v=4","gravatar_id":"","url":"https://api.github.com/users/RalfJung","html_url":"https://github.com/RalfJung","followers_url":"https://api.github.com/users/RalfJung/followers","following_url":"https://api.github.com/users/RalfJung/following{/other_user}","gists_url":"https://api.github.com/users/RalfJung/gists{/gist_id}","starred_url":"https://api.github.com/users/RalfJung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RalfJung/subscriptions","organizations_url":"https://api.github.com/users/RalfJung/orgs","repos_url":"https://api.github.com/users/RalfJung/repos","events_url":"https://api.github.com/users/RalfJung/events{/privacy}","received_events_url":"https://api.github.com/users/RalfJung/received_events","type":"User","site_admin":false},"created_at":"2018-09-20T11:33:35Z","updated_at":"2018-09-20T11:33:35Z","author_association":"MEMBER","body":"I am actually now also confused about why we are using \"stable hash\". According to what I learned in https://github.com/rust-lang-nursery/rustc-guide/issues/203, the purpose of \"stable hash\" is to not change between rustc invocations, which is important for incremental compilation where the hashes are stored to disk and loaded again by the next compiler invocation.\r\n\r\nWhy does this help / why do we want this with the loop detector?"}}
{"actor":{"display_login":"RalfJung"}}