Skip to content

Commit a8e7a46

Browse files
nikomatsakisbrson
authored andcommitted
---
yaml --- r: 5804 b: refs/heads/master c: a566985 h: refs/heads/master v: v3
1 parent 3eb7b54 commit a8e7a46

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: e8a29fbe3cc662898dd9d7a25f9f6708e31fe6b8
2+
refs/heads/master: a56698575c26a1238409ac638f0912f68dbfa7f5

trunk/src/comp/middle/typeck.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,18 +1553,12 @@ fn require_pure_call(ccx: @crate_ctxt, caller_purity: ast::purity,
15531553
ast::impure_fn. {
15541554
let sess = ccx.tcx.sess;
15551555
alt ccx.tcx.def_map.find(callee.id) {
1556-
some(ast::def_fn(_, ast::unsafe_fn.)) {
1557-
if sess.get_opts().check_unsafe {
1558-
ccx.tcx.sess.span_fatal(
1559-
sp,
1560-
"safe function calls function marked unsafe");
1561-
}
1562-
}
1556+
some(ast::def_fn(_, ast::unsafe_fn.)) |
15631557
some(ast::def_native_fn(_, ast::unsafe_fn.)) {
15641558
if sess.get_opts().check_unsafe {
15651559
ccx.tcx.sess.span_fatal(
15661560
sp,
1567-
"native functions can only be invoked from unsafe code");
1561+
"safe function calls function marked unsafe");
15681562
}
15691563
}
15701564
_ {

trunk/src/test/compile-fail/native-unsafe-fn-called.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// -*- rust -*-
22
// error-pattern: safe function calls function marked unsafe
3-
43
native "cdecl" mod test {
54
unsafe fn free();
65
}

0 commit comments

Comments
 (0)