Skip to content

Commit 4abb93c

Browse files
committed
Fix fallout from allowing impls outside of the type's definition module.
1 parent 2b87651 commit 4abb93c

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

src/librustc_typeck/coherence/orphan.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use middle::traits;
1515
use middle::ty;
1616
use syntax::ast::{Item, ItemImpl};
1717
use syntax::ast;
18-
use syntax::ast_map;
1918
use syntax::ast_util;
2019
use syntax::visit;
2120
use util::ppaux::{Repr, UserString};

src/test/compile-fail/issue-12729.rs renamed to src/test/run-pass/issue-12729.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-tidy-linelength
12-
1311
pub struct Foo;
1412

1513
mod bar {
1614
use Foo;
1715

18-
impl Foo { //~ERROR inherent implementations are only allowed on types defined in the current module
16+
impl Foo {
1917
fn baz(&self) {}
2018
}
2119
}

src/test/compile-fail/issue-7607-2.rs renamed to src/test/run-pass/issue-7607-2.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-tidy-linelength
12-
1311
pub mod a {
1412
pub struct Foo { a: usize }
1513
}
1614

1715
pub mod b {
1816
use a::Foo;
19-
impl Foo { //~ERROR inherent implementations are only allowed on types defined in the current module
17+
impl Foo {
2018
fn bar(&self) { }
2119
}
2220
}

src/test/run-pass/trait-impl-2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
mod Foo {
12-
trait Trait {
11+
pub mod Foo {
12+
pub trait Trait {
1313
fn foo(&self);
1414
}
1515
}

0 commit comments

Comments
 (0)