From a2ebb24ee6cc76791ef834cb2d17ecac95756499 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 17 Feb 2015 11:05:44 -0800 Subject: [PATCH] std: Rename io/path features with old_ prefix This commit renames the features for the `std::old_io` and `std::old_path` modules to `old_io` and `old_path` to help facilitate migration to the new APIs. This is a breaking change as crates which mention the old feature names now need to be renamed to use the new feature names. [breaking-change] --- src/compiletest/compiletest.rs | 4 ++-- src/libgraphviz/lib.rs | 2 +- src/liblog/lib.rs | 2 +- src/librbml/lib.rs | 2 +- src/librustc/lib.rs | 4 ++-- src/librustc_back/lib.rs | 4 ++-- src/librustc_driver/lib.rs | 4 ++-- src/librustc_llvm/lib.rs | 2 +- src/librustc_trans/lib.rs | 4 ++-- src/librustdoc/lib.rs | 4 ++-- src/libserialize/lib.rs | 4 ++-- src/libstd/old_io/mod.rs | 2 +- src/libstd/old_path/mod.rs | 2 +- src/libsyntax/lib.rs | 4 ++-- src/libterm/lib.rs | 4 ++-- src/libtest/lib.rs | 4 ++-- src/rustbook/main.rs | 4 ++-- .../compile-fail/lint-uppercase-variables.rs | 17 ++++++++--------- 18 files changed, 36 insertions(+), 37 deletions(-) diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs index 6b6251a96c9..df94f7613eb 100644 --- a/src/compiletest/compiletest.rs +++ b/src/compiletest/compiletest.rs @@ -13,8 +13,8 @@ #![feature(box_syntax)] #![feature(collections)] #![feature(int_uint)] -#![feature(io)] -#![feature(path)] +#![feature(old_io)] +#![feature(old_path)] #![feature(rustc_private)] #![feature(unboxed_closures)] #![feature(std_misc)] diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs index a1a271bc5ab..230deabee00 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -276,7 +276,7 @@ #![feature(int_uint)] #![feature(collections)] #![feature(core)] -#![feature(io)] +#![feature(old_io)] use self::LabelText::*; diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index 5edb4a96a7d..4dab07acfd2 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -171,7 +171,7 @@ #![feature(box_syntax)] #![feature(int_uint)] #![feature(core)] -#![feature(io)] +#![feature(old_io)] #![feature(std_misc)] #![feature(env)] diff --git a/src/librbml/lib.rs b/src/librbml/lib.rs index 154dbbdb750..488d5999323 100644 --- a/src/librbml/lib.rs +++ b/src/librbml/lib.rs @@ -28,7 +28,7 @@ #![feature(collections)] #![feature(core)] #![feature(int_uint)] -#![feature(io)] +#![feature(old_io)] #![feature(rustc_private)] #![feature(staged_api)] diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index abf70813d36..fe9a81bb7c9 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -29,10 +29,10 @@ #![feature(core)] #![feature(hash)] #![feature(int_uint)] -#![feature(io)] +#![feature(old_io)] #![feature(libc)] #![feature(env)] -#![feature(path)] +#![feature(old_path)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] diff --git a/src/librustc_back/lib.rs b/src/librustc_back/lib.rs index 54b3e8f2081..d589b063204 100644 --- a/src/librustc_back/lib.rs +++ b/src/librustc_back/lib.rs @@ -35,9 +35,9 @@ #![feature(core)] #![feature(hash)] #![feature(int_uint)] -#![feature(io)] +#![feature(old_io)] #![feature(os)] -#![feature(path)] +#![feature(old_path)] #![feature(rustc_private)] #![feature(staged_api)] #![feature(env)] diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 9b8ca398b12..6357a2b115b 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -28,10 +28,10 @@ #![feature(core)] #![feature(env)] #![feature(int_uint)] -#![feature(io)] +#![feature(old_io)] #![feature(libc)] #![feature(os)] -#![feature(path)] +#![feature(old_path)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index 213e3565362..cc8ec4b40cb 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -29,7 +29,7 @@ #![feature(int_uint)] #![feature(libc)] #![feature(link_args)] -#![feature(path)] +#![feature(old_path)] #![feature(staged_api)] #![feature(std_misc)] diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 21557379e3a..4606200d058 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -30,10 +30,10 @@ #![feature(core)] #![feature(hash)] #![feature(int_uint)] -#![feature(io)] +#![feature(old_io)] #![feature(env)] #![feature(libc)] -#![feature(path)] +#![feature(old_path)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index b09c3f730fc..883f10be3a1 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -25,10 +25,10 @@ #![feature(env)] #![feature(hash)] #![feature(int_uint)] -#![feature(io)] +#![feature(old_io)] #![feature(libc)] #![feature(os)] -#![feature(path)] +#![feature(old_path)] #![feature(rustc_private)] #![feature(staged_api)] #![feature(std_misc)] diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index 6cada2e5614..853da598ab5 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -29,8 +29,8 @@ Core encoding and decoding interfaces. #![feature(collections)] #![feature(core)] #![feature(int_uint)] -#![feature(io)] -#![feature(path)] +#![feature(old_io)] +#![feature(old_path)] #![feature(hash)] #![feature(rustc_private)] #![feature(staged_api)] diff --git a/src/libstd/old_io/mod.rs b/src/libstd/old_io/mod.rs index 3673f590c0a..d3f31ed6b75 100644 --- a/src/libstd/old_io/mod.rs +++ b/src/libstd/old_io/mod.rs @@ -238,7 +238,7 @@ //! concerned with error handling; instead its caller is responsible for //! responding to errors that may occur while attempting to read the numbers. -#![unstable(feature = "io")] +#![unstable(feature = "old_io")] #![deny(unused_must_use)] pub use self::SeekStyle::*; diff --git a/src/libstd/old_path/mod.rs b/src/libstd/old_path/mod.rs index 17cfe1c8297..37de2993c4d 100644 --- a/src/libstd/old_path/mod.rs +++ b/src/libstd/old_path/mod.rs @@ -59,7 +59,7 @@ //! println!("path exists: {}", path.exists()); //! ``` -#![unstable(feature = "path")] +#![unstable(feature = "old_path")] use core::marker::Sized; use ffi::CString; diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index f4b0c867f42..e8bdcd62b58 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -30,9 +30,9 @@ #![feature(env)] #![feature(hash)] #![feature(int_uint)] -#![feature(io)] +#![feature(old_io)] #![feature(libc)] -#![feature(path)] +#![feature(old_path)] #![feature(quote, unsafe_destructor)] #![feature(rustc_private)] #![feature(staged_api)] diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs index c4b3d2813af..81534dbe4c4 100644 --- a/src/libterm/lib.rs +++ b/src/libterm/lib.rs @@ -54,8 +54,8 @@ #![feature(box_syntax)] #![feature(collections)] #![feature(int_uint)] -#![feature(io)] -#![feature(path)] +#![feature(old_io)] +#![feature(old_path)] #![feature(rustc_private)] #![feature(staged_api)] #![feature(std_misc)] diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 860ce209d45..0f90fbdfe0f 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -39,8 +39,8 @@ #![feature(env)] #![feature(hash)] #![feature(int_uint)] -#![feature(io)] -#![feature(path)] +#![feature(old_io)] +#![feature(old_path)] #![feature(rustc_private)] #![feature(staged_api)] #![feature(std_misc)] diff --git a/src/rustbook/main.rs b/src/rustbook/main.rs index a8466465f87..c0e9cac2813 100644 --- a/src/rustbook/main.rs +++ b/src/rustbook/main.rs @@ -11,9 +11,9 @@ #![feature(box_syntax)] #![feature(collections)] #![feature(core)] -#![feature(io)] +#![feature(old_io)] #![feature(os)] -#![feature(path)] +#![feature(old_path)] #![feature(rustdoc)] extern crate rustdoc; diff --git a/src/test/compile-fail/lint-uppercase-variables.rs b/src/test/compile-fail/lint-uppercase-variables.rs index 057b8e3acc6..b68d9dc4645 100644 --- a/src/test/compile-fail/lint-uppercase-variables.rs +++ b/src/test/compile-fail/lint-uppercase-variables.rs @@ -12,12 +12,14 @@ #![allow(dead_code)] #![deny(non_snake_case)] -#![feature(path)] -#![feature(io)] use std::old_io::File; use std::old_io::IoError; +mod foo { + pub enum Foo { Foo } +} + struct Something { X: usize //~ ERROR structure field `X` should have a snake case name such as `x` } @@ -30,13 +32,10 @@ fn main() { let Test: usize = 0; //~ ERROR variable `Test` should have a snake case name such as `test` println!("{}", Test); - let mut f = File::open(&Path::new("something.txt")); - let mut buff = [0u8; 16]; - match f.read(&mut buff) { - Ok(cnt) => println!("read this many bytes: {}", cnt), - Err(IoError{ kind: EndOfFile, .. }) => println!("Got end of file: {:?}", EndOfFile), -//~^ ERROR variable `EndOfFile` should have a snake case name such as `end_of_file` -//~^^ WARN `EndOfFile` is named the same as one of the variants of the type `std::old_io::IoErrorKind` + match foo::Foo::Foo { + Foo => {} +//~^ ERROR variable `Foo` should have a snake case name such as `foo` +//~^^ WARN `Foo` is named the same as one of the variants of the type `foo::Foo` } test(1);