diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-02-17 15:16:22 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-02-17 17:26:59 -0800 |
| commit | d8ba8b00a7be7c9aba8fb5a6c0174e526c5a3d4d (patch) | |
| tree | e5174e340d1249a638ed4b75fa52d22309bf8e66 /src/test | |
| parent | c166fd3041208bda4a55e1fcaaf14a38cc3d6158 (diff) | |
| parent | a2ebb24ee6cc76791ef834cb2d17ecac95756499 (diff) | |
| download | rust-d8ba8b00a7be7c9aba8fb5a6c0174e526c5a3d4d.tar.gz rust-d8ba8b00a7be7c9aba8fb5a6c0174e526c5a3d4d.zip | |
rollup merge of #22459: alexcrichton/feature-names
Conflicts: src/rustbook/main.rs
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/lint-uppercase-variables.rs | 17 |
1 files changed, 8 insertions, 9 deletions
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); |
