rollup merge of #22459: alexcrichton/feature-names

Conflicts:
	src/rustbook/main.rs
This commit is contained in:
Alex Crichton 2015-02-17 15:16:22 -08:00
commit d8ba8b00a7
18 changed files with 36 additions and 37 deletions

View file

@ -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);