File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ fn retry ( ) -> impl Sized { }
2+
3+ struct Core < T > ( T ) ;
4+
5+ impl Core < XXX > { //~ ERROR cannot find type `XXX` in this scope
6+ pub fn spawn ( self ) { }
7+ }
8+
9+ fn main ( ) {
10+ let core = Core ( 1 ) ;
11+ core. spawn ( retry ( ) ) ; //~ ERROR this method takes 0 arguments but 1 argument was supplied
12+ }
Original file line number Diff line number Diff line change 1+ error[E0412]: cannot find type `XXX` in this scope
2+ --> $DIR/trait-fn-generic-mismatch.rs:5:11
3+ |
4+ LL | impl Core<XXX> {
5+ | ^^^ not found in this scope
6+ |
7+ help: you might be missing a type parameter
8+ |
9+ LL | impl<XXX> Core<XXX> {
10+ | +++++
11+
12+ error[E0061]: this method takes 0 arguments but 1 argument was supplied
13+ --> $DIR/trait-fn-generic-mismatch.rs:11:10
14+ |
15+ LL | core.spawn(retry());
16+ | ^^^^^ ------- unexpected argument of type `impl Sized`
17+ |
18+ note: method defined here
19+ --> $DIR/trait-fn-generic-mismatch.rs:6:12
20+ |
21+ LL | pub fn spawn(self) {}
22+ | ^^^^^
23+ help: remove the extra argument
24+ |
25+ LL - core.spawn(retry());
26+ LL + core.spawn();
27+ |
28+
29+ error: aborting due to 2 previous errors
30+
31+ Some errors have detailed explanations: E0061, E0412.
32+ For more information about an error, try `rustc --explain E0061`.
You can’t perform that action at this time.
0 commit comments