From 3af8b687d4a6ef462eb74b1f5a1cbb8f191902fd Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Sat, 31 Jan 2015 11:52:09 -0800 Subject: [PATCH] fix(rustup): switch to unstable features --- benches/client.rs | 2 +- benches/client_mock_tcp.rs | 2 +- benches/server.rs | 4 ++-- examples/client.rs | 2 +- examples/hello.rs | 2 +- examples/server.rs | 4 ++-- src/header/common/access_control/allow_headers.rs | 2 +- src/header/common/access_control/allow_methods.rs | 2 +- src/header/common/access_control/allow_origin.rs | 2 +- src/header/common/access_control/max_age.rs | 2 +- src/header/common/access_control/request_headers.rs | 2 +- src/header/common/access_control/request_method.rs | 2 +- src/header/mod.rs | 4 ++-- src/http.rs | 2 +- src/lib.rs | 5 +++-- 15 files changed, 20 insertions(+), 19 deletions(-) diff --git a/benches/client.rs b/benches/client.rs index 0f848d09f2..060c53ab54 100644 --- a/benches/client.rs +++ b/benches/client.rs @@ -1,4 +1,4 @@ -#![allow(unstable)] +#![feature(core, io, test)] extern crate hyper; extern crate test; diff --git a/benches/client_mock_tcp.rs b/benches/client_mock_tcp.rs index 41c13300c8..eb5760ee90 100644 --- a/benches/client_mock_tcp.rs +++ b/benches/client_mock_tcp.rs @@ -1,4 +1,4 @@ -#![allow(unstable)] +#![feature(core, collections, io, test)] extern crate hyper; extern crate test; diff --git a/benches/server.rs b/benches/server.rs index 8ad4703b98..2ffcd75ff9 100644 --- a/benches/server.rs +++ b/benches/server.rs @@ -1,4 +1,4 @@ -#![allow(unstable)] +#![feature(io, test)] extern crate hyper; extern crate test; @@ -26,7 +26,7 @@ fn bench_hyper(b: &mut Bencher) { let server = hyper::Server::http(Ipv4Addr(127, 0, 0, 1), 0); let mut listener = server.listen(hyper_handle).unwrap(); - let url = hyper::Url::parse(format!("http://{}", listener.socket).as_slice()).unwrap(); + let url = hyper::Url::parse(&*format!("http://{}", listener.socket)).unwrap(); b.iter(|| request(url.clone())); listener.close().unwrap(); } diff --git a/examples/client.rs b/examples/client.rs index 436902033a..3852b9d8dc 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -1,4 +1,4 @@ -#![allow(unstable)] +#![feature(os, io)] extern crate hyper; use std::os; diff --git a/examples/hello.rs b/examples/hello.rs index f7f95ace7f..b9ba116a14 100644 --- a/examples/hello.rs +++ b/examples/hello.rs @@ -1,4 +1,4 @@ -#![allow(unstable)] +#![feature(io)] extern crate hyper; use std::old_io::net::ip::Ipv4Addr; diff --git a/examples/server.rs b/examples/server.rs index 5685f1e5d2..cfa61582b0 100644 --- a/examples/server.rs +++ b/examples/server.rs @@ -1,4 +1,4 @@ -#![allow(unstable)] +#![feature(core, io)] extern crate hyper; #[macro_use] extern crate log; @@ -21,7 +21,7 @@ macro_rules! try_return( fn echo(mut req: Request, mut res: Response) { match req.uri { - AbsolutePath(ref path) => match (&req.method, path.as_slice()) { + AbsolutePath(ref path) => match (&req.method, &path[]) { (&Get, "/") | (&Get, "/echo") => { let out = b"Try POST /echo"; diff --git a/src/header/common/access_control/allow_headers.rs b/src/header/common/access_control/allow_headers.rs index ced82397ed..67a732be76 100644 --- a/src/header/common/access_control/allow_headers.rs +++ b/src/header/common/access_control/allow_headers.rs @@ -10,7 +10,7 @@ use header; /// > during the actual request. /// /// Spec: www.w3.org/TR/cors/#access-control-allow-headers-response-header -#[derive(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Debug)] pub struct AccessControlAllowHeaders(pub Vec); impl header::Header for AccessControlAllowHeaders { diff --git a/src/header/common/access_control/allow_methods.rs b/src/header/common/access_control/allow_methods.rs index a156eb2a81..c6023a5756 100644 --- a/src/header/common/access_control/allow_methods.rs +++ b/src/header/common/access_control/allow_methods.rs @@ -11,7 +11,7 @@ use method; /// > actual request. /// /// Spec: www.w3.org/TR/cors/#access-control-allow-methods-response-header -#[derive(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Debug)] pub struct AccessControlAllowMethods(pub Vec); impl header::Header for AccessControlAllowMethods { diff --git a/src/header/common/access_control/allow_origin.rs b/src/header/common/access_control/allow_origin.rs index f2448d66a1..893b522b47 100644 --- a/src/header/common/access_control/allow_origin.rs +++ b/src/header/common/access_control/allow_origin.rs @@ -13,7 +13,7 @@ use header; /// > "*", or "null" in the response. /// /// Spec: www.w3.org/TR/cors/#access-control-allow-origin-response-header -#[derive(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Debug)] pub enum AccessControlAllowOrigin { /// Allow all origins AllowStar, diff --git a/src/header/common/access_control/max_age.rs b/src/header/common/access_control/max_age.rs index 698f4835aa..69e509ca70 100644 --- a/src/header/common/access_control/max_age.rs +++ b/src/header/common/access_control/max_age.rs @@ -9,7 +9,7 @@ use header; /// > preflight request can be cached in a preflight result cache. /// /// Spec: www.w3.org/TR/cors/#access-control-max-age-response-header -#[derive(Clone, Copy, PartialEq, Show)] +#[derive(Clone, Copy, PartialEq, Debug)] pub struct AccessControlMaxAge(pub u32); impl header::Header for AccessControlMaxAge { diff --git a/src/header/common/access_control/request_headers.rs b/src/header/common/access_control/request_headers.rs index 37e87070e1..aa3f7cfb20 100644 --- a/src/header/common/access_control/request_headers.rs +++ b/src/header/common/access_control/request_headers.rs @@ -9,7 +9,7 @@ use header; /// > be used in the actual request as part of the preflight request. /// /// Spec: www.w3.org/TR/cors/#access-control-request-headers-request-header -#[derive(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Debug)] pub struct AccessControlRequestHeaders(pub Vec); impl header::Header for AccessControlRequestHeaders { diff --git a/src/header/common/access_control/request_method.rs b/src/header/common/access_control/request_method.rs index 7cd6038bf5..d679a39047 100644 --- a/src/header/common/access_control/request_method.rs +++ b/src/header/common/access_control/request_method.rs @@ -10,7 +10,7 @@ use method::Method; /// > used in the actual request as part of the preflight request. /// /// Spec: www.w3.org/TR/cors/#access-control-request-method-request-header -#[derive(Clone, PartialEq, Show)] +#[derive(Clone, PartialEq, Debug)] pub struct AccessControlRequestMethod(pub Method); impl header::Header for AccessControlRequestMethod { diff --git a/src/header/mod.rs b/src/header/mod.rs index 4f0548e9d0..73986e888a 100644 --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -484,7 +484,7 @@ impl fmt::Display for Box { } } -/// A wrapper around any Header with a Show impl that calls fmt_header. +/// A wrapper around any Header with a Display impl that calls fmt_header. /// /// This can be used like so: `format!("{}", HeaderFormatter(&header))` to /// get the representation of a Header which will be written to an @@ -555,7 +555,7 @@ mod tests { assert_eq!(accept, Some(Accept(vec![application_vendor, text_plain]))); } - #[derive(Clone, Show)] + #[derive(Clone, Debug)] struct CrazyLength(Option, usize); impl Header for CrazyLength { diff --git a/src/http.rs b/src/http.rs index f08f03d47b..75c2bda42f 100644 --- a/src/http.rs +++ b/src/http.rs @@ -586,7 +586,7 @@ pub fn read_request_line(stream: &mut R) -> HttpResult { pub type StatusLine = (HttpVersion, RawStatus); /// The raw status code and reason-phrase. -#[derive(PartialEq, Show)] +#[derive(PartialEq, Debug)] pub struct RawStatus(pub u16, pub CowString<'static>); impl Clone for RawStatus { diff --git a/src/lib.rs b/src/lib.rs index ee5c8e7e4f..cabc956e2f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,8 @@ -#![feature(slicing_syntax, box_syntax)] +#![feature(core, collections, hash, io, os, std_misc, + slicing_syntax, box_syntax)] #![deny(missing_docs)] -#![allow(unstable)] #![cfg_attr(test, deny(warnings))] +#![cfg_attr(test, feature(test))] //! # Hyper //! Hyper is a fast, modern HTTP implementation written in and for Rust. It