Skip to content

Commit

Permalink
fix ui tests
Browse files Browse the repository at this point in the history
  • Loading branch information
y86-dev committed Apr 9, 2024
1 parent 21af38c commit 5f0747e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
6 changes: 3 additions & 3 deletions tests/ui/colon_instead_of_arrow.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ error[E0308]: mismatched types
= note: expected struct `Bar`
found opaque type `impl pinned_init::PinInit<Bar>`
note: function defined here
--> $RUSTC_SRC/library/core/src/ptr/mod.rs:1360:21
--> $RUSTC_SRC/library/core/src/ptr/mod.rs:1484:21
|
1360 | pub const unsafe fn write<T>(dst: *mut T, src: T) {
1484 | pub const unsafe fn write<T>(dst: *mut T, src: T) {
| ^^^^^
= note: this error originates in the macro `$crate::try_pin_init` which comes from the expansion of the macro `pin_init` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0308`.
7 changes: 6 additions & 1 deletion tests/ui/missing_pin_data.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ error[E0599]: no associated item named `__pin_data` found for struct `Foo` in th
= note: the following trait defines an item `__pin_data`, perhaps you need to implement it:
candidate #1: `HasPinData`
= note: this error originates in the macro `$crate::try_pin_init` which comes from the expansion of the macro `pin_init` (in Nightly builds, run with -Z macro-backtrace for more info)
help: there is an associated function `__init_data` with a similar name
--> $SRC_DIR/src/lib.rs:697:39
|
697| $t$(::<$($generics),*>)?::__init_data()
| ~~~~~~~~~~~

error: aborting due to previous error
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0599`.
4 changes: 2 additions & 2 deletions tests/ui/no_error_coercion.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ error[E0277]: `?` couldn't convert the error to `std::alloc::AllocError`
18 | | a: Box::new(42),
19 | | bar <- init!(Bar { b: 42 }),
20 | | })
| |__________^ the trait `From<Infallible>` is not implemented for `std::alloc::AllocError`
| |__________^ the trait `From<Infallible>` is not implemented for `std::alloc::AllocError`, which is required by `Result<Foo::new::__InitOk, std::alloc::AllocError>: FromResidual<Result<Infallible, Infallible>>`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following other types implement trait `FromResidual<R>`:
Expand All @@ -14,6 +14,6 @@ error[E0277]: `?` couldn't convert the error to `std::alloc::AllocError`
= note: required for `Result<Foo::new::__InitOk, std::alloc::AllocError>` to implement `FromResidual<Result<Infallible, Infallible>>`
= note: this error originates in the macro `$crate::try_init` which comes from the expansion of the macro `try_init` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.
6 changes: 3 additions & 3 deletions tests/ui/no_pin_data_but_pinned_drop.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ error[E0277]: the trait bound `Foo: HasPinData` is not satisfied
| ^^^ the trait `HasPinData` is not implemented for `Foo`
|
note: required by a bound in `PinnedDrop`
--> $SRC_DIR/src/lib.rs:1432:30
--> $SRC_DIR/src/lib.rs:1428:30
|
1432 | pub unsafe trait PinnedDrop: __internal::HasPinData {
1428 | pub unsafe trait PinnedDrop: __internal::HasPinData {
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `PinnedDrop`

error: aborting due to previous error
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.
2 changes: 1 addition & 1 deletion tests/ui/pin_data_but_drop.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ error[E0119]: conflicting implementations of trait `MustNotImplDrop` for type `F
|
= note: this error originates in the macro `$crate::__pin_data` which comes from the expansion of the attribute macro `pin_data` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0119`.
2 changes: 1 addition & 1 deletion tests/ui/useless_pinned_drop.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ error[E0119]: conflicting implementations of trait `UselessPinnedDropImpl_you_ne
|
= note: this error originates in the macro `$crate::__pin_data` which comes from the expansion of the attribute macro `pin_data` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0119`.

0 comments on commit 5f0747e

Please sign in to comment.