File: issue-13853.stderr

package info (click to toggle)
rustc 1.87.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 925,564 kB
  • sloc: xml: 158,127; python: 36,039; javascript: 19,761; sh: 19,737; cpp: 18,981; ansic: 13,133; asm: 4,376; makefile: 710; perl: 29; lisp: 28; ruby: 19; sql: 11
file content (43 lines) | stat: -rw-r--r-- 1,443 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
error[E0308]: mismatched types
  --> $DIR/issue-13853.rs:14:9
   |
LL |     fn nodes<'a, I: Iterator<Item=&'a N>>(&self) -> I
   |                  - expected this type parameter     - expected `I` because of return type
...
LL |         self.iter()
   |         ^^^^^^^^^^^ expected type parameter `I`, found `Iter<'_, N>`
   |
   = note: expected type parameter `I`
                      found struct `std::slice::Iter<'_, N>`
   = note: the caller chooses a type for `I` which can be different from `std::slice::Iter<'_, N>`

error[E0599]: no method named `iter` found for reference `&G` in the current scope
  --> $DIR/issue-13853.rs:27:23
   |
LL |     for node in graph.iter() {
   |                       ^^^^ method not found in `&G`

error[E0308]: mismatched types
  --> $DIR/issue-13853.rs:37:13
   |
LL |     iterate(graph);
   |     ------- ^^^^^ expected `&_`, found `Vec<Stuff>`
   |     |
   |     arguments to this function are incorrect
   |
   = note: expected reference `&_`
                 found struct `Vec<Stuff>`
note: function defined here
  --> $DIR/issue-13853.rs:26:4
   |
LL | fn iterate<N: Node, G: Graph<N>>(graph: &G) {
   |    ^^^^^^^                       ---------
help: consider borrowing here
   |
LL |     iterate(&graph);
   |             +

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0308, E0599.
For more information about an error, try `rustc --explain E0308`.