|
1 |
| -error[E0601]: `main` function not found in crate `do_not_ice_on_note_and_explain` |
2 |
| - --> $DIR/do-not-ice-on-note_and_explain.rs:2:37 |
| 1 | +error[E0401]: can't reference `Self` constructor from outer item |
| 2 | + --> $DIR/do-not-ice-on-note_and_explain.rs:6:13 |
3 | 3 | |
|
4 |
| -LL | impl<B>A<B>{fn d(){fn d(){Self(1)}}} |
5 |
| - | ^ consider adding a `main` function to `$DIR/do-not-ice-on-note_and_explain.rs` |
| 4 | +LL | impl<B> A<B> { |
| 5 | + | ------------ the inner item doesn't inherit generics from this impl, so `Self` is invalid to reference |
| 6 | +... |
| 7 | +LL | Self(1) |
| 8 | + | ^^^^ help: replace `Self` with the actual type: `A` |
6 | 9 |
|
7 |
| -error[E0277]: the size for values of type `B` cannot be known at compilation time |
8 |
| - --> $DIR/do-not-ice-on-note_and_explain.rs:2:32 |
9 |
| - | |
10 |
| -LL | impl<B>A<B>{fn d(){fn d(){Self(1)}}} |
11 |
| - | - ---- ^ doesn't have a size known at compile-time |
12 |
| - | | | |
13 |
| - | | required by a bound introduced by this call |
14 |
| - | this type parameter needs to be `Sized` |
15 |
| - | |
16 |
| -note: required by a bound in `A` |
17 |
| - --> $DIR/do-not-ice-on-note_and_explain.rs:1:10 |
18 |
| - | |
19 |
| -LL | struct A<B>(B); |
20 |
| - | ^ required by this bound in `A` |
21 |
| - |
22 |
| -error[E0308]: mismatched types |
23 |
| - --> $DIR/do-not-ice-on-note_and_explain.rs:2:32 |
24 |
| - | |
25 |
| -LL | impl<B>A<B>{fn d(){fn d(){Self(1)}}} |
26 |
| - | ---- ^ expected type parameter `B`, found integer |
27 |
| - | | |
28 |
| - | arguments to this function are incorrect |
29 |
| - | |
30 |
| - = note: expected type parameter `B` |
31 |
| - found type `{integer}` |
32 |
| -note: tuple struct defined here |
33 |
| - --> $DIR/do-not-ice-on-note_and_explain.rs:1:8 |
34 |
| - | |
35 |
| -LL | struct A<B>(B); |
36 |
| - | ^ |
37 |
| - |
38 |
| -error[E0308]: mismatched types |
39 |
| - --> $DIR/do-not-ice-on-note_and_explain.rs:2:27 |
40 |
| - | |
41 |
| -LL | impl<B>A<B>{fn d(){fn d(){Self(1)}}} |
42 |
| - | ^^^^^^^ expected `()`, found `A<B>` |
43 |
| - | |
44 |
| - = note: expected unit type `()` |
45 |
| - found struct `A<B>` |
46 |
| -help: consider using a semicolon here |
47 |
| - | |
48 |
| -LL | impl<B>A<B>{fn d(){fn d(){Self(1);}}} |
49 |
| - | + |
50 |
| -help: try adding a return type |
51 |
| - | |
52 |
| -LL | impl<B>A<B>{fn d(){fn d() -> A<B>{Self(1)}}} |
53 |
| - | +++++++ |
54 |
| - |
55 |
| -error[E0277]: the size for values of type `B` cannot be known at compilation time |
56 |
| - --> $DIR/do-not-ice-on-note_and_explain.rs:2:27 |
57 |
| - | |
58 |
| -LL | impl<B>A<B>{fn d(){fn d(){Self(1)}}} |
59 |
| - | - ^^^^^^^ doesn't have a size known at compile-time |
60 |
| - | | |
61 |
| - | this type parameter needs to be `Sized` |
62 |
| - | |
63 |
| -note: required by an implicit `Sized` bound in `A` |
64 |
| - --> $DIR/do-not-ice-on-note_and_explain.rs:1:10 |
65 |
| - | |
66 |
| -LL | struct A<B>(B); |
67 |
| - | ^ required by the implicit `Sized` requirement on this type parameter in `A` |
68 |
| -help: you could relax the implicit `Sized` bound on `B` if it were used through indirection like `&B` or `Box<B>` |
69 |
| - --> $DIR/do-not-ice-on-note_and_explain.rs:1:10 |
70 |
| - | |
71 |
| -LL | struct A<B>(B); |
72 |
| - | ^ - ...if indirection were used here: `Box<B>` |
73 |
| - | | |
74 |
| - | this could be changed to `B: ?Sized`... |
75 |
| - |
76 |
| -error: aborting due to 5 previous errors |
| 10 | +error: aborting due to 1 previous error |
77 | 11 |
|
78 |
| -Some errors have detailed explanations: E0277, E0308, E0601. |
79 |
| -For more information about an error, try `rustc --explain E0277`. |
| 12 | +For more information about this error, try `rustc --explain E0401`. |
0 commit comments