{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/2788","repository_url":"https://api.github.com/repos/rust-lang/rfcs","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2788/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2788/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2788/events","html_url":"https://github.com/rust-lang/rfcs/pull/2788","id":509126342,"node_id":"MDExOlB1bGxSZXF1ZXN0MzI5Nzc2MDc0","number":2788,"title":"standard lazy types","user":{"login":"matklad","id":1711539,"node_id":"MDQ6VXNlcjE3MTE1Mzk=","avatar_url":"https://avatars3.githubusercontent.com/u/1711539?v=4","gravatar_id":"","url":"https://api.github.com/users/matklad","html_url":"https://github.com/matklad","followers_url":"https://api.github.com/users/matklad/followers","following_url":"https://api.github.com/users/matklad/following{/other_user}","gists_url":"https://api.github.com/users/matklad/gists{/gist_id}","starred_url":"https://api.github.com/users/matklad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matklad/subscriptions","organizations_url":"https://api.github.com/users/matklad/orgs","repos_url":"https://api.github.com/users/matklad/repos","events_url":"https://api.github.com/users/matklad/events{/privacy}","received_events_url":"https://api.github.com/users/matklad/received_events","type":"User","site_admin":false},"labels":[{"id":1137651804,"node_id":"MDU6TGFiZWwxMTM3NjUxODA0","url":"https://api.github.com/repos/rust-lang/rfcs/labels/A-cell","name":"A-cell","color":"f7e101","default":false},{"id":1137002235,"node_id":"MDU6TGFiZWwxMTM3MDAyMjM1","url":"https://api.github.com/repos/rust-lang/rfcs/labels/A-sync","name":"A-sync","color":"f7e101","default":false},{"id":1136708574,"node_id":"MDU6TGFiZWwxMTM2NzA4NTc0","url":"https://api.github.com/repos/rust-lang/rfcs/labels/A-types-libstd","name":"A-types-libstd","color":"f7e101","default":false},{"id":211667901,"node_id":"MDU6TGFiZWwyMTE2Njc5MDE=","url":"https://api.github.com/repos/rust-lang/rfcs/labels/T-libs","name":"T-libs","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2019-10-18T14:43:27Z","updated_at":"2019-10-26T18:25:40Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/2788","html_url":"https://github.com/rust-lang/rfcs/pull/2788","diff_url":"https://github.com/rust-lang/rfcs/pull/2788.diff","patch_url":"https://github.com/rust-lang/rfcs/pull/2788.patch"},"body":"Add support for lazy initialized values to standard library, effectively superseding the popular `lazy_static` crate.\r\n\r\n```rust\r\nuse std::sync::Lazy;\r\n\r\n// `BACKTRACE` implements `Deref<Target = Option<String>>` \r\n// and is initialized on the first access\r\nstatic BACKTRACE: Lazy<Option<String>> = Lazy::new(|| {\r\n    std::env::var(\"RUST_BACKTRACE\").ok()\r\n});\r\n```\r\n\r\n[Rendered](https://github.com/matklad/rfcs/blob/std-lazy/text/0000-standard-lazy-types.md)"},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/546627671","html_url":"https://github.com/rust-lang/rfcs/pull/2788#issuecomment-546627671","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2788","id":546627671,"node_id":"MDEyOklzc3VlQ29tbWVudDU0NjYyNzY3MQ==","user":{"login":"matklad","id":1711539,"node_id":"MDQ6VXNlcjE3MTE1Mzk=","avatar_url":"https://avatars3.githubusercontent.com/u/1711539?v=4","gravatar_id":"","url":"https://api.github.com/users/matklad","html_url":"https://github.com/matklad","followers_url":"https://api.github.com/users/matklad/followers","following_url":"https://api.github.com/users/matklad/following{/other_user}","gists_url":"https://api.github.com/users/matklad/gists{/gist_id}","starred_url":"https://api.github.com/users/matklad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matklad/subscriptions","organizations_url":"https://api.github.com/users/matklad/orgs","repos_url":"https://api.github.com/users/matklad/repos","events_url":"https://api.github.com/users/matklad/events{/privacy}","received_events_url":"https://api.github.com/users/matklad/received_events","type":"User","site_admin":false},"created_at":"2019-10-26T18:25:40Z","updated_at":"2019-10-26T18:25:40Z","author_association":"MEMBER","body":"Yes, you can use this in non-static scope, see the very end of the [guide](https://github.com/matklad/rfcs/blob/std-lazy/text/0000-standard-lazy-types.md#guide-level-explanation) section."}}
{"actor":{"display_login":"matklad"}}