Skip to content

Extern block restriction #5442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/libcore/libc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,9 +1221,8 @@ pub mod funcs {
#[nolink]
#[abi = "cdecl"]
pub mod fcntl {
use libc::types::os::arch::c95::{c_int, c_char};
pub extern {
use libc::types::os::arch::c95::{c_int, c_char};

#[link_name = "_open"]
unsafe fn open(path: *c_char, oflag: c_int, mode: c_int)
-> c_int;
Expand Down Expand Up @@ -1562,11 +1561,11 @@ pub mod funcs {
#[cfg(target_os = "macos")]
#[cfg(target_os = "freebsd")]
pub mod bsd44 {
use libc::types::common::c95::{c_void};
use libc::types::os::arch::c95::{c_char, c_int, c_uint, size_t};

#[abi = "cdecl"]
pub extern {
use libc::types::common::c95::{c_void};
use libc::types::os::arch::c95::{c_char, c_int, c_uint, size_t};

unsafe fn sysctl(name: *c_int, namelen: c_uint,
oldp: *mut c_void, oldlenp: *mut size_t,
newp: *c_void, newlen: size_t) -> c_int;
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/rt/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ pub fn get() -> &Environment {

extern {
fn rust_get_rt_env() -> &Environment;
}
}
4 changes: 2 additions & 2 deletions src/libcore/rt/sched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ enum CleanupJob {

pub impl Scheduler {

static fn new(event_loop: ~EventLoopObject) -> Scheduler {
static pub fn new(event_loop: ~EventLoopObject) -> Scheduler {
Scheduler {
event_loop: event_loop,
task_queue: WorkQueue::new(),
Expand Down Expand Up @@ -296,7 +296,7 @@ pub struct Task {
}

impl Task {
static fn new(stack_pool: &mut StackPool, start: ~fn()) -> Task {
static pub fn new(stack_pool: &mut StackPool, start: ~fn()) -> Task {
// XXX: Putting main into a ~ so it's a thin pointer and can
// be passed to the spawn function. Another unfortunate
// allocation
Expand Down
3 changes: 1 addition & 2 deletions src/libcore/rt/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ pub impl StackSegment {
pub struct StackPool(());

impl StackPool {

static fn new() -> StackPool { StackPool(()) }
static pub fn new() -> StackPool { StackPool(()) }

fn take_segment(&self, min_size: uint) -> StackSegment {
StackSegment::new(min_size)
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/rt/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct Thread {
}

impl Thread {
static fn start(main: ~fn()) -> Thread {
static pub fn start(main: ~fn()) -> Thread {
fn substart(main: &fn()) -> *raw_thread {
unsafe { rust_raw_thread_start(&main) }
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/task/rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub type rust_task = libc::c_void;
#[allow(non_camel_case_types)] // runtime type
pub type rust_closure = libc::c_void;

extern {
pub extern {
#[rust_stack]
fn rust_task_yield(task: *rust_task) -> bool;

Expand Down
1 change: 1 addition & 0 deletions src/librustc/metadata/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ fn item_family(item: ebml::Doc) -> Family {

fn item_visibility(item: ebml::Doc) -> ast::visibility {
let visibility = reader::get_doc(item, tag_items_data_item_visibility);
debug!("item visibility for %?", item_family(item));
match reader::doc_as_u8(visibility) as char {
'y' => ast::public,
'n' => ast::private,
Expand Down
9 changes: 8 additions & 1 deletion src/librustc/metadata/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,7 @@ fn encode_info_for_item(ecx: @EncodeContext, ebml_w: writer::Encoder,
encode_family(ebml_w, purity_fn_family(mty.fty.purity));
encode_self_type(ebml_w, mty.self_ty);
encode_method_sort(ebml_w, 'r');
encode_visibility(ebml_w, ast::public);
ebml_w.end_tag();
}
provided(m) => {
Expand All @@ -896,6 +897,7 @@ fn encode_info_for_item(ecx: @EncodeContext, ebml_w: writer::Encoder,
encode_family(ebml_w, purity_fn_family(mty.fty.purity));
encode_self_type(ebml_w, mty.self_ty);
encode_method_sort(ebml_w, 'p');
encode_visibility(ebml_w, m.vis);
ebml_w.end_tag();
}
}
Expand Down Expand Up @@ -930,6 +932,11 @@ fn encode_info_for_item(ecx: @EncodeContext, ebml_w: writer::Encoder,
let mut m_path = vec::append(~[], path); // :-(
m_path += [ast_map::path_name(item.ident)];
encode_path(ecx, ebml_w, m_path, ast_map::path_name(ty_m.ident));

// For now, use the item visibility until trait methods can have
// real visibility in the AST.
encode_visibility(ebml_w, item.vis);

ebml_w.end_tag();
}

Expand Down Expand Up @@ -1018,7 +1025,7 @@ fn encode_info_for_items(ecx: @EncodeContext, ebml_w: writer::Encoder,
|ni, cx, v| {
visit::visit_foreign_item(ni, cx, v);
match ecx.tcx.items.get(&ni.id) {
ast_map::node_foreign_item(_, abi, pt) => {
ast_map::node_foreign_item(_, abi, _, pt) => {
encode_info_for_foreign_item(ecx, ebml_w, ni,
index, /*bad*/copy *pt,
abi);
Expand Down
Loading