mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-13 23:42:56 +00:00
librustc: Don't require pub extern
to make extern functions visible
This commit is contained in:
parent
b8391ccea0
commit
1e52eede31
@ -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,
|
||||
|
14
src/test/run-pass/pub-extern-privacy.rs
Normal file
14
src/test/run-pass/pub-extern-privacy.rs
Normal file
@ -0,0 +1,14 @@
|
||||
use std::cast::transmute;
|
||||
|
||||
mod a {
|
||||
extern {
|
||||
pub fn free(x: *u8);
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
a::free(transmute(0));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user