librustc: Don't require pub extern to make extern functions visible

This commit is contained in:
Patrick Walton 2013-05-31 11:31:38 -07:00
parent 5028ac7396
commit c582e3eb82
2 changed files with 15 additions and 1 deletions

View file

@ -200,7 +200,7 @@ pub fn check_crate(tcx: ty::ctxt,
f = |item_id| {
match tcx.items.find(&item_id) {
Some(&node_item(item, _)) => item.vis != public,
Some(&node_foreign_item(_, _, vis, _)) => vis != public,
Some(&node_foreign_item(*)) => false,
Some(&node_method(method, impl_did, _)) => {
match method.vis {
private => true,

View file

@ -0,0 +1,14 @@
use std::cast::transmute;
mod a {
extern {
pub fn free(x: *u8);
}
}
fn main() {
unsafe {
a::free(transmute(0));
}
}