{"action":"created","comment":{"url":"https://api.github.com/repos/habitat-sh/habitat/pulls/comments/345261276","pull_request_review_id":315605464,"id":345261276,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM0NTI2MTI3Ng==","diff_hunk":"@@ -1,17 +1,15 @@\n-use std::{ffi::CStr,\n-          mem};\n-\n-use libc;\n-\n use crate::{error::{Error,\n                     Result},\n             os::system::Uname};\n use errno::errno;\n+use libc;\n+use std::{ffi::CStr,\n+          mem};\n \n pub fn uname() -> Result<Uname> { unsafe { uname_libc() } }\n \n unsafe fn uname_libc() -> Result<Uname> {\n-    let mut utsname: libc::utsname = mem::uninitialized();\n+    let mut utsname: libc::utsname = mem::MaybeUninit::uninit().assume_init();","path":"components/core/src/os/system/linux.rs","position":18,"original_position":18,"commit_id":"1024c2132b7a04f87ca8f696a55b37040a135872","original_commit_id":"1024c2132b7a04f87ca8f696a55b37040a135872","user":{"login":"davidMcneil","id":1497626,"node_id":"MDQ6VXNlcjE0OTc2MjY=","avatar_url":"https://avatars2.githubusercontent.com/u/1497626?v=4","gravatar_id":"","url":"https://api.github.com/users/davidMcneil","html_url":"https://github.com/davidMcneil","followers_url":"https://api.github.com/users/davidMcneil/followers","following_url":"https://api.github.com/users/davidMcneil/following{/other_user}","gists_url":"https://api.github.com/users/davidMcneil/gists{/gist_id}","starred_url":"https://api.github.com/users/davidMcneil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidMcneil/subscriptions","organizations_url":"https://api.github.com/users/davidMcneil/orgs","repos_url":"https://api.github.com/users/davidMcneil/repos","events_url":"https://api.github.com/users/davidMcneil/events{/privacy}","received_events_url":"https://api.github.com/users/davidMcneil/received_events","type":"User","site_admin":false},"body":"I believe this is equivalent to using `mem::uninitialized()` directly and still has the potential for undefined behavior. To avoid undefined behavior we need to initialize the memory before calling `assume_init`. So something like:\r\n\r\n```rust\r\n    let mut utsname = mem::MaybeUninit::uninit();\r\n    let rv = libc::uname(utsname.as_mut_ptr());\r\n    let utsname = utsname.assume_init();\r\n```\r\n\r\n[Here](https://doc.rust-lang.org/std/mem/union.MaybeUninit.html#examples) are good examples of correct usage.","created_at":"2019-11-12T15:09:35Z","updated_at":"2019-11-12T15:10:40Z","html_url":"https://github.com/habitat-sh/habitat/pull/7177#discussion_r345261276","pull_request_url":"https://api.github.com/repos/habitat-sh/habitat/pulls/7177","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/comments/345261276"},"html":{"href":"https://github.com/habitat-sh/habitat/pull/7177#discussion_r345261276"},"pull_request":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/7177"}}},"pull_request":{"url":"https://api.github.com/repos/habitat-sh/habitat/pulls/7177","id":338923165,"node_id":"MDExOlB1bGxSZXF1ZXN0MzM4OTIzMTY1","html_url":"https://github.com/habitat-sh/habitat/pull/7177","diff_url":"https://github.com/habitat-sh/habitat/pull/7177.diff","patch_url":"https://github.com/habitat-sh/habitat/pull/7177.patch","issue_url":"https://api.github.com/repos/habitat-sh/habitat/issues/7177","number":7177,"state":"open","locked":false,"title":"Rust 1.39.0","user":{"login":"raskchanky","id":947,"node_id":"MDQ6VXNlcjk0Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/947?v=4","gravatar_id":"","url":"https://api.github.com/users/raskchanky","html_url":"https://github.com/raskchanky","followers_url":"https://api.github.com/users/raskchanky/followers","following_url":"https://api.github.com/users/raskchanky/following{/other_user}","gists_url":"https://api.github.com/users/raskchanky/gists{/gist_id}","starred_url":"https://api.github.com/users/raskchanky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raskchanky/subscriptions","organizations_url":"https://api.github.com/users/raskchanky/orgs","repos_url":"https://api.github.com/users/raskchanky/repos","events_url":"https://api.github.com/users/raskchanky/events{/privacy}","received_events_url":"https://api.github.com/users/raskchanky/received_events","type":"User","site_admin":false},"body":"See commits for more details","created_at":"2019-11-09T01:40:15Z","updated_at":"2019-11-12T15:10:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f795f9d4eac0d020193021ac77f0e64c53c151ad","assignee":{"login":"raskchanky","id":947,"node_id":"MDQ6VXNlcjk0Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/947?v=4","gravatar_id":"","url":"https://api.github.com/users/raskchanky","html_url":"https://github.com/raskchanky","followers_url":"https://api.github.com/users/raskchanky/followers","following_url":"https://api.github.com/users/raskchanky/following{/other_user}","gists_url":"https://api.github.com/users/raskchanky/gists{/gist_id}","starred_url":"https://api.github.com/users/raskchanky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raskchanky/subscriptions","organizations_url":"https://api.github.com/users/raskchanky/orgs","repos_url":"https://api.github.com/users/raskchanky/repos","events_url":"https://api.github.com/users/raskchanky/events{/privacy}","received_events_url":"https://api.github.com/users/raskchanky/received_events","type":"User","site_admin":false},"assignees":[{"login":"raskchanky","id":947,"node_id":"MDQ6VXNlcjk0Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/947?v=4","gravatar_id":"","url":"https://api.github.com/users/raskchanky","html_url":"https://github.com/raskchanky","followers_url":"https://api.github.com/users/raskchanky/followers","following_url":"https://api.github.com/users/raskchanky/following{/other_user}","gists_url":"https://api.github.com/users/raskchanky/gists{/gist_id}","starred_url":"https://api.github.com/users/raskchanky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raskchanky/subscriptions","organizations_url":"https://api.github.com/users/raskchanky/orgs","repos_url":"https://api.github.com/users/raskchanky/repos","events_url":"https://api.github.com/users/raskchanky/events{/privacy}","received_events_url":"https://api.github.com/users/raskchanky/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"christophermaier","id":207178,"node_id":"MDQ6VXNlcjIwNzE3OA==","avatar_url":"https://avatars2.githubusercontent.com/u/207178?v=4","gravatar_id":"","url":"https://api.github.com/users/christophermaier","html_url":"https://github.com/christophermaier","followers_url":"https://api.github.com/users/christophermaier/followers","following_url":"https://api.github.com/users/christophermaier/following{/other_user}","gists_url":"https://api.github.com/users/christophermaier/gists{/gist_id}","starred_url":"https://api.github.com/users/christophermaier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christophermaier/subscriptions","organizations_url":"https://api.github.com/users/christophermaier/orgs","repos_url":"https://api.github.com/users/christophermaier/repos","events_url":"https://api.github.com/users/christophermaier/events{/privacy}","received_events_url":"https://api.github.com/users/christophermaier/received_events","type":"User","site_admin":false},{"login":"eeyun","id":12615148,"node_id":"MDQ6VXNlcjEyNjE1MTQ4","avatar_url":"https://avatars1.githubusercontent.com/u/12615148?v=4","gravatar_id":"","url":"https://api.github.com/users/eeyun","html_url":"https://github.com/eeyun","followers_url":"https://api.github.com/users/eeyun/followers","following_url":"https://api.github.com/users/eeyun/following{/other_user}","gists_url":"https://api.github.com/users/eeyun/gists{/gist_id}","starred_url":"https://api.github.com/users/eeyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eeyun/subscriptions","organizations_url":"https://api.github.com/users/eeyun/orgs","repos_url":"https://api.github.com/users/eeyun/repos","events_url":"https://api.github.com/users/eeyun/events{/privacy}","received_events_url":"https://api.github.com/users/eeyun/received_events","type":"User","site_admin":false},{"login":"chefsalim","id":13542112,"node_id":"MDQ6VXNlcjEzNTQyMTEy","avatar_url":"https://avatars2.githubusercontent.com/u/13542112?v=4","gravatar_id":"","url":"https://api.github.com/users/chefsalim","html_url":"https://github.com/chefsalim","followers_url":"https://api.github.com/users/chefsalim/followers","following_url":"https://api.github.com/users/chefsalim/following{/other_user}","gists_url":"https://api.github.com/users/chefsalim/gists{/gist_id}","starred_url":"https://api.github.com/users/chefsalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chefsalim/subscriptions","organizations_url":"https://api.github.com/users/chefsalim/orgs","repos_url":"https://api.github.com/users/chefsalim/repos","events_url":"https://api.github.com/users/chefsalim/events{/privacy}","received_events_url":"https://api.github.com/users/chefsalim/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/habitat-sh/habitat/pulls/7177/commits","review_comments_url":"https://api.github.com/repos/habitat-sh/habitat/pulls/7177/comments","review_comment_url":"https://api.github.com/repos/habitat-sh/habitat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/habitat-sh/habitat/issues/7177/comments","statuses_url":"https://api.github.com/repos/habitat-sh/habitat/statuses/1024c2132b7a04f87ca8f696a55b37040a135872","head":{"label":"habitat-sh:jb/rust-1.39.0","ref":"jb/rust-1.39.0","sha":"1024c2132b7a04f87ca8f696a55b37040a135872","user":{"login":"habitat-sh","id":18171698,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MTcxNjk4","avatar_url":"https://avatars0.githubusercontent.com/u/18171698?v=4","gravatar_id":"","url":"https://api.github.com/users/habitat-sh","html_url":"https://github.com/habitat-sh","followers_url":"https://api.github.com/users/habitat-sh/followers","following_url":"https://api.github.com/users/habitat-sh/following{/other_user}","gists_url":"https://api.github.com/users/habitat-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/habitat-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habitat-sh/subscriptions","organizations_url":"https://api.github.com/users/habitat-sh/orgs","repos_url":"https://api.github.com/users/habitat-sh/repos","events_url":"https://api.github.com/users/habitat-sh/events{/privacy}","received_events_url":"https://api.github.com/users/habitat-sh/received_events","type":"Organization","site_admin":false},"repo":{"id":36098429,"node_id":"MDEwOlJlcG9zaXRvcnkzNjA5ODQyOQ==","name":"habitat","full_name":"habitat-sh/habitat","private":false,"owner":{"login":"habitat-sh","id":18171698,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MTcxNjk4","avatar_url":"https://avatars0.githubusercontent.com/u/18171698?v=4","gravatar_id":"","url":"https://api.github.com/users/habitat-sh","html_url":"https://github.com/habitat-sh","followers_url":"https://api.github.com/users/habitat-sh/followers","following_url":"https://api.github.com/users/habitat-sh/following{/other_user}","gists_url":"https://api.github.com/users/habitat-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/habitat-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habitat-sh/subscriptions","organizations_url":"https://api.github.com/users/habitat-sh/orgs","repos_url":"https://api.github.com/users/habitat-sh/repos","events_url":"https://api.github.com/users/habitat-sh/events{/privacy}","received_events_url":"https://api.github.com/users/habitat-sh/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/habitat-sh/habitat","description":"Modern applications with built-in automation","fork":false,"url":"https://api.github.com/repos/habitat-sh/habitat","forks_url":"https://api.github.com/repos/habitat-sh/habitat/forks","keys_url":"https://api.github.com/repos/habitat-sh/habitat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/habitat-sh/habitat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/habitat-sh/habitat/teams","hooks_url":"https://api.github.com/repos/habitat-sh/habitat/hooks","issue_events_url":"https://api.github.com/repos/habitat-sh/habitat/issues/events{/number}","events_url":"https://api.github.com/repos/habitat-sh/habitat/events","assignees_url":"https://api.github.com/repos/habitat-sh/habitat/assignees{/user}","branches_url":"https://api.github.com/repos/habitat-sh/habitat/branches{/branch}","tags_url":"https://api.github.com/repos/habitat-sh/habitat/tags","blobs_url":"https://api.github.com/repos/habitat-sh/habitat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/habitat-sh/habitat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/habitat-sh/habitat/git/refs{/sha}","trees_url":"https://api.github.com/repos/habitat-sh/habitat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/habitat-sh/habitat/statuses/{sha}","languages_url":"https://api.github.com/repos/habitat-sh/habitat/languages","stargazers_url":"https://api.github.com/repos/habitat-sh/habitat/stargazers","contributors_url":"https://api.github.com/repos/habitat-sh/habitat/contributors","subscribers_url":"https://api.github.com/repos/habitat-sh/habitat/subscribers","subscription_url":"https://api.github.com/repos/habitat-sh/habitat/subscription","commits_url":"https://api.github.com/repos/habitat-sh/habitat/commits{/sha}","git_commits_url":"https://api.github.com/repos/habitat-sh/habitat/git/commits{/sha}","comments_url":"https://api.github.com/repos/habitat-sh/habitat/comments{/number}","issue_comment_url":"https://api.github.com/repos/habitat-sh/habitat/issues/comments{/number}","contents_url":"https://api.github.com/repos/habitat-sh/habitat/contents/{+path}","compare_url":"https://api.github.com/repos/habitat-sh/habitat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/habitat-sh/habitat/merges","archive_url":"https://api.github.com/repos/habitat-sh/habitat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/habitat-sh/habitat/downloads","issues_url":"https://api.github.com/repos/habitat-sh/habitat/issues{/number}","pulls_url":"https://api.github.com/repos/habitat-sh/habitat/pulls{/number}","milestones_url":"https://api.github.com/repos/habitat-sh/habitat/milestones{/number}","notifications_url":"https://api.github.com/repos/habitat-sh/habitat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/habitat-sh/habitat/labels{/name}","releases_url":"https://api.github.com/repos/habitat-sh/habitat/releases{/id}","deployments_url":"https://api.github.com/repos/habitat-sh/habitat/deployments","created_at":"2015-05-22T22:47:14Z","updated_at":"2019-11-12T14:10:56Z","pushed_at":"2019-11-12T14:35:51Z","git_url":"git://github.com/habitat-sh/habitat.git","ssh_url":"git@github.com:habitat-sh/habitat.git","clone_url":"https://github.com/habitat-sh/habitat.git","svn_url":"https://github.com/habitat-sh/habitat","homepage":"https://www.habitat.sh","size":127705,"stargazers_count":2101,"watchers_count":2101,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":696,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":312,"open_issues":696,"watchers":2101,"default_branch":"master"}},"base":{"label":"habitat-sh:master","ref":"master","sha":"2ff916d921503eae780be2cc0cb16865811341c6","user":{"login":"habitat-sh","id":18171698,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MTcxNjk4","avatar_url":"https://avatars0.githubusercontent.com/u/18171698?v=4","gravatar_id":"","url":"https://api.github.com/users/habitat-sh","html_url":"https://github.com/habitat-sh","followers_url":"https://api.github.com/users/habitat-sh/followers","following_url":"https://api.github.com/users/habitat-sh/following{/other_user}","gists_url":"https://api.github.com/users/habitat-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/habitat-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habitat-sh/subscriptions","organizations_url":"https://api.github.com/users/habitat-sh/orgs","repos_url":"https://api.github.com/users/habitat-sh/repos","events_url":"https://api.github.com/users/habitat-sh/events{/privacy}","received_events_url":"https://api.github.com/users/habitat-sh/received_events","type":"Organization","site_admin":false},"repo":{"id":36098429,"node_id":"MDEwOlJlcG9zaXRvcnkzNjA5ODQyOQ==","name":"habitat","full_name":"habitat-sh/habitat","private":false,"owner":{"login":"habitat-sh","id":18171698,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MTcxNjk4","avatar_url":"https://avatars0.githubusercontent.com/u/18171698?v=4","gravatar_id":"","url":"https://api.github.com/users/habitat-sh","html_url":"https://github.com/habitat-sh","followers_url":"https://api.github.com/users/habitat-sh/followers","following_url":"https://api.github.com/users/habitat-sh/following{/other_user}","gists_url":"https://api.github.com/users/habitat-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/habitat-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habitat-sh/subscriptions","organizations_url":"https://api.github.com/users/habitat-sh/orgs","repos_url":"https://api.github.com/users/habitat-sh/repos","events_url":"https://api.github.com/users/habitat-sh/events{/privacy}","received_events_url":"https://api.github.com/users/habitat-sh/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/habitat-sh/habitat","description":"Modern applications with built-in automation","fork":false,"url":"https://api.github.com/repos/habitat-sh/habitat","forks_url":"https://api.github.com/repos/habitat-sh/habitat/forks","keys_url":"https://api.github.com/repos/habitat-sh/habitat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/habitat-sh/habitat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/habitat-sh/habitat/teams","hooks_url":"https://api.github.com/repos/habitat-sh/habitat/hooks","issue_events_url":"https://api.github.com/repos/habitat-sh/habitat/issues/events{/number}","events_url":"https://api.github.com/repos/habitat-sh/habitat/events","assignees_url":"https://api.github.com/repos/habitat-sh/habitat/assignees{/user}","branches_url":"https://api.github.com/repos/habitat-sh/habitat/branches{/branch}","tags_url":"https://api.github.com/repos/habitat-sh/habitat/tags","blobs_url":"https://api.github.com/repos/habitat-sh/habitat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/habitat-sh/habitat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/habitat-sh/habitat/git/refs{/sha}","trees_url":"https://api.github.com/repos/habitat-sh/habitat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/habitat-sh/habitat/statuses/{sha}","languages_url":"https://api.github.com/repos/habitat-sh/habitat/languages","stargazers_url":"https://api.github.com/repos/habitat-sh/habitat/stargazers","contributors_url":"https://api.github.com/repos/habitat-sh/habitat/contributors","subscribers_url":"https://api.github.com/repos/habitat-sh/habitat/subscribers","subscription_url":"https://api.github.com/repos/habitat-sh/habitat/subscription","commits_url":"https://api.github.com/repos/habitat-sh/habitat/commits{/sha}","git_commits_url":"https://api.github.com/repos/habitat-sh/habitat/git/commits{/sha}","comments_url":"https://api.github.com/repos/habitat-sh/habitat/comments{/number}","issue_comment_url":"https://api.github.com/repos/habitat-sh/habitat/issues/comments{/number}","contents_url":"https://api.github.com/repos/habitat-sh/habitat/contents/{+path}","compare_url":"https://api.github.com/repos/habitat-sh/habitat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/habitat-sh/habitat/merges","archive_url":"https://api.github.com/repos/habitat-sh/habitat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/habitat-sh/habitat/downloads","issues_url":"https://api.github.com/repos/habitat-sh/habitat/issues{/number}","pulls_url":"https://api.github.com/repos/habitat-sh/habitat/pulls{/number}","milestones_url":"https://api.github.com/repos/habitat-sh/habitat/milestones{/number}","notifications_url":"https://api.github.com/repos/habitat-sh/habitat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/habitat-sh/habitat/labels{/name}","releases_url":"https://api.github.com/repos/habitat-sh/habitat/releases{/id}","deployments_url":"https://api.github.com/repos/habitat-sh/habitat/deployments","created_at":"2015-05-22T22:47:14Z","updated_at":"2019-11-12T14:10:56Z","pushed_at":"2019-11-12T14:35:51Z","git_url":"git://github.com/habitat-sh/habitat.git","ssh_url":"git@github.com:habitat-sh/habitat.git","clone_url":"https://github.com/habitat-sh/habitat.git","svn_url":"https://github.com/habitat-sh/habitat","homepage":"https://www.habitat.sh","size":127705,"stargazers_count":2101,"watchers_count":2101,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":312,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":696,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":312,"open_issues":696,"watchers":2101,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/7177"},"html":{"href":"https://github.com/habitat-sh/habitat/pull/7177"},"issue":{"href":"https://api.github.com/repos/habitat-sh/habitat/issues/7177"},"comments":{"href":"https://api.github.com/repos/habitat-sh/habitat/issues/7177/comments"},"review_comments":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/7177/comments"},"review_comment":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/7177/commits"},"statuses":{"href":"https://api.github.com/repos/habitat-sh/habitat/statuses/1024c2132b7a04f87ca8f696a55b37040a135872"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"davidMcneil"}}