]> git.lizzy.rs Git - rust.git/blobdiff - src/interpreter/mod.rs
make sure globals that yield function pointers aren't treated like functions
[rust.git] / src / interpreter / mod.rs
index 15fa4cdd3b842c48a6b4ba945285f5ec38b747dc..6c0d58f1c47e77dc3b3c660fbe236458655d3102 100644 (file)
@@ -1189,7 +1189,7 @@ fn eval_operand(&mut self, op: &mir::Operand<'tcx>) -> EvalResult<Pointer> {
                 match *literal {
                     Value { ref value } => Ok(self.const_to_ptr(value)?),
                     Item { def_id, substs } => {
-                        if ty.is_fn() {
+                        if let ty::TyFnDef(..) = ty.sty {
                             Err(EvalError::Unimplemented("unimplemented: mentions of function items".to_string()))
                         } else {
                             let cid = ConstantId {