Skip to content

Commit 491bd29

Browse files
committed
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
1 parent 7a25cf3 commit 491bd29

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

src/liburl/lib.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! Types/fns concerning URLs (see RFC 3986)
1212
1313
#![crate_name = "url"]
14-
#![experimental]
14+
#![deprecated="This is being removed. Use rust-url instead. http://servo.github.io/rust-url/"]
1515
#![crate_type = "rlib"]
1616
#![crate_type = "dylib"]
1717
#![license = "MIT/ASL2"]
@@ -35,6 +35,7 @@ use std::path::BytesContainer;
3535
/// # Example
3636
///
3737
/// ```rust
38+
/// # #![allow(deprecated)]
3839
/// use url::Url;
3940
///
4041
/// let raw = "https://username@example.com:8080/foo/bar?baz=qux#quz";
@@ -214,6 +215,7 @@ fn encode_inner<T: BytesContainer>(c: T, full_url: bool) -> String {
214215
/// # Example
215216
///
216217
/// ```rust
218+
/// # #![allow(deprecated)]
217219
/// use url::encode;
218220
///
219221
/// let url = encode("https://example.com/Rust (programming language)");
@@ -241,6 +243,7 @@ pub type DecodeResult<T> = Result<T, String>;
241243
/// # Example
242244
///
243245
/// ```rust
246+
/// # #![allow(deprecated)]
244247
/// use url::decode;
245248
///
246249
/// let url = decode("https://example.com/Rust%20(programming%20language)");
@@ -428,6 +431,7 @@ fn query_from_str(rawquery: &str) -> DecodeResult<Query> {
428431
/// # Example
429432
///
430433
/// ```rust
434+
/// # #![allow(deprecated)]
431435
/// let query = vec![("title".to_string(), "The Village".to_string()),
432436
/// ("north".to_string(), "52.91".to_string()),
433437
/// ("west".to_string(), "4.10".to_string())];
@@ -453,6 +457,7 @@ pub fn query_to_str(query: &Query) -> String {
453457
/// # Example
454458
///
455459
/// ```rust
460+
/// # #![allow(deprecated)]
456461
/// use url::get_scheme;
457462
///
458463
/// let scheme = match get_scheme("https://example.com/") {
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// ignore-tidy-linelength
12+
13+
#![deny(deprecated)]
14+
15+
extern crate url;
16+
17+
fn main() {
18+
let _ = url::Url::parse("http://example.com");
19+
//~^ ERROR use of deprecated item: This is being removed. Use rust-url instead. http://servo.github.io/rust-url/
20+
}

0 commit comments

Comments
 (0)