From 491bd29945c26a0ff3f03e1d25e9ba635c40713e Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 29 Jul 2014 14:07:09 +0100 Subject: [PATCH] Deprecate the url crate. The replacement is [rust-url](https://github.com/servo/rust-url), which can be used with Cargo. Fix #15874 Fix #10707 Close #10706 Close #10705 Close #8486 --- src/liburl/lib.rs | 7 ++++++- src/test/compile-fail/deprecated-url.rs | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/test/compile-fail/deprecated-url.rs diff --git a/src/liburl/lib.rs b/src/liburl/lib.rs index b95fc3c495e..c7e27c00836 100644 --- a/src/liburl/lib.rs +++ b/src/liburl/lib.rs @@ -11,7 +11,7 @@ //! Types/fns concerning URLs (see RFC 3986) #![crate_name = "url"] -#![experimental] +#![deprecated="This is being removed. Use rust-url instead. http://servo.github.io/rust-url/"] #![crate_type = "rlib"] #![crate_type = "dylib"] #![license = "MIT/ASL2"] @@ -35,6 +35,7 @@ /// # Example /// /// ```rust +/// # #![allow(deprecated)] /// use url::Url; /// /// let raw = "https://username@example.com:8080/foo/bar?baz=qux#quz"; @@ -214,6 +215,7 @@ fn encode_inner(c: T, full_url: bool) -> String { /// # Example /// /// ```rust +/// # #![allow(deprecated)] /// use url::encode; /// /// let url = encode("https://example.com/Rust (programming language)"); @@ -241,6 +243,7 @@ pub fn encode_component(container: T) -> String { /// # Example /// /// ```rust +/// # #![allow(deprecated)] /// use url::decode; /// /// let url = decode("https://example.com/Rust%20(programming%20language)"); @@ -428,6 +431,7 @@ fn query_from_str(rawquery: &str) -> DecodeResult { /// # Example /// /// ```rust +/// # #![allow(deprecated)] /// let query = vec![("title".to_string(), "The Village".to_string()), /// ("north".to_string(), "52.91".to_string()), /// ("west".to_string(), "4.10".to_string())]; @@ -453,6 +457,7 @@ pub fn query_to_str(query: &Query) -> String { /// # Example /// /// ```rust +/// # #![allow(deprecated)] /// use url::get_scheme; /// /// let scheme = match get_scheme("https://example.com/") { diff --git a/src/test/compile-fail/deprecated-url.rs b/src/test/compile-fail/deprecated-url.rs new file mode 100644 index 00000000000..9f1c1fdd7c7 --- /dev/null +++ b/src/test/compile-fail/deprecated-url.rs @@ -0,0 +1,20 @@ +// Copyright 2014 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// ignore-tidy-linelength + +#![deny(deprecated)] + +extern crate url; + +fn main() { + let _ = url::Url::parse("http://example.com"); + //~^ ERROR use of deprecated item: This is being removed. Use rust-url instead. http://servo.github.io/rust-url/ +} -- 2.44.0