Andrew Walbran | d1b91c7 | 2020-08-11 17:12:08 +0100 | [diff] [blame] | 1 | error[E0308]: mismatched types |
David LeGare | ffb07e7 | 2022-03-01 18:48:27 +0000 | [diff] [blame] | 2 | --> tests/ui/self-span.rs:17:21 |
Andrew Walbran | d1b91c7 | 2020-08-11 17:12:08 +0100 | [diff] [blame] | 3 | | |
| 4 | 17 | let _: () = self; |
| 5 | | -- ^^^^ expected `()`, found struct `S` |
| 6 | | | |
| 7 | | expected due to this |
| 8 | |
Joel Galenson | 5448f37 | 2021-04-01 15:10:30 -0700 | [diff] [blame] | 9 | error: the `Self` constructor can only be used with tuple or unit structs |
David LeGare | ffb07e7 | 2022-03-01 18:48:27 +0000 | [diff] [blame] | 10 | --> tests/ui/self-span.rs:18:23 |
Joel Galenson | 5448f37 | 2021-04-01 15:10:30 -0700 | [diff] [blame] | 11 | | |
| 12 | 18 | let _: Self = Self; |
| 13 | | ^^^^ help: use curly brackets: `Self { /* fields */ }` |
| 14 | |
Andrew Walbran | d1b91c7 | 2020-08-11 17:12:08 +0100 | [diff] [blame] | 15 | error[E0308]: mismatched types |
David LeGare | ffb07e7 | 2022-03-01 18:48:27 +0000 | [diff] [blame] | 16 | --> tests/ui/self-span.rs:25:21 |
Andrew Walbran | d1b91c7 | 2020-08-11 17:12:08 +0100 | [diff] [blame] | 17 | | |
| 18 | 25 | let _: () = self; |
| 19 | | -- ^^^^ expected `()`, found enum `E` |
| 20 | | | |
| 21 | | expected due to this |
| 22 | |
| 23 | error[E0533]: expected unit struct, unit variant or constant, found struct variant `Self::V` |
David LeGare | ffb07e7 | 2022-03-01 18:48:27 +0000 | [diff] [blame] | 24 | --> tests/ui/self-span.rs:26:23 |
Andrew Walbran | d1b91c7 | 2020-08-11 17:12:08 +0100 | [diff] [blame] | 25 | | |
| 26 | 26 | let _: Self = Self::V; |
| 27 | | ^^^^^^^ |