derive -> ipc

This commit is contained in:
Nikolay Volf
2016-10-04 19:20:16 +03:00
parent 6e477951ba
commit 2b147616fd
15 changed files with 14 additions and 43 deletions

View File

@@ -49,7 +49,7 @@ pub fn expand_ipc_implementation(
let item = match *annotatable {
Annotatable::Item(ref item) => item,
_ => {
cx.span_err(meta_item.span, "`#[derive(Ipc)]` may only be applied to struct implementations");
cx.span_err(meta_item.span, "`#[ipc]` may only be applied to struct implementations");
return;
},
};
@@ -832,7 +832,7 @@ fn implement_interface(
_ => {
cx.span_err(
item.span,
"`#[derive(Ipc)]` may only be applied to implementations and traits");
"`#[ipc]` may only be applied to implementations and traits");
return Err(Error);
},
};

View File

@@ -83,7 +83,7 @@ pub fn register(reg: &mut syntex::Registry) {
reg.add_attr("feature(custom_derive)");
reg.add_attr("feature(custom_attribute)");
reg.add_decorator("derive_Ipc", codegen::expand_ipc_implementation);
reg.add_decorator("ipc", codegen::expand_ipc_implementation);
reg.add_decorator("derive_Binary", serialization::expand_serialization_implementation);
reg.add_post_expansion_pass(strip_attributes);
@@ -92,7 +92,7 @@ pub fn register(reg: &mut syntex::Registry) {
#[cfg(not(feature = "with-syntex"))]
pub fn register(reg: &mut rustc_plugin::Registry) {
reg.register_syntax_extension(
syntax::parse::token::intern("derive_Ipc"),
syntax::parse::token::intern("ipc"),
syntax::ext::base::MultiDecorator(
Box::new(codegen::expand_ipc_implementation)));
reg.register_syntax_extension(

View File

@@ -40,12 +40,12 @@ pub struct ModuleState {
}
#[derive(Ipc)]
#[ipc]
pub trait ControlService {
fn shutdown(&self) -> bool;
}
#[derive(Ipc)]
#[ipc]
impl HypervisorService {
// return type for making method synchronous
fn module_ready(&self, module_id: u64, control_url: String) -> bool {

View File

@@ -33,7 +33,7 @@ impl IpcConfig for DBWriter {}
#[derive(Binary)]
pub enum DBError { Write, Read }
#[derive(Ipc)]
#[ipc]
impl<L: Sized> DBWriter for DB<L> {
fn write(&self, data: Vec<u8>) -> Result<(), DBError> {
let mut writes = self.writes.write().unwrap();
@@ -48,7 +48,7 @@ impl<L: Sized> DBWriter for DB<L> {
}
}
#[derive(Ipc)]
#[ipc]
trait DBNotify {
fn notify(&self, a: u64, b: u64) -> bool;
}

View File

@@ -28,7 +28,7 @@ pub struct CustomData {
pub b: u64,
}
#[derive(Ipc)]
#[ipc]
impl Service {
fn commit(&self, f: u32) -> u32 {
let mut lock = self.commits.write().unwrap();

View File

@@ -18,7 +18,6 @@ use ipc::IpcConfig;
pub struct BadlyNamedService;
#[derive(Ipc)]
#[ipc(client_ident="PrettyNamedClient")]
impl BadlyNamedService {
fn is_zero(&self, x: u64) -> bool {