2012-12-10 19:32:48 -06:00
|
|
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2012-12-28 21:36:35 -06:00
|
|
|
pub mod stream {
|
2013-02-20 19:07:17 -06:00
|
|
|
pub enum Stream<T:Owned> { send(T, ::stream::server::Stream<T>), }
|
2012-12-28 21:36:35 -06:00
|
|
|
pub mod server {
|
|
|
|
use core::option;
|
|
|
|
use core::pipes;
|
|
|
|
|
2013-02-20 19:07:17 -06:00
|
|
|
impl<T:Owned> Stream<T> {
|
2012-12-28 21:36:35 -06:00
|
|
|
pub fn recv() -> extern fn(+v: Stream<T>) -> ::stream::Stream<T> {
|
2012-07-09 21:15:25 -05:00
|
|
|
// resolve really should report just one error here.
|
|
|
|
// Change the test case when it changes.
|
2012-12-28 21:36:35 -06:00
|
|
|
pub fn recv(+pipe: Stream<T>) -> ::stream::Stream<T> { //~ ERROR attempt to use a type argument out of scope
|
2012-07-09 21:15:25 -05:00
|
|
|
//~^ ERROR use of undeclared type name
|
|
|
|
//~^^ ERROR attempt to use a type argument out of scope
|
|
|
|
//~^^^ ERROR use of undeclared type name
|
|
|
|
option::unwrap(pipes::recv(pipe))
|
|
|
|
}
|
|
|
|
recv
|
|
|
|
}
|
|
|
|
}
|
2012-12-28 21:36:35 -06:00
|
|
|
|
2013-02-20 19:07:17 -06:00
|
|
|
pub type Stream<T:Owned> = pipes::RecvPacket<::stream::Stream<T>>;
|
2012-07-09 21:15:25 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|