diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-10-28 04:53:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-28 04:53:06 +0100 |
| commit | 4728d66206c82c98aa4e1fad751e8aae7489c242 (patch) | |
| tree | a95e0d577f867d3fba9346478e13bcac3dc793a8 /src/librustc_codegen_llvm/builder.rs | |
| parent | c8eefdffe9480bbd84554eab3343f71f04af8f9a (diff) | |
| parent | 86e55b1882ac492d6234e5c5f97c7f151a11f5d2 (diff) | |
Rollup merge of #65664 - anp:panic-location, r=eddyb
`std::panic::Location` is a lang_item, add `core::intrinsics::caller_location` (RFC 2091 3/N) [Tracking issue](https://github.com/rust-lang/rust/issues/47809) [RFC text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md) @eddyb suggested doing this intrinsic implementation ahead of actually implementing the `#[track_caller]` attribute so that there's an easily tested intermediate step between adding the shim and wiring up the attribute.
Diffstat (limited to 'src/librustc_codegen_llvm/builder.rs')
| -rw-r--r-- | src/librustc_codegen_llvm/builder.rs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/librustc_codegen_llvm/builder.rs b/src/librustc_codegen_llvm/builder.rs index 98be0ae4433..312c41b88b0 100644 --- a/src/librustc_codegen_llvm/builder.rs +++ b/src/librustc_codegen_llvm/builder.rs @@ -23,7 +23,6 @@ use std::ffi::CStr; use std::ops::{Deref, Range}; use std::ptr; use std::iter::TrustedLen; -use syntax::symbol::Symbol; // All Builders must have an llfn associated with them #[must_use] @@ -1067,36 +1066,6 @@ impl StaticBuilderMethods for Builder<'a, 'll, 'tcx> { // Forward to the `get_static` method of `CodegenCx` self.cx().get_static(def_id) } - - fn static_panic_msg( - &mut self, - msg: Option<Symbol>, - filename: Symbol, - line: Self::Value, - col: Self::Value, - kind: &str, - ) -> Self::Value { - let align = self.tcx.data_layout.aggregate_align.abi - .max(self.tcx.data_layout.i32_align.abi) - .max(self.tcx.data_layout.pointer_align.abi); - - let filename = self.const_str_slice(filename); - - let with_msg_components; - let without_msg_components; - - let components = if let Some(msg) = msg { - let msg = self.const_str_slice(msg); - with_msg_components = [msg, filename, line, col]; - &with_msg_components as &[_] - } else { - without_msg_components = [filename, line, col]; - &without_msg_components as &[_] - }; - - let struct_ = self.const_struct(&components, false); - self.static_addr_of(struct_, align, Some(kind)) - } } impl Builder<'a, 'll, 'tcx> { |
