fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
3.3 KiB84 linesraw
1error[E0599]: no method named `f9` found for type `usize` in the current scope
2  --> $DIR/issue-7575.rs:62:18
3   |
4LL |     u.f8(42) + u.f9(342) + m.fff(42)
5   |                  ^^ this is an associated function, not a method
6   |
7   = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
8note: candidate #1 is defined in the trait `CtxtFn`
9  --> $DIR/issue-7575.rs:4:5
10   |
11LL |     fn f9(_: usize) -> usize;
12   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
13note: candidate #2 is defined in the trait `OtherTrait`
14  --> $DIR/issue-7575.rs:8:5
15   |
16LL |     fn f9(_: usize) -> usize;
17   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
18note: candidate #3 is defined in the trait `UnusedTrait`
19  --> $DIR/issue-7575.rs:17:5
20   |
21LL |     fn f9(_: usize) -> usize;
22   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
23   = help: items from traits can only be used if the trait is implemented and in scope
24   = note: the following traits define an item `f9`, perhaps you need to implement one of them:
25           candidate #1: `CtxtFn`
26           candidate #2: `OtherTrait`
27           candidate #3: `UnusedTrait`
28help: disambiguate the method call for candidate #1
29   |
30LL |     u.f8(42) + CtxtFn::f9(u, 342) + m.fff(42)
31   |                ^^^^^^^^^^^^^^^^^^
32help: disambiguate the method call for candidate #2
33   |
34LL |     u.f8(42) + OtherTrait::f9(u, 342) + m.fff(42)
35   |                ^^^^^^^^^^^^^^^^^^^^^^
36help: disambiguate the method call for candidate #3
37   |
38LL |     u.f8(42) + UnusedTrait::f9(u, 342) + m.fff(42)
39   |                ^^^^^^^^^^^^^^^^^^^^^^^
40
41error[E0599]: no method named `fff` found for struct `Myisize` in the current scope
42  --> $DIR/issue-7575.rs:62:30
43   |
44LL | struct Myisize(isize);
45   | ---------------------- method `fff` not found for this
46...
47LL |     u.f8(42) + u.f9(342) + m.fff(42)
48   |                            --^^^
49   |                            | |
50   |                            | this is an associated function, not a method
51   |                            help: use associated function syntax instead: `Myisize::fff`
52   |
53   = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
54note: the candidate is defined in an impl for the type `Myisize`
55  --> $DIR/issue-7575.rs:39:5
56   |
57LL |     fn fff(i: isize) -> isize {
58   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
59
60error[E0599]: no method named `is_str` found for type parameter `T` in the current scope
61  --> $DIR/issue-7575.rs:70:7
62   |
63LL |     t.is_str()
64   |       ^^^^^^ this is an associated function, not a method
65   |
66   = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
67note: the candidate is defined in the trait `ManyImplTrait`
68  --> $DIR/issue-7575.rs:45:5
69   |
70LL |     fn is_str() -> bool {
71   |     ^^^^^^^^^^^^^^^^^^^
72   = help: items from traits can only be used if the type parameter is bounded by the trait
73help: disambiguate the method call for the candidate
74   |
75LL |     ManyImplTrait::is_str(t)
76   |
77help: the following trait defines an item `is_str`, perhaps you need to restrict type parameter `T` with it:
78   |
79LL | fn param_bound<T: ManyImplTrait + ManyImplTrait>(t: T) -> bool {
80   |                ^^^^^^^^^^^^^^^^^^
81
82error: aborting due to 3 previous errors
83
84For more information about this error, try `rustc --explain E0599`.