-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]
- Loading branch information
Showing
20 changed files
with
89 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
mod foo { | ||
pub struct Foo { | ||
x: int, | ||
y: int, | ||
} | ||
} | ||
|
||
impl foo::Foo { | ||
//~^ ERROR implementations may only be implemented in the same module | ||
fn bar() {} | ||
} | ||
|
||
fn main() {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at pcwalton@467bea0
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging pcwalton/rust/impls-next-to-struct = 467bea0 into auto
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pcwalton/rust/impls-next-to-struct = 467bea0 merged ok, testing candidate = b6e79799
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/1337
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/1336
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/1336
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/1337
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/1331
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/1330
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/1331
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/1335
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/1330
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/1330
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/1334
exception: http://buildbot.rust-lang.org/builders/auto-win32-32-opt/builds/167
exception: http://buildbot.rust-lang.org/builders/auto-win32-32-nopt-t/builds/167
exception: http://buildbot.rust-lang.org/builders/auto-win32-32-nopt-c/builds/167
exception: http://buildbot.rust-lang.org/builders/auto-win64-64-opt/builds/167
exception: http://buildbot.rust-lang.org/builders/auto-win64-64-nopt-t/builds/167
exception: http://buildbot.rust-lang.org/builders/auto-win64-64-nopt-c/builds/167
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at pcwalton@467bea0
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging pcwalton/rust/impls-next-to-struct = 467bea0 into auto
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pcwalton/rust/impls-next-to-struct = 467bea0 merged ok, testing candidate = b7753e79
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/1335
exception: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/1342
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/1341
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/1341
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/1342
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/1336
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/1335
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/1336
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/1340
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/1335
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/1339
exception: http://buildbot.rust-lang.org/builders/auto-win32-32-opt/builds/172
exception: http://buildbot.rust-lang.org/builders/auto-win32-32-nopt-t/builds/172
exception: http://buildbot.rust-lang.org/builders/auto-win32-32-nopt-c/builds/172
exception: http://buildbot.rust-lang.org/builders/auto-win64-64-opt/builds/172
exception: http://buildbot.rust-lang.org/builders/auto-win64-64-nopt-t/builds/172
exception: http://buildbot.rust-lang.org/builders/auto-win64-64-nopt-c/builds/172
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at pcwalton@467bea0
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging pcwalton/rust/impls-next-to-struct = 467bea0 into auto
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pcwalton/rust/impls-next-to-struct = 467bea0 merged ok, testing candidate = 10b27dd2
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-win64-64-nopt-t/builds/175
exception: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/1345
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/1344
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/1344
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/1345
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/1339
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/1338
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/1339
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/1343
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/1338
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/1338
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/1342
exception: http://buildbot.rust-lang.org/builders/auto-win32-32-opt/builds/175
exception: http://buildbot.rust-lang.org/builders/auto-win32-32-nopt-c/builds/175
exception: http://buildbot.rust-lang.org/builders/auto-win64-64-opt/builds/175
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at pcwalton@467bea0
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging pcwalton/rust/impls-next-to-struct = 467bea0 into auto
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pcwalton/rust/impls-next-to-struct = 467bea0 merged ok, testing candidate = 13037a3
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/1349
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/1348
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/1348
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/1349
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/1343
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/1342
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/1343
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/1347
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/1342
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/1342
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/1346
success: http://buildbot.rust-lang.org/builders/auto-win32-32-opt/builds/179
success: http://buildbot.rust-lang.org/builders/auto-win32-32-nopt-t/builds/179
success: http://buildbot.rust-lang.org/builders/auto-win32-32-nopt-c/builds/179
success: http://buildbot.rust-lang.org/builders/auto-win64-64-opt/builds/179
success: http://buildbot.rust-lang.org/builders/auto-win64-64-nopt-t/builds/179
success: http://buildbot.rust-lang.org/builders/auto-win64-64-nopt-c/builds/179
467bea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 13037a3