{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/44586600","id":44586600,"diff_hunk":"@@ -311,17 +340,126 @@ impl<'a,'tcx> Builder<'a,'tcx> {\n             } else {\n                 // if None is returned, then any remaining candidates\n                 // are unreachable (at least not through this path).\n-                return;\n+                return vec![];\n             }\n         }\n \n         // If there are no candidates that still need testing, we're done.\n         // Since all matches are exhaustive, execution should never reach this point.\n         if candidates.is_empty() {\n-            return self.panic(block);\n+            return vec![block];\n+        }\n+\n+        // Test cawndidates where possible.","path":"src/librustc_mir/build/matches/mod.rs","position":66,"original_position":66,"commit_id":"e7ff18da802be5c2e9ab6ccb8c000ee4c9ecbed3","original_commit_id":"e7ff18da802be5c2e9ab6ccb8c000ee4c9ecbed3","user":{"login":"nrc","id":762626,"avatar_url":"https://avatars.githubusercontent.com/u/762626?v=3","gravatar_id":"","url":"https://api.github.com/users/nrc","html_url":"https://github.com/nrc","followers_url":"https://api.github.com/users/nrc/followers","following_url":"https://api.github.com/users/nrc/following{/other_user}","gists_url":"https://api.github.com/users/nrc/gists{/gist_id}","starred_url":"https://api.github.com/users/nrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrc/subscriptions","organizations_url":"https://api.github.com/users/nrc/orgs","repos_url":"https://api.github.com/users/nrc/repos","events_url":"https://api.github.com/users/nrc/events{/privacy}","received_events_url":"https://api.github.com/users/nrc/received_events","type":"User","site_admin":false},"body":"typo","created_at":"2015-11-11T21:10:02Z","updated_at":"2015-11-11T21:10:02Z","html_url":"https://github.com/rust-lang/rust/pull/29776#discussion_r44586600","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/29776","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/44586600"},"html":{"href":"https://github.com/rust-lang/rust/pull/29776#discussion_r44586600"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/29776"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/29776","id":50417438,"html_url":"https://github.com/rust-lang/rust/pull/29776","diff_url":"https://github.com/rust-lang/rust/pull/29776.diff","patch_url":"https://github.com/rust-lang/rust/pull/29776.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/29776","number":29776,"state":"open","locked":false,"title":"Change match desugaring to degenerate to if-else-if chains","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},"body":"In previous PRs, I changed the match desugaring to generate more efficient code for ints/chars and the like. But this doesn't help when you're matching strings, ranges, or other crazy complex things (leading to #29740). This commit restructures match desugaring *yet again* to handle that case better -- basically we now degenerate to an if-else-if chain in such cases.\r\n\r\n~~Note that this builds on https://github.com/rust-lang/rust/pull/29763 which will hopefully land soon. So ignore the first few commits.~~ landed now\r\n\r\nr? @Aatch since he's been reviewing the other commits in this series","created_at":"2015-11-11T18:23:50Z","updated_at":"2015-11-11T21:10:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a29fccd1cbe77b1e37fae6cc8b6ff7fdaf249b8","assignee":{"login":"Aatch","id":342416,"avatar_url":"https://avatars.githubusercontent.com/u/342416?v=3","gravatar_id":"","url":"https://api.github.com/users/Aatch","html_url":"https://github.com/Aatch","followers_url":"https://api.github.com/users/Aatch/followers","following_url":"https://api.github.com/users/Aatch/following{/other_user}","gists_url":"https://api.github.com/users/Aatch/gists{/gist_id}","starred_url":"https://api.github.com/users/Aatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aatch/subscriptions","organizations_url":"https://api.github.com/users/Aatch/orgs","repos_url":"https://api.github.com/users/Aatch/repos","events_url":"https://api.github.com/users/Aatch/events{/privacy}","received_events_url":"https://api.github.com/users/Aatch/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/29776/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/29776/comments","review_comment_url":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/29776/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/e7ff18da802be5c2e9ab6ccb8c000ee4c9ecbed3","head":{"label":"nikomatsakis:mir-29740","ref":"mir-29740","sha":"e7ff18da802be5c2e9ab6ccb8c000ee4c9ecbed3","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},"repo":{"id":1672543,"name":"rust","full_name":"nikomatsakis/rust","owner":{"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},"private":false,"html_url":"https://github.com/nikomatsakis/rust","description":"A work-in-progress programming language; not yet suitable for users","fork":true,"url":"https://api.github.com/repos/nikomatsakis/rust","forks_url":"https://api.github.com/repos/nikomatsakis/rust/forks","keys_url":"https://api.github.com/repos/nikomatsakis/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nikomatsakis/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nikomatsakis/rust/teams","hooks_url":"https://api.github.com/repos/nikomatsakis/rust/hooks","issue_events_url":"https://api.github.com/repos/nikomatsakis/rust/issues/events{/number}","events_url":"https://api.github.com/repos/nikomatsakis/rust/events","assignees_url":"https://api.github.com/repos/nikomatsakis/rust/assignees{/user}","branches_url":"https://api.github.com/repos/nikomatsakis/rust/branches{/branch}","tags_url":"https://api.github.com/repos/nikomatsakis/rust/tags","blobs_url":"https://api.github.com/repos/nikomatsakis/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nikomatsakis/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nikomatsakis/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/nikomatsakis/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nikomatsakis/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/nikomatsakis/rust/languages","stargazers_url":"https://api.github.com/repos/nikomatsakis/rust/stargazers","contributors_url":"https://api.github.com/repos/nikomatsakis/rust/contributors","subscribers_url":"https://api.github.com/repos/nikomatsakis/rust/subscribers","subscription_url":"https://api.github.com/repos/nikomatsakis/rust/subscription","commits_url":"https://api.github.com/repos/nikomatsakis/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/nikomatsakis/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/nikomatsakis/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/nikomatsakis/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/nikomatsakis/rust/contents/{+path}","compare_url":"https://api.github.com/repos/nikomatsakis/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nikomatsakis/rust/merges","archive_url":"https://api.github.com/repos/nikomatsakis/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nikomatsakis/rust/downloads","issues_url":"https://api.github.com/repos/nikomatsakis/rust/issues{/number}","pulls_url":"https://api.github.com/repos/nikomatsakis/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/nikomatsakis/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/nikomatsakis/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nikomatsakis/rust/labels{/name}","releases_url":"https://api.github.com/repos/nikomatsakis/rust/releases{/id}","created_at":"2011-04-27T20:20:29Z","updated_at":"2014-07-10T00:11:47Z","pushed_at":"2015-11-11T20:20:54Z","git_url":"git://github.com/nikomatsakis/rust.git","ssh_url":"git@github.com:nikomatsakis/rust.git","clone_url":"https://github.com/nikomatsakis/rust.git","svn_url":"https://github.com/nikomatsakis/rust","homepage":"","size":341127,"stargazers_count":4,"watchers_count":4,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":4,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"f1f5c04c07f2e888c43cb577810659a7c1d87a00","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":724712,"name":"rust","full_name":"rust-lang/rust","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/rust","description":"A safe, concurrent, practical language.","fork":false,"url":"https://api.github.com/repos/rust-lang/rust","forks_url":"https://api.github.com/repos/rust-lang/rust/forks","keys_url":"https://api.github.com/repos/rust-lang/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/rust/teams","hooks_url":"https://api.github.com/repos/rust-lang/rust/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/rust/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/rust/events","assignees_url":"https://api.github.com/repos/rust-lang/rust/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/rust/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/rust/tags","blobs_url":"https://api.github.com/repos/rust-lang/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/rust/languages","stargazers_url":"https://api.github.com/repos/rust-lang/rust/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/rust/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/rust/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/rust/subscription","commits_url":"https://api.github.com/repos/rust-lang/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/rust/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/rust/merges","archive_url":"https://api.github.com/repos/rust-lang/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/rust/downloads","issues_url":"https://api.github.com/repos/rust-lang/rust/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/rust/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/rust/releases{/id}","created_at":"2010-06-16T20:39:03Z","updated_at":"2015-11-11T20:16:58Z","pushed_at":"2015-11-11T20:44:54Z","git_url":"git://github.com/rust-lang/rust.git","ssh_url":"git@github.com:rust-lang/rust.git","clone_url":"https://github.com/rust-lang/rust.git","svn_url":"https://github.com/rust-lang/rust","homepage":"http://www.rust-lang.org","size":706305,"stargazers_count":14145,"watchers_count":14145,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2758,"mirror_url":null,"open_issues_count":2323,"forks":2758,"open_issues":2323,"watchers":14145,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/29776"},"html":{"href":"https://github.com/rust-lang/rust/pull/29776"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/29776"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/29776/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/29776/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/29776/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/e7ff18da802be5c2e9ab6ccb8c000ee4c9ecbed3"}}}}