about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa/traits
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2018-12-02 16:53:39 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2019-03-29 17:17:12 +0100
commit7b94195c22f20feed07dd033f4e2f866a0a29b0b (patch)
treee508dd48804d74ad9ef7c9dbddd4d30e3cfb8722 /src/librustc_codegen_ssa/traits
parenta3fa1161d22f5055e28340cd6c00d1451e4d9572 (diff)
Remove const_{cstr,str_slice,get_elt,get_real} and is_const_real methods from cg_ssa
This introduces the static_panic_msg trait method to StaticBuilderMethods.
Diffstat (limited to 'src/librustc_codegen_ssa/traits')
-rw-r--r--src/librustc_codegen_ssa/traits/consts.rs9
-rw-r--r--src/librustc_codegen_ssa/traits/statics.rs9
2 files changed, 9 insertions, 9 deletions
diff --git a/src/librustc_codegen_ssa/traits/consts.rs b/src/librustc_codegen_ssa/traits/consts.rs
index 61db94d53d8..32412f303c1 100644
--- a/src/librustc_codegen_ssa/traits/consts.rs
+++ b/src/librustc_codegen_ssa/traits/consts.rs
@@ -3,7 +3,6 @@ use crate::mir::place::PlaceRef;
 use rustc::mir::interpret::Allocation;
 use rustc::mir::interpret::Scalar;
 use rustc::ty::layout;
-use syntax::symbol::LocalInternedString;
 
 pub trait ConstMethods<'tcx>: BackendTypes {
     // Constant constructors
@@ -19,20 +18,12 @@ pub trait ConstMethods<'tcx>: BackendTypes {
     fn const_usize(&self, i: u64) -> Self::Value;
     fn const_u8(&self, i: u8) -> Self::Value;
 
-    // This is a 'c-like' raw string, which differs from
-    // our boxed-and-length-annotated strings.
-    fn const_cstr(&self, s: LocalInternedString, null_terminated: bool) -> Self::Value;
-
-    fn const_str_slice(&self, s: LocalInternedString) -> Self::Value;
     fn const_struct(&self, elts: &[Self::Value], packed: bool) -> Self::Value;
 
-    fn const_get_elt(&self, v: Self::Value, idx: u64) -> Self::Value;
-    fn const_get_real(&self, v: Self::Value) -> Option<(f64, bool)>;
     fn const_to_uint(&self, v: Self::Value) -> u64;
     fn const_to_opt_u128(&self, v: Self::Value, sign_ext: bool) -> Option<u128>;
 
     fn is_const_integral(&self, v: Self::Value) -> bool;
-    fn is_const_real(&self, v: Self::Value) -> bool;
 
     fn scalar_to_backend(
         &self,
diff --git a/src/librustc_codegen_ssa/traits/statics.rs b/src/librustc_codegen_ssa/traits/statics.rs
index 55c1253f106..d8992c15933 100644
--- a/src/librustc_codegen_ssa/traits/statics.rs
+++ b/src/librustc_codegen_ssa/traits/statics.rs
@@ -1,4 +1,5 @@
 use super::BackendTypes;
+use syntax_pos::symbol::LocalInternedString;
 use rustc::hir::def_id::DefId;
 use rustc::ty::layout::Align;
 
@@ -9,4 +10,12 @@ pub trait StaticMethods: BackendTypes {
 
 pub trait StaticBuilderMethods<'tcx>: BackendTypes {
     fn get_static(&mut self, def_id: DefId) -> Self::Value;
+    fn static_panic_msg(
+        &mut self,
+        msg: Option<LocalInternedString>,
+        filename: LocalInternedString,
+        line: Self::Value,
+        col: Self::Value,
+        kind: &str,
+    ) -> Self::Value;
 }