librustc: Forbid inherent implementations that aren't adjacent to the

type they provide an implementation for.

This breaks code like:

    mod foo {
        struct Foo { ... }
    }

    impl foo::Foo {
        ...
    }

Change this code to:

    mod foo {
        struct Foo { ... }

        impl Foo {
            ...
        }
    }

Additionally, if you used the I/O path extension methods `stat`,
`lstat`, `exists`, `is_file`, or `is_dir`, note that these methods have
been moved to the the `std::io::fs::PathExtensions` trait. This breaks
code like:

    fn is_it_there() -> bool {
        Path::new("/foo/bar/baz").exists()
    }

Change this code to:

    use std::io::fs::PathExtensions;

    fn is_it_there() -> bool {
        Path::new("/foo/bar/baz").exists()
    }

Closes #17059.

RFC #155.

[breaking-change]
This commit is contained in:
Patrick Walton 2014-09-10 22:26:41 -07:00
parent a9cf19889a
commit 467bea04fa
20 changed files with 89 additions and 36 deletions

View file

@ -82,6 +82,7 @@ use parse::{new_sub_parser_from_file, ParseSess};
use owned_slice::OwnedSlice;
use std::collections::HashSet;
use std::io::fs::PathExtensions;
use std::mem::replace;
use std::rc::Rc;
use std::gc::{Gc, GC};