We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ce6698 commit 396aea8Copy full SHA for 396aea8
tests/ui/impl-inherent-non-conflict.rs renamed to tests/ui/methods/inherent-methods-same-name.rs
@@ -1,17 +1,22 @@
1
+//! Test multiple inherent methods with same name on different type parameters
2
+
3
//@ run-pass
4
// Ensure that a user-defined type admits multiple inherent methods
5
// with the same name, which can be called on values that have a
6
// precise enough type to allow distinguishing between the methods.
7
-
8
struct Foo<T>(T);
9
10
impl Foo<usize> {
- fn bar(&self) -> i32 { self.0 as i32 }
11
+ fn bar(&self) -> i32 {
12
+ self.0 as i32
13
+ }
14
}
15
16
impl Foo<isize> {
- fn bar(&self) -> i32 { -(self.0 as i32) }
17
18
+ -(self.0 as i32)
19
20
21
22
fn main() {
0 commit comments