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]
This commit is contained in:
parent
f1bb6c2f46
commit
a2ebb24ee6
18 changed files with 36 additions and 37 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue