rust/src/libstd
bors 712c630ab6 auto merge of #12300 : DaGenix/rust/uppercase-variable-lint, r=alexcrichton
I added a new lint for variables whose names contain uppercase characters, since, by convention, variable names should be all lowercase. What motivated me to work on this was when I ran into something like the following:

```rust
use std::io::File;
use std::io::IoError;

fn main() {
    let mut f = File::open(&Path::new("/something.txt"));
    let mut buff = [0u8, ..16];
    match f.read(buff) {
        Ok(cnt) => println!("read this many bytes: {}", cnt),
        Err(IoError{ kind: EndOfFile, .. }) => println!("Got end of file: {}", EndOfFile.to_str()),
    }
}
```

I then got compile errors when I tried to add a wildcard match pattern at the end which I found very confusing since I believed that the 2nd match arm was only matching the EndOfFile condition. The problem is that I hadn't imported io::EndOfFile into the local scope. So, I thought that I was using EndOfFile as a sub-pattern, however, what I was actually doing was creating a new local variable named EndOfFile. This lint makes this error easier to spot by providing a warning that the variable name EndOfFile contains a uppercase characters which provides a nice hint as to why the code isn't doing what is intended.

The lint warns on local bindings as well:

```rust
let Hi = 0;
```

And also struct fields:

```rust
struct Something {
    X: uint
}
```
2014-03-04 22:06:38 -08:00
..
comm std: Change assert_eq!() to use {} instead of {:?} 2014-02-28 23:01:54 -08:00
fmt std: Switch stdout/stderr to buffered by default 2014-03-01 10:06:20 -08:00
hash Rename all variables that have uppercase characters in their names to use only lowercase characters 2014-03-04 21:23:36 -05:00
io Rename struct fields with uppercase characters in their names to use lowercase 2014-03-04 21:23:37 -05:00
num std: Change assert_eq!() to use {} instead of {:?} 2014-02-28 23:01:54 -08:00
path std: Change assert_eq!() to use {} instead of {:?} 2014-02-28 23:01:54 -08:00
rand Rename all variables that have uppercase characters in their names to use only lowercase characters 2014-03-04 21:23:36 -05:00
rt auto merge of #12616 : alexcrichton/rust/size, r=huonw 2014-02-28 13:26:30 -08:00
sync std: Change assert_eq!() to use {} instead of {:?} 2014-02-28 23:01:54 -08:00
unstable std: Small cleanup and test improvement 2014-02-27 12:03:57 -08:00
any.rs Cleaned up std::any 2014-03-04 21:10:23 +01:00
ascii.rs std: Change assert_eq!() to use {} instead of {:?} 2014-02-28 23:01:54 -08:00
bool.rs std: Change assert_eq!() to use {} instead of {:?} 2014-02-28 23:01:54 -08:00
c_str.rs std: Move raw to std::raw 2014-02-23 01:07:53 -08:00
cast.rs std: Move raw to std::raw 2014-02-23 01:07:53 -08:00
cell.rs std: Change assert_eq!() to use {} instead of {:?} 2014-02-28 23:01:54 -08:00
char.rs Remove all ToStr impls, add Show impls 2014-02-23 20:51:56 -08:00
cleanup.rs std: Move raw to std::raw 2014-02-23 01:07:53 -08:00
clone.rs 'borrowed pointer' -> 'reference' 2014-01-07 18:49:13 -08:00
cmp.rs std: Change assert_eq!() to use {} instead of {:?} 2014-02-28 23:01:54 -08:00
container.rs std: uniform modules titles for doc 2013-12-27 09:49:11 +01:00
default.rs libstd: Remove all support code related to @mut 2014-01-03 14:02:00 -08:00
from_str.rs std: uniform modules titles for doc 2013-12-27 09:49:11 +01:00
gc.rs Fix @str removal tests. 2014-02-02 02:58:57 +11:00
intrinsics.rs std: Change assert_eq!() to use {} instead of {:?} 2014-02-28 23:01:54 -08:00
iter.rs std: Change assert_eq!() to use {} instead of {:?} 2014-02-28 23:01:54 -08:00
kinds.rs Fix all code examples 2014-02-14 23:49:22 -08:00
lib.rs doc: use the newer favicon 2014-03-04 18:37:51 +01:00
libc.rs Allow uppercase_variables in libstd/libc.rs 2014-03-05 00:22:09 -05:00
local_data.rs std: Move intrinsics to std::intrinsics. 2014-02-23 01:07:53 -08:00
logging.rs std: Switch stdout/stderr to buffered by default 2014-03-01 10:06:20 -08:00
macros.rs std: Change assert_eq!() to use {} instead of {:?} 2014-02-28 23:01:54 -08:00
managed.rs std: Move raw to std::raw 2014-02-23 01:07:53 -08:00
mem.rs std: Move intrinsics to std::intrinsics. 2014-02-23 01:07:53 -08:00
ops.rs move extra::test to libtest 2014-02-20 16:03:58 +08:00
option.rs Remove all ToStr impls, add Show impls 2014-02-23 20:51:56 -08:00
os.rs std: Change assert_eq!() to use {} instead of {:?} 2014-02-28 23:01:54 -08:00
owned.rs librustc: Implement placement box for GC and unique pointers. 2014-01-09 16:05:34 -08:00
prelude.rs Cleaned up std::any 2014-03-04 21:10:23 +01:00
ptr.rs std: Change assert_eq!() to use {} instead of {:?} 2014-02-28 23:01:54 -08:00
raw.rs Cleaned up std::any 2014-03-04 21:10:23 +01:00
rc.rs std: clean up ptr a bit 2014-02-15 12:11:41 -05:00
reference.rs Cleaned up imports per coding standards. 2014-02-07 09:59:19 -08:00
reflect.rs std: Move raw to std::raw 2014-02-23 01:07:53 -08:00
repr.rs std: Move raw to std::raw 2014-02-23 01:07:53 -08:00
result.rs Remove all ToStr impls, add Show impls 2014-02-23 20:51:56 -08:00
rtdeps.rs Invoke gcc with -nodefaultlibs 2014-02-14 08:07:46 -08:00
str.rs Rename all variables that have uppercase characters in their names to use only lowercase characters 2014-03-04 21:23:36 -05:00
task.rs Clean up std::task docs, make TaskBuilder a real builder 2014-02-16 15:34:02 -08:00
to_str.rs Remove all ToStr impls, add Show impls 2014-02-23 20:51:56 -08:00
tuple.rs std: Change assert_eq!() to use {} instead of {:?} 2014-02-28 23:01:54 -08:00
unicode.rs
unit.rs Add some missing Show implementations in libstd 2014-02-13 12:54:01 -08:00
vec_ng.rs auto merge of #12697 : thestinger/rust/vec, r=huonw 2014-03-04 17:11:39 -08:00
vec.rs make MutItems iterator sound again 2014-03-04 18:53:57 -05:00