GitHub PullRequestReviewCommentEvent at 2014-03-18 17:53:21
Repository: rust
Actor: nikomatsakis
Payload: {"comment":{"url":"https://api.github.com/repos/mozilla/rust/pulls/comments/10716416","id":10716416,"diff_hunk":"@@ -171,6 +162,28 @@ fn gather_loans_in_local(this: &mut GatherLoanCtxt,\n     visit::walk_local(this, local, ());\n }\n \n+pub fn gather_loans_in_static_initializer(bccx: &mut BorrowckCtxt, expr: &ast::Expr) {\n+\n+    debug!(\"gather_loans_in_item(expr={})\", expr.repr(bccx.tcx));\n+\n+    let mut glcx = GatherLoanCtxt {\n+        bccx: bccx,\n+        id_range: IdRange::max(),\n+        all_loans: Vec::new(),\n+        item_ub: expr.id,\n+        repeating_ids: vec!(expr.id),\n+        move_data: MoveData::new()\n+    };\n+\n+    match expr.node {\n+        // Just visit the expression if the\n+        // item is taking an address.\n+        ast::ExprAddrOf(..) => {","path":"src/librustc/middle/borrowck/gather_loans/mod.rs","position":88,"original_position":88,"commit_id":"53bbf19b2a48dd9529488e55321b3ccf6d7890bb","original_commit_id":"53bbf19b2a48dd9529488e55321b3ccf6d7890bb","user":{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars.githubusercontent.com/u/155238?","gravatar_id":"8f9e4181f2951ca8f21ed5c541686367","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":"This doesn't seem quite right. What about something like:\r\n\r\n```\r\nstruct Wrap<T> { field: T }\r\nstatic UNSAFE: Unsafe<int> = ...;\r\nstatic WRAPPED_UNSAFE: Wrap<&'static Unsafe<int>> = Wrap { field: &UNSAFE };\r\n```","created_at":"2014-03-18T17:53:21Z","updated_at":"2014-03-18T17:53:21Z","html_url":"https://github.com/mozilla/rust/pull/12686#discussion_r10716416","pull_request_url":"https://api.github.com/repos/mozilla/rust/pulls/12686","_links":{"self":{"href":"https://api.github.com/repos/mozilla/rust/pulls/comments/10716416"},"html":{"href":"https://github.com/mozilla/rust/pull/12686#discussion_r10716416"},"pull_request":{"href":"https://api.github.com/repos/mozilla/rust/pulls/12686"}}}}