mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 11:34:11 +00:00
27 lines
419 B
Rust
27 lines
419 B
Rust
|
//@ check-pass
|
||
|
trait Service {
|
||
|
type S;
|
||
|
}
|
||
|
|
||
|
trait Framing {
|
||
|
type F;
|
||
|
}
|
||
|
|
||
|
impl Framing for () {
|
||
|
type F = ();
|
||
|
}
|
||
|
|
||
|
trait HttpService<F: Framing>: Service<S = F::F> {}
|
||
|
|
||
|
type BoxService = Box<dyn HttpService<(), S = ()>>;
|
||
|
|
||
|
fn build_server<F: FnOnce() -> BoxService>(_: F) {}
|
||
|
|
||
|
fn make_server<F: Framing>() -> Box<dyn HttpService<F, S = F::F>> {
|
||
|
unimplemented!()
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
build_server(|| make_server())
|
||
|
}
|