about summary refs log tree commit diff
path: root/src/libstd/panicking.rs
AgeCommit message (Collapse)AuthorLines
2019-03-31libstd: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-8/+8
2019-02-28Use the correct stderr when testing libstdJethro Beekman-16/+12
2019-02-28libstd => 2018Taiki Endo-21/+21
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-13Update panic message to be clearer about env-varsDaniel Silverstone-1/+2
Esteban Kuber requested that the panic message make it clear that `RUST_BACKTRACE=1` is an environment variable. This change makes that clear. Wording provided in part by David Tolnay.
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-06Refactor stderr_prints_nothing into a more modular functionJethro Beekman-15/+11
2018-11-30Fix exceeding line width limitVitaly _Vi Shukela-1/+2
2018-11-30panic_immediate_abort: Fix issues from reviewVitaly _Vi Shukela-5/+6
2018-11-30Add libstd and libcore Cargo features "panic_immediate_abort"Vitaly _Vi Shukela-2/+15
It stop asserts and panics from libstd to automatically include string output and formatting code. Use case: developing static executables smaller than 50 kilobytes, where usual formatting code is excessive while keeping debuggability in debug mode. May resolve #54981.
2018-10-06rustc: Allow `#[no_mangle]` anywhere in a crateAlex Crichton-4/+4
This commit updates the compiler to allow the `#[no_mangle]` (and `#[export_name]` attributes) to be located anywhere within a crate. These attributes are unconditionally processed, causing the compiler to always generate an exported symbol with the appropriate name. After some discussion on #54135 it was found that not a great reason this hasn't been allowed already, and it seems to match the behavior that many expect! Previously the compiler would only export a `#[no_mangle]` symbol if it were *publicly reachable*, meaning that it itself is `pub` and it's otherwise publicly reachable from the root of the crate. This new definition is that `#[no_mangle]` *is always reachable*, no matter where it is in a crate or whether it has `pub` or not. This should make it much easier to declare an exported symbol with a known and unique name, even when it's an internal implementation detail of the crate itself. Note that these symbols will persist beyond LTO as well, always making their way to the linker. Along the way this commit removes the `private_no_mangle_functions` lint (also for statics) as there's no longer any need to lint these situations. Furthermore a good number of tests were updated now that symbol visibility has been changed. Closes #54135
2018-09-30Auto merge of #54601 - cuviper:prep-1.31, r=Mark-Simulacrumbors-3/+2
Bump to 1.31.0 and bootstrap from 1.30 beta Closes #54594.
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-3/+2
2018-09-26std: Don't let `rust_panic` get inlinedAlex Crichton-0/+1
It's meant for breakpoints, so if it gets inlined we can't set a breakpoint on it easily!
2018-08-23add #[panic_handler]; deprecate #[panic_implementation]Jorge Aparicio-1/+2
2018-08-22Allow panicking with string literal messages inside constantsOliver Schneider-0/+1
2018-07-10Deny bare trait objects in `src/libstd`.ljedrz-18/+18
2018-06-30Bootstrap from 1.28.0-beta.3Mark Simulacrum-68/+32
2018-06-03remove #[unwind(allowed)]Jorge Aparicio-1/+0
not required because this is a Rust function
2018-06-03undo payload in core::panic! changesJorge Aparicio-79/+30
2018-06-03format payload if possible instead of returning "Box<Any>"Jorge Aparicio-4/+11
2018-06-03implement #[panic_implementation]Jorge Aparicio-3/+94
2018-04-29Add more links in panic docsPazzaz-1/+7
2018-04-13std: Avoid allocating panic message unless neededAlex Crichton-45/+73
This commit removes allocation of the panic message in instances like `panic!("foo: {}", "bar")` if we don't actually end up needing the message. We don't need it in the case of wasm32 right now, and in general it's not needed for panic=abort instances that use the default panic hook. For now this commit only solves the wasm use case where with LTO the allocation is entirely removed, but the panic=abort use case can be implemented at a later date if needed.
2018-04-13std: Minimize size of panicking on wasmAlex Crichton-21/+67
This commit applies a few code size optimizations for the wasm target to the standard library, namely around panics. We notably know that in most configurations it's impossible for us to print anything in wasm32-unknown-unknown so we can skip larger portions of panicking that are otherwise simply informative. This allows us to get quite a nice size reduction. Finally we can also tweak where the allocation happens for the `Box<Any>` that we panic with. By only allocating once unwinding starts we can reduce the size of a panicking wasm module from 44k to 350 bytes.
2018-04-05Bump the bootstrap compiler to 1.26.0 betaAlex Crichton-4/+2
Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-02-20make `#[unwind]` attribute specify expectations more clearlyNiko Matsakis-2/+4
You can now choose between the following: - `#[unwind(allowed)]` - `#[unwind(aborts)]` Per rust-lang/rust#48251, the default is `#[unwind(allowed)]`, though I think we should change this eventually.
2018-01-23Make PanicInfo::message available for std::panic! with a formatting string.Simon Sapin-6/+7
This enables PanicInfo’s Display impl to show the panic message in those cases.
2018-01-23Add an unstable PanicInfo::message(&self) -> Option<&fmt::Arguments> methodSimon Sapin-0/+1
2018-01-23Move PanicInfo and Location to libcoreSimon Sapin-189/+11
Per https://rust-lang.github.io/rfcs/2070-panic-implementation.html
2018-01-10We have Rust 1.25 nowest31-1/+1
2018-01-10Stabilize the panic_col featureest31-2/+1
I've added the panic_col feature in PR #42938. Now it's time to stabilize it! Closes #42939.
2017-08-31Update bootstrap compilerAlex Crichton-34/+0
This commit updates the bootstrap compiler and clears out a number of #[cfg(stage0)] annotations and related business
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-1/+1
Like #43008 (f668999), but _much more aggressive_.
2017-08-12Fix some typosBastien Orivel-12/+13
2017-07-25Switch to begin_panic againest31-10/+9
In https://github.com/rust-lang/rust/pull/42938 we made the compiler emit a call to begin_panic_new in order to pass column info to it. Now with stage0 updated (https://github.com/rust-lang/rust/pull/43320), we can safely change begin_panic and start emitting calls for it again.
2017-07-02Fix the test failure, add comment, and refactor a little bitest31-2/+17
2017-07-02Output line column info when panickingest31-11/+58
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-4/+4
This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-02-15Improve backtrace formating while panicking.Yamakaky-3/+7
- `RUST_BACKTRACE=full` prints all the informations (old behaviour) - `RUST_BACKTRACE=(0|no)` disables the backtrace. - `RUST_BACKTRACE=<everything else>` (including `1`) shows a simplified backtrace, without the function addresses and with cleaned filenames and symbols. Also removes some unneded frames at the beginning and the end. Fixes #37783. PR is #38165.
2017-02-10Change std::panicking::try::Data into a unionwhataloadofwhat-23/+13
No longer potentially call `mem::uninitialized::<!>()` Fixes #39432
2017-02-06std: Remove cfg(cargobuild) annotationsAlex Crichton-3/+3
These are all now no longer needed that we've only got rustbuild in tree.
2016-12-18Implement `fmt::Debug` for all structures in libstd.Corey Farwell-0/+2
Part of https://github.com/rust-lang/rust/issues/31869. Also turn on the `missing_debug_implementations` lint at the crate level.
2016-12-04Add missing examples for panicking objectsGuillaume Gomez-2/+104
2016-11-24Remove completed FIXME.Corey Farwell-1/+1
https://github.com/rust-lang/rust/issues/30530
2016-09-18Add basic doc examples for `std::panic::{set_hook, take_hook}`.Corey Farwell-0/+30
2016-08-24Use `#[prelude_import]` in `libstd`.Jeffrey Seyfried-1/+0
2016-08-11std: Optimize panic::catch_unwind slightlyAlex Crichton-36/+68
The previous implementation of this function was overly conservative with liberal usage of `Option` and `.unwrap()` which in theory never triggers. This commit essentially removes the `Option`s in favor of unsafe implementations, improving the code generation of the fast path for LLVM to see through what's happening more clearly. cc #34727
2016-08-10Added an update_panic_count function to handle access to PANIC_COUNTNikhil Shagrithaya-22/+26
2016-08-10Added a shim around rust_panic to update panic counterNikhil Shagrithaya-0/+10