add stage3 markers where necessary for dist-snap

This commit is contained in:
Graydon Hoare 2013-03-20 13:48:05 -07:00
parent bb9e1e2660
commit 9350d14ecb
4 changed files with 8 additions and 0 deletions

View File

@ -110,6 +110,7 @@ pub fn stream<T:Owned>() -> (Port<T>, Chan<T>) {
// required.
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
pub impl<T: Owned> Chan<T> {
fn send(&self, x: T) { chan_send(self, x) }
fn try_send(&self, x: T) -> bool { chan_try_send(self, x) }
@ -149,6 +150,7 @@ fn chan_try_send<T:Owned>(self: &Chan<T>, x: T) -> bool {
// Use an inherent impl so that imports are not required:
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
pub impl<T: Owned> Port<T> {
fn recv(&self) -> T { port_recv(self) }
fn try_recv(&self) -> Option<T> { port_try_recv(self) }
@ -226,6 +228,7 @@ pub fn PortSet<T: Owned>() -> PortSet<T>{
// Use an inherent impl so that imports are not required:
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
pub impl<T:Owned> PortSet<T> {
fn recv(&self) -> T { port_set_recv(self) }
fn try_recv(&self) -> Option<T> { port_set_try_recv(self) }
@ -301,6 +304,7 @@ impl<T: Owned> Peekable<T> for PortSet<T> {
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
pub impl<T: Owned> SharedChan<T> {
fn send(&self, x: T) { shared_chan_send(self, x) }
fn try_send(&self, x: T) -> bool { shared_chan_try_send(self, x) }

View File

@ -77,6 +77,7 @@ pub trait Reader {
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
impl Reader for @Reader {
fn read(&self, bytes: &mut [u8], len: uint) -> uint {
self.read(bytes, len)
@ -659,6 +660,7 @@ pub trait Writer {
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
impl Writer for @Writer {
fn write(&self, v: &[const u8]) { self.write(v) }
fn seek(&self, a: int, b: SeekStyle) { self.seek(a, b) }

View File

@ -369,6 +369,7 @@ fn mk_tests(cx: &TestCtxt) -> @ast::item {
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
fn mk_tests(cx: &TestCtxt) -> @ast::item {
let ext_cx = cx.ext_cx;

View File

@ -28,6 +28,7 @@ pub struct DuplexStream<T, U> {
// Allow these methods to be used without import:
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
pub impl<T:Owned,U:Owned> DuplexStream<T, U> {
fn send(&self, x: T) {
self.chan.send(x)