Skip to content

Commit bcc6c3e

Browse files
committed
Require unsafe block for inline assembly.
1 parent fc78b93 commit bcc6c3e

File tree

1 file changed

+4
-1
lines changed
  • src/librustc/middle/typeck/check

1 file changed

+4
-1
lines changed

src/librustc/middle/typeck/check/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2303,7 +2303,10 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
23032303
let region_lb = ty::re_scope(expr.id);
23042304
instantiate_path(fcx, pth, tpt, expr.span, expr.id, region_lb);
23052305
}
2306-
ast::expr_inline_asm(*) => { fcx.write_nil(id); }
2306+
ast::expr_inline_asm(*) => {
2307+
fcx.require_unsafe(expr.span, ~"use of inline assembly");
2308+
fcx.write_nil(id);
2309+
}
23072310
ast::expr_mac(_) => tcx.sess.bug(~"unexpanded macro"),
23082311
ast::expr_break(_) => { fcx.write_bot(id); bot = true; }
23092312
ast::expr_again(_) => { fcx.write_bot(id); bot = true; }

0 commit comments

Comments
 (0)