about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLuqman Aden <me@luqman.ca>2013-03-10 01:55:35 -0800
committerLuqman Aden <me@luqman.ca>2013-03-12 01:03:34 -0700
commitbcc6c3e3dbf4dc42129b46fba23be4f47c83e809 (patch)
tree44b0250a9bd3eb45181b61716c23842858e6a561
parentfc78b93c413e53a43ec568e3ec1d74d35924093b (diff)
downloadrust-bcc6c3e3dbf4dc42129b46fba23be4f47c83e809.tar.gz
rust-bcc6c3e3dbf4dc42129b46fba23be4f47c83e809.zip
Require unsafe block for inline assembly.
-rw-r--r--src/librustc/middle/typeck/check/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs
index bd36eb1cf56..e59dc1398a0 100644
--- a/src/librustc/middle/typeck/check/mod.rs
+++ b/src/librustc/middle/typeck/check/mod.rs
@@ -2303,7 +2303,10 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
         let region_lb = ty::re_scope(expr.id);
         instantiate_path(fcx, pth, tpt, expr.span, expr.id, region_lb);
       }
-      ast::expr_inline_asm(*) => { fcx.write_nil(id); }
+      ast::expr_inline_asm(*) => { 
+          fcx.require_unsafe(expr.span, ~"use of inline assembly");
+          fcx.write_nil(id);
+      }
       ast::expr_mac(_) => tcx.sess.bug(~"unexpanded macro"),
       ast::expr_break(_) => { fcx.write_bot(id); bot = true; }
       ast::expr_again(_) => { fcx.write_bot(id); bot = true; }