{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/32287","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/32287/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/32287/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/32287/events","html_url":"https://github.com/rust-lang/rust/pull/32287","id":141289179,"number":32287,"title":"Introduce cache for projection","user":{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars.githubusercontent.com/u/155238?v=3","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"arielb1","id":1830974,"avatar_url":"https://avatars.githubusercontent.com/u/1830974?v=3","gravatar_id":"","url":"https://api.github.com/users/arielb1","html_url":"https://github.com/arielb1","followers_url":"https://api.github.com/users/arielb1/followers","following_url":"https://api.github.com/users/arielb1/following{/other_user}","gists_url":"https://api.github.com/users/arielb1/gists{/gist_id}","starred_url":"https://api.github.com/users/arielb1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arielb1/subscriptions","organizations_url":"https://api.github.com/users/arielb1/orgs","repos_url":"https://api.github.com/users/arielb1/repos","events_url":"https://api.github.com/users/arielb1/events{/privacy}","received_events_url":"https://api.github.com/users/arielb1/received_events","type":"User","site_admin":false},"milestone":null,"comments":15,"created_at":"2016-03-16T14:19:41Z","updated_at":"2016-03-16T22:54:13Z","closed_at":"2016-03-16T22:54:13Z","pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/32287","html_url":"https://github.com/rust-lang/rust/pull/32287","diff_url":"https://github.com/rust-lang/rust/pull/32287.diff","patch_url":"https://github.com/rust-lang/rust/pull/32287.patch"},"body":"Two main changes:\r\n\r\n1. Introduce a simple cache for projection\r\n2. Refactor projection candidate selection so that it runs `select` inside a probe\r\n\r\nBoth of these changes arose from work I've been doing extending @soltanmm's branch to handle lazy normalization. The cache is still incomplete in my mind, but it is certainly handy: for example it solves the explosion in compilation time for #31849. \r\n\r\nAlso, the refactoring to use `select` inside a probe does tweak the heuristics very slightly, in that candidates from being an object type now have a lower precedence than where-clause candidates. I wouldn't expect this to matter in practice. If it did, we could pull that logic for detecting object types more into project, but I'd prefer not to.\r\n\r\nI'll try to write-up further thoughts for improving this cache (and lazy norm etc) elsewhere. There are two main improvements, listed briefly here:\r\n\r\n1. When we introduce a type variable, only do that once. Should be a straight-forward extension.\r\n2. I'd like to skolemize away regions and store \"higher-ranked\" cache keys and values (we might even use the same approach for unbound type variables eventually). This will be easier once we push more on the plumbing that @soltanmm has been working on.\r\n\r\nFixes #31849.\r\n\r\ncc @arielb1, @aturon, @asajeffrey"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/197592451","html_url":"https://github.com/rust-lang/rust/pull/32287#issuecomment-197592451","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/32287","id":197592451,"user":{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars.githubusercontent.com/u/155238?v=3","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false},"created_at":"2016-03-16T22:54:13Z","updated_at":"2016-03-16T22:54:13Z","body":"Closing for now while I ponder the best solution here :)"}}