Skip to content

Commit 79dd393

Browse files
committed
Auto merge of #23229 - aturon:stab-path, r=alexcrichton
This commit stabilizes essentially all of the new `std::path` API. The API itself is changed in a couple of ways (which brings it in closer alignment with the RFC): * `.` components are now normalized away, unless they appear at the start of a path. This in turn effects the semantics of e.g. asking for the file name of `foo/` or `foo/.`, both of which yield `Some("foo")` now. This semantics is what the original RFC specified, and is also desirable given early experience rolling out the new API. * The `parent` method is now `without_file` and succeeds if, and only if, `file_name` is `Some(_)`. That means, in particular, that it fails for a path like `foo/../`. This change affects `pop` as well. In addition, the `old_path` module is now deprecated. [breaking-change] r? @alexcrichton
2 parents c9b03c2 + 42c4e48 commit 79dd393

File tree

36 files changed

+405
-317
lines changed

36 files changed

+405
-317
lines changed

src/compiletest/compiletest.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#![feature(std_misc)]
2121
#![feature(test)]
2222
#![feature(core)]
23-
#![feature(path)]
2423
#![feature(io)]
2524
#![feature(net)]
2625
#![feature(path_ext)]

src/compiletest/procsrv.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![allow(deprecated)] // for old path, for dynamic_lib
12+
1113
use std::process::{ExitStatus, Command, Child, Output, Stdio};
1214
use std::io::prelude::*;
1315
use std::dynamic_lib::DynamicLibrary;

src/librustc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#![feature(unsafe_destructor)]
4141
#![feature(staged_api)]
4242
#![feature(std_misc)]
43-
#![feature(path)]
4443
#![feature(io)]
4544
#![feature(path_ext)]
4645
#![feature(str_words)]

src/librustc/plugin/load.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ use std::borrow::ToOwned;
1818
use std::dynamic_lib::DynamicLibrary;
1919
use std::env;
2020
use std::mem;
21+
22+
#[allow(deprecated)]
2123
use std::old_path;
24+
2225
use std::path::PathBuf;
2326
use syntax::ast;
2427
use syntax::codemap::{Span, COMMAND_LINE_SP};
@@ -100,6 +103,7 @@ impl<'a> PluginLoader<'a> {
100103
}
101104

102105
// Dynamically link a registrar function into the compiler process.
106+
#[allow(deprecated)] // until #23197
103107
fn dylink_registrar(&mut self,
104108
span: Span,
105109
path: PathBuf,

src/librustc_back/fs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use std::io;
1212
use std::old_io::fs;
1313
use std::old_io;
14+
#[allow(deprecated)]
1415
use std::old_path;
1516
use std::os;
1617
use std::path::{Path, PathBuf};

src/librustc_back/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@
4242
#![feature(old_io)]
4343
#![feature(old_path)]
4444
#![feature(os)]
45-
#![feature(path)]
4645
#![feature(rustc_private)]
4746
#![feature(staged_api)]
4847
#![feature(rand)]
4948
#![feature(path_ext)]
49+
#![feature(std_misc)]
50+
#![feature(path_relative_from)]
5051

5152
extern crate syntax;
5253
extern crate serialize;

src/librustc_driver/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#![feature(unsafe_destructor)]
3838
#![feature(staged_api)]
3939
#![feature(exit_status)]
40-
#![feature(path)]
4140
#![feature(io)]
4241

4342
extern crate arena;

src/librustc_llvm/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#![feature(libc)]
3232
#![feature(link_args)]
3333
#![feature(staged_api)]
34-
#![feature(path)]
3534
#![cfg_attr(unix, feature(std_misc))]
3635

3736
extern crate libc;

src/librustc_trans/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
#![feature(staged_api)]
4040
#![feature(unicode)]
4141
#![feature(io)]
42-
#![feature(path)]
4342
#![feature(path_ext)]
4443
#![feature(fs)]
4544
#![feature(hash)]
45+
#![feature(path_relative_from)]
4646

4747
extern crate arena;
4848
extern crate flate;

src/librustdoc/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
#![feature(unicode)]
3838
#![feature(str_words)]
3939
#![feature(io)]
40-
#![feature(path)]
4140
#![feature(file_path)]
4241
#![feature(path_ext)]
42+
#![feature(path_relative_from)]
4343

4444
extern crate arena;
4545
extern crate getopts;
@@ -362,6 +362,7 @@ fn parse_externs(matches: &getopts::Matches) -> Result<core::Externs, String> {
362362
/// generated from the cleaned AST of the crate.
363363
///
364364
/// This form of input will run all of the plug/cleaning passes
365+
#[allow(deprecated)] // for old Path in plugin manager
365366
fn rust_input(cratefile: &str, externs: core::Externs, matches: &getopts::Matches) -> Output {
366367
let mut default_passes = !matches.opt_present("no-defaults");
367368
let mut passes = matches.opt_strs("passes");

0 commit comments

Comments
 (0)