{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/cargo/pulls/comments/81373321","pull_request_review_id":2359288,"id":81373321,"diff_hunk":"@@ -737,7 +737,12 @@ impl TomlManifest {\n                -> CargoResult<Vec<(PackageIdSpec, Dependency)>> {\n         let mut replace = Vec::new();\n         for (spec, replacement) in self.replace.iter().flat_map(|x| x) {\n-            let spec = try!(PackageIdSpec::parse(spec));\n+            let spec = match PackageIdSpec::parse(spec) {\n+                Ok(spec) => spec,\n+                Err(_)   => bail!(\"replacements must specify a \\\n+                                   valid semver version \\\n+                                   to replace, but `{}` does not\", spec),\n+            };","path":"src/cargo/util/toml.rs","position":10,"original_position":10,"commit_id":"b43e6dd2d6d9965cae17698b40201ca4b5143b06","original_commit_id":"b43e6dd2d6d9965cae17698b40201ca4b5143b06","user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"body":"Could this actually use `chain_error`? That way we don't lose the previous error context and can just chain more information onto it","created_at":"2016-09-30T16:34:40Z","updated_at":"2016-09-30T16:34:40Z","html_url":"https://github.com/rust-lang/cargo/pull/3139#discussion_r81373321","pull_request_url":"https://api.github.com/repos/rust-lang/cargo/pulls/3139","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/comments/81373321"},"html":{"href":"https://github.com/rust-lang/cargo/pull/3139#discussion_r81373321"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/3139"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/cargo/pulls/3139","id":87477423,"html_url":"https://github.com/rust-lang/cargo/pull/3139","diff_url":"https://github.com/rust-lang/cargo/pull/3139.diff","patch_url":"https://github.com/rust-lang/cargo/pull/3139.patch","issue_url":"https://api.github.com/repos/rust-lang/cargo/issues/3139","number":3139,"state":"open","locked":false,"title":"Show an error messager for invalid semver spec for packages in the [replace] section.","user":{"login":"jhbabon","id":280452,"avatar_url":"https://avatars.githubusercontent.com/u/280452?v=3","gravatar_id":"","url":"https://api.github.com/users/jhbabon","html_url":"https://github.com/jhbabon","followers_url":"https://api.github.com/users/jhbabon/followers","following_url":"https://api.github.com/users/jhbabon/following{/other_user}","gists_url":"https://api.github.com/users/jhbabon/gists{/gist_id}","starred_url":"https://api.github.com/users/jhbabon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhbabon/subscriptions","organizations_url":"https://api.github.com/users/jhbabon/orgs","repos_url":"https://api.github.com/users/jhbabon/repos","events_url":"https://api.github.com/users/jhbabon/events{/privacy}","received_events_url":"https://api.github.com/users/jhbabon/received_events","type":"User","site_admin":false},"body":"The `[replace]` section in the `Cargo.toml` file doesn't allow invalid semver specsfor packages, so something like this:\r\n\r\n```toml\r\n[dependencies]\r\nfoo = \"*\"\r\n\r\n[replace]\r\n\"foo:*\" = { git = 'https://example.com' }\r\n```\r\n\r\nIt's not valid. In this case we will display an error message like this:\r\n\r\n```\r\nerror: failed to parse manifest at `Cargo.toml`\r\n\r\nCaused by:\r\n  replacements must specify a valid semver version to replace, but `foo:*` does not\r\n```\r\n\r\ncloses #3129 ","created_at":"2016-09-30T11:28:55Z","updated_at":"2016-09-30T16:34:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e3f44541e38b013bf376e48e441741121b7979fe","assignee":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"assignees":[{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/cargo/pulls/3139/commits","review_comments_url":"https://api.github.com/repos/rust-lang/cargo/pulls/3139/comments","review_comment_url":"https://api.github.com/repos/rust-lang/cargo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/cargo/issues/3139/comments","statuses_url":"https://api.github.com/repos/rust-lang/cargo/statuses/b43e6dd2d6d9965cae17698b40201ca4b5143b06","head":{"label":"jhbabon:improve-replace-parsing-error-msg","ref":"improve-replace-parsing-error-msg","sha":"b43e6dd2d6d9965cae17698b40201ca4b5143b06","user":{"login":"jhbabon","id":280452,"avatar_url":"https://avatars.githubusercontent.com/u/280452?v=3","gravatar_id":"","url":"https://api.github.com/users/jhbabon","html_url":"https://github.com/jhbabon","followers_url":"https://api.github.com/users/jhbabon/followers","following_url":"https://api.github.com/users/jhbabon/following{/other_user}","gists_url":"https://api.github.com/users/jhbabon/gists{/gist_id}","starred_url":"https://api.github.com/users/jhbabon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhbabon/subscriptions","organizations_url":"https://api.github.com/users/jhbabon/orgs","repos_url":"https://api.github.com/users/jhbabon/repos","events_url":"https://api.github.com/users/jhbabon/events{/privacy}","received_events_url":"https://api.github.com/users/jhbabon/received_events","type":"User","site_admin":false},"repo":{"id":67708709,"name":"cargo","full_name":"jhbabon/cargo","owner":{"login":"jhbabon","id":280452,"avatar_url":"https://avatars.githubusercontent.com/u/280452?v=3","gravatar_id":"","url":"https://api.github.com/users/jhbabon","html_url":"https://github.com/jhbabon","followers_url":"https://api.github.com/users/jhbabon/followers","following_url":"https://api.github.com/users/jhbabon/following{/other_user}","gists_url":"https://api.github.com/users/jhbabon/gists{/gist_id}","starred_url":"https://api.github.com/users/jhbabon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhbabon/subscriptions","organizations_url":"https://api.github.com/users/jhbabon/orgs","repos_url":"https://api.github.com/users/jhbabon/repos","events_url":"https://api.github.com/users/jhbabon/events{/privacy}","received_events_url":"https://api.github.com/users/jhbabon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jhbabon/cargo","description":"The Rust package manager","fork":true,"url":"https://api.github.com/repos/jhbabon/cargo","forks_url":"https://api.github.com/repos/jhbabon/cargo/forks","keys_url":"https://api.github.com/repos/jhbabon/cargo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jhbabon/cargo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jhbabon/cargo/teams","hooks_url":"https://api.github.com/repos/jhbabon/cargo/hooks","issue_events_url":"https://api.github.com/repos/jhbabon/cargo/issues/events{/number}","events_url":"https://api.github.com/repos/jhbabon/cargo/events","assignees_url":"https://api.github.com/repos/jhbabon/cargo/assignees{/user}","branches_url":"https://api.github.com/repos/jhbabon/cargo/branches{/branch}","tags_url":"https://api.github.com/repos/jhbabon/cargo/tags","blobs_url":"https://api.github.com/repos/jhbabon/cargo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jhbabon/cargo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jhbabon/cargo/git/refs{/sha}","trees_url":"https://api.github.com/repos/jhbabon/cargo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jhbabon/cargo/statuses/{sha}","languages_url":"https://api.github.com/repos/jhbabon/cargo/languages","stargazers_url":"https://api.github.com/repos/jhbabon/cargo/stargazers","contributors_url":"https://api.github.com/repos/jhbabon/cargo/contributors","subscribers_url":"https://api.github.com/repos/jhbabon/cargo/subscribers","subscription_url":"https://api.github.com/repos/jhbabon/cargo/subscription","commits_url":"https://api.github.com/repos/jhbabon/cargo/commits{/sha}","git_commits_url":"https://api.github.com/repos/jhbabon/cargo/git/commits{/sha}","comments_url":"https://api.github.com/repos/jhbabon/cargo/comments{/number}","issue_comment_url":"https://api.github.com/repos/jhbabon/cargo/issues/comments{/number}","contents_url":"https://api.github.com/repos/jhbabon/cargo/contents/{+path}","compare_url":"https://api.github.com/repos/jhbabon/cargo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jhbabon/cargo/merges","archive_url":"https://api.github.com/repos/jhbabon/cargo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jhbabon/cargo/downloads","issues_url":"https://api.github.com/repos/jhbabon/cargo/issues{/number}","pulls_url":"https://api.github.com/repos/jhbabon/cargo/pulls{/number}","milestones_url":"https://api.github.com/repos/jhbabon/cargo/milestones{/number}","notifications_url":"https://api.github.com/repos/jhbabon/cargo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jhbabon/cargo/labels{/name}","releases_url":"https://api.github.com/repos/jhbabon/cargo/releases{/id}","deployments_url":"https://api.github.com/repos/jhbabon/cargo/deployments","created_at":"2016-09-08T14:09:27Z","updated_at":"2016-09-08T14:09:29Z","pushed_at":"2016-09-30T11:27:23Z","git_url":"git://github.com/jhbabon/cargo.git","ssh_url":"git@github.com:jhbabon/cargo.git","clone_url":"https://github.com/jhbabon/cargo.git","svn_url":"https://github.com/jhbabon/cargo","homepage":"https://crates.io/","size":12144,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"cbe47ed52e6783ea6e53955f096527a3adae2a96","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":17420913,"name":"cargo","full_name":"rust-lang/cargo","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/cargo","description":"The Rust package manager","fork":false,"url":"https://api.github.com/repos/rust-lang/cargo","forks_url":"https://api.github.com/repos/rust-lang/cargo/forks","keys_url":"https://api.github.com/repos/rust-lang/cargo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/cargo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/cargo/teams","hooks_url":"https://api.github.com/repos/rust-lang/cargo/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/cargo/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/cargo/events","assignees_url":"https://api.github.com/repos/rust-lang/cargo/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/cargo/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/cargo/tags","blobs_url":"https://api.github.com/repos/rust-lang/cargo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/cargo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/cargo/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/cargo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/cargo/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/cargo/languages","stargazers_url":"https://api.github.com/repos/rust-lang/cargo/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/cargo/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/cargo/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/cargo/subscription","commits_url":"https://api.github.com/repos/rust-lang/cargo/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/cargo/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/cargo/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/cargo/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/cargo/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/cargo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/cargo/merges","archive_url":"https://api.github.com/repos/rust-lang/cargo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/cargo/downloads","issues_url":"https://api.github.com/repos/rust-lang/cargo/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/cargo/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/cargo/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/cargo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/cargo/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/cargo/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang/cargo/deployments","created_at":"2014-03-04T23:20:42Z","updated_at":"2016-09-30T11:59:48Z","pushed_at":"2016-09-30T16:18:55Z","git_url":"git://github.com/rust-lang/cargo.git","ssh_url":"git@github.com:rust-lang/cargo.git","clone_url":"https://github.com/rust-lang/cargo.git","svn_url":"https://github.com/rust-lang/cargo","homepage":"https://crates.io/","size":80891,"stargazers_count":1820,"watchers_count":1820,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":449,"mirror_url":null,"open_issues_count":387,"forks":449,"open_issues":387,"watchers":1820,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/3139"},"html":{"href":"https://github.com/rust-lang/cargo/pull/3139"},"issue":{"href":"https://api.github.com/repos/rust-lang/cargo/issues/3139"},"comments":{"href":"https://api.github.com/repos/rust-lang/cargo/issues/3139/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/3139/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/cargo/pulls/3139/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/cargo/statuses/b43e6dd2d6d9965cae17698b40201ca4b5143b06"}}}}
{"actor":{"display_login":"alexcrichton"}}