fix(rustup): Add PhantomData markers to phantom type users

Necessary since [RFC 738](https://github.com/rust-lang/rfcs/blob/master/text/0738-variance.md).
This commit is contained in:
Renato Zannon
2015-02-21 03:45:51 -02:00
committed by Sean McArthur
parent 039e984f68
commit 1904c4561f
4 changed files with 26 additions and 9 deletions

View File

@@ -3,6 +3,7 @@
//! These are responses sent by a `hyper::Server` to clients, after
//! receiving a request.
use std::old_io::IoResult;
use std::marker::PhantomData;
use time::now_utc;
@@ -22,7 +23,9 @@ pub struct Response<'a, W = Fresh> {
// The status code for the request.
status: status::StatusCode,
// The outgoing headers on this response.
headers: header::Headers
headers: header::Headers,
_marker: PhantomData<W>
}
impl<'a, W> Response<'a, W> {
@@ -42,7 +45,8 @@ impl<'a, W> Response<'a, W> {
status: status,
version: version,
body: body,
headers: headers
headers: headers,
_marker: PhantomData,
}
}
@@ -60,7 +64,8 @@ impl<'a> Response<'a, Fresh> {
status: status::StatusCode::Ok,
version: version::HttpVersion::Http11,
headers: header::Headers::new(),
body: ThroughWriter(stream)
body: ThroughWriter(stream),
_marker: PhantomData,
}
}
@@ -119,7 +124,8 @@ impl<'a> Response<'a, Fresh> {
version: self.version,
body: stream,
status: self.status,
headers: self.headers
headers: self.headers,
_marker: PhantomData,
})
}