use rustc::mir::repr::Literal::*;
match *literal {
Value { ref value } => Ok(self.const_to_ptr(value)?),
- Item { .. } => unimplemented!(),
+ Item { .. } => Err(EvalError::Unimplemented(format!("function pointers are unimplemented"))),
Promoted { index } => {
// TODO(solson): Mark constants and statics as read-only and cache their
// values.
--- /dev/null
+#![feature(custom_attribute)]
+#![allow(dead_code, unused_attributes)]
+
+//error-pattern:function pointers are unimplemented
+
+static mut X: usize = 5;
+
+#[miri_run]
+fn static_mut() {
+ unsafe {
+ X = 6;
+ assert_eq!(X, 6);
+ }
+}
+
+fn main() {}