Skip to content

Commit c5c055c

Browse files
committed
tests: compile fail output
1 parent 84abc02 commit c5c055c

3 files changed

Lines changed: 22 additions & 10 deletions

File tree

tests/ui/compile-fail/init/invalid_init.stderr

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ error[E0277]: the trait bound `impl pin_init::PinInit<Bar>: Init<Bar>` is not sa
1010
| |______the trait `Init<Bar>` is not implemented for `impl pin_init::PinInit<Bar>`
1111
| required by a bound introduced by this call
1212
|
13-
= help: the following other types implement trait `Init<T, E>`:
14-
ChainInit<I, F, T, E>
15-
Result<T, E>
13+
help: the following other types implement trait `Init<T, E>`
14+
--> src/lib.rs
15+
|
16+
| / unsafe impl<T: ?Sized, E, I, F> Init<T, E> for ChainInit<I, F, T, E>
17+
| | where
18+
| | I: Init<T, E>,
19+
| | F: FnOnce(&mut T) -> Result<(), E>,
20+
| |_______________________________________^ `ChainInit<I, F, T, E>`
21+
...
22+
| unsafe impl<T, E> Init<T, E> for Result<T, E> {
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Result<T, E>`
1624
= note: this error originates in the macro `$crate::__init_internal` which comes from the expansion of the macro `init` (in Nightly builds, run with -Z macro-backtrace for more info)

tests/ui/compile-fail/init/wrong_generics2.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ error: struct literal body without path
99
|
1010
= note: this error originates in the macro `$crate::__init_internal` which comes from the expansion of the macro `init` (in Nightly builds, run with -Z macro-backtrace for more info)
1111
help: you might have forgotten to add the struct literal inside the block
12-
--> src/macros.rs
13-
|
14-
~ ::core::ptr::write($slot, $t { SomeStruct {
15-
|2 $($acc)*
16-
~ } });
12+
--> $DIR/src/macros.rs
1713
|
14+
~ ::core::ptr::write($slot, $t { SomeStruct {
15+
| $($acc)*
16+
~ } });
17+
|
1818

1919
error: expected one of `)`, `,`, `.`, `?`, or an operator, found `{`
2020
--> tests/ui/compile-fail/init/wrong_generics2.rs:7:13

tests/ui/compile-fail/pin_data/missing_pin.stderr

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ error[E0277]: the trait bound `impl PinInit<usize>: Init<usize, _>` is not satis
77
13 | | })
88
| |__________^ the trait `Init<usize, _>` is not implemented for `impl PinInit<usize>`
99
|
10-
= help: the trait `Init<usize, _>` is not implemented for `impl PinInit<usize>`
11-
but trait `Init<impl PinInit<usize>, Infallible>` is implemented for it
10+
help: the trait `Init<usize, _>` is not implemented for `impl PinInit<usize>`
11+
but trait `Init<impl PinInit<usize>, Infallible>` is implemented for it
12+
--> src/lib.rs
13+
|
14+
| unsafe impl<T> Init<T> for T {
15+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1216
= help: for that trait implementation, expected `impl PinInit<usize>`, found `usize`
1317
note: required by a bound in `__ThePinData::a`
1418
--> tests/ui/compile-fail/pin_data/missing_pin.rs:4:1

0 commit comments

Comments
 (0)