{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/32900","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/32900/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/32900/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/32900/events","html_url":"https://github.com/rust-lang/rust/pull/32900","id":147614935,"number":32900,"title":"rustc: Implement custom panic runtimes","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},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/relnotes","name":"relnotes","color":"fad8c7"}],"state":"open","locked":false,"assignee":{"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},"milestone":null,"comments":12,"created_at":"2016-04-12T02:34:46Z","updated_at":"2016-04-14T18:25:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/32900","html_url":"https://github.com/rust-lang/rust/pull/32900","diff_url":"https://github.com/rust-lang/rust/pull/32900.diff","patch_url":"https://github.com/rust-lang/rust/pull/32900.patch"},"body":"This commit is an implementation of [RFC 1513] which allows applications to\r\nalter the behavior of panics at compile time. A new compiler flag, `-C panic`,\r\nis added and accepts the values `unwind` or `panic`, with the default being\r\n`unwind`. This model affects how code is generated for the local crate, skipping\r\ngeneration of landing pads with `-C panic=abort`.\r\n\r\n[RFC 1513]: https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md\r\n\r\nPanic implementations are then provided by crates tagged with\r\n`#![panic_runtime]` and lazily required by crates with\r\n`#![needs_panic_runtime]`. The panic strategy (`-C panic` value) of the panic\r\nruntime must match the final product, and if the panic strategy is not `abort`\r\nthen the entire DAG must have the same panic strategy.\r\n\r\nWith the `-C panic=abort` strategy, users can expect a stable method to disable\r\ngeneration of landing pads, improving optimization in niche scenarios,\r\ndecreasing compile time, and decreasing output binary size. With the `-C\r\npanic=unwind` strategy users can expect the existing ability to isolate failure\r\nin Rust code from the outside world.\r\n\r\nOrganizationally, this commit dismantles the `sys_common::unwind` module in\r\nfavor of some bits moving part of it to `libpanic_unwind` and the rest into the\r\n`panicking` module in libstd. The custom panic runtime support is pretty similar\r\nto the custom allocator support with the only major difference being how the\r\npanic runtime is injected (takes the `-C panic` flag into account).\r\n\r\nCloses #32837"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/210088094","html_url":"https://github.com/rust-lang/rust/pull/32900#issuecomment-210088094","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/32900","id":210088094,"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},"created_at":"2016-04-14T18:25:14Z","updated_at":"2016-04-14T18:25:14Z","body":"@bors: r=nikomatsakis 155a9c6"}}