Skip to content

Commit 396aea8

Browse files
committed
moved renamed docs formatted | impl-inherent-non-conflict.rs
1 parent 4ce6698 commit 396aea8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/ui/impl-inherent-non-conflict.rs renamed to tests/ui/methods/inherent-methods-same-name.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1+
//! Test multiple inherent methods with same name on different type parameters
2+
13
//@ run-pass
24
// Ensure that a user-defined type admits multiple inherent methods
35
// with the same name, which can be called on values that have a
46
// precise enough type to allow distinguishing between the methods.
57

6-
78
struct Foo<T>(T);
89

910
impl Foo<usize> {
10-
fn bar(&self) -> i32 { self.0 as i32 }
11+
fn bar(&self) -> i32 {
12+
self.0 as i32
13+
}
1114
}
1215

1316
impl Foo<isize> {
14-
fn bar(&self) -> i32 { -(self.0 as i32) }
17+
fn bar(&self) -> i32 {
18+
-(self.0 as i32)
19+
}
1520
}
1621

1722
fn main() {

0 commit comments

Comments
 (0)