Skip to content

Commit

Permalink
tests: Update unsized_fn_params ui test
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jun 24, 2024
1 parent 3e5305d commit 72c21f1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 42 deletions.
1 change: 1 addition & 0 deletions tests/ui/pin_project/project_replace_unsized_fn_params.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

#![allow(internal_features)]
#![feature(unsized_fn_params)]

use pin_project::pin_project;
Expand Down
84 changes: 42 additions & 42 deletions tests/ui/pin_project/project_replace_unsized_fn_params.stderr
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:8:8
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:9:8
|
8 | struct Struct<T: ?Sized> {
9 | struct Struct<T: ?Sized> {
| ^^^^^^^-^^^^^^^^^
| | |
| | this type parameter needs to be `Sized`
| doesn't have a size known at compile-time
|
note: required because it appears within the type `__StructProjectionOwned<T>`
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:8:8
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:9:8
|
8 | struct Struct<T: ?Sized> {
9 | struct Struct<T: ?Sized> {
| ^^^^^^
= note: the return type of a function must have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
8 - struct Struct<T: ?Sized> {
8 + struct Struct<T> {
9 - struct Struct<T: ?Sized> {
9 + struct Struct<T> {
|

error[E0277]: the size for values of type `T` cannot be known at compilation time
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:7:1
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:8:1
|
7 | #[pin_project(project_replace)] //~ ERROR E0277
8 | #[pin_project(project_replace)] //~ ERROR E0277
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
8 | struct Struct<T: ?Sized> {
9 | struct Struct<T: ?Sized> {
| - this type parameter needs to be `Sized`
|
note: required because it appears within the type `Struct<T>`
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:8:8
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:9:8
|
8 | struct Struct<T: ?Sized> {
9 | struct Struct<T: ?Sized> {
| ^^^^^^
note: required by a bound in `UnsafeOverwriteGuard::<T>::new`
--> src/lib.rs
Expand All @@ -43,64 +43,64 @@ note: required by a bound in `UnsafeOverwriteGuard::<T>::new`
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
8 - struct Struct<T: ?Sized> {
8 + struct Struct<T> {
9 - struct Struct<T: ?Sized> {
9 + struct Struct<T> {
|

error[E0277]: the size for values of type `T` cannot be known at compilation time
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:9:5
|
7 | #[pin_project(project_replace)] //~ ERROR E0277
| ------------------------------- required by a bound introduced by this call
8 | struct Struct<T: ?Sized> {
| - this type parameter needs to be `Sized`
9 | f: T,
| ^ doesn't have a size known at compile-time
|
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:10:5
|
8 | #[pin_project(project_replace)] //~ ERROR E0277
| ------------------------------- required by a bound introduced by this call
9 | struct Struct<T: ?Sized> {
| - this type parameter needs to be `Sized`
10 | f: T,
| ^ doesn't have a size known at compile-time
|
note: required by an implicit `Sized` bound in `std::ptr::read`
--> $RUST/core/src/ptr/mod.rs
|
| pub const unsafe fn read<T>(src: *const T) -> T {
| ^ required by the implicit `Sized` requirement on this type parameter in `read`
--> $RUST/core/src/ptr/mod.rs
|
| pub const unsafe fn read<T>(src: *const T) -> T {
| ^ required by the implicit `Sized` requirement on this type parameter in `read`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
8 - struct Struct<T: ?Sized> {
8 + struct Struct<T> {
|
9 - struct Struct<T: ?Sized> {
9 + struct Struct<T> {
|

error[E0277]: the size for values of type `T` cannot be known at compilation time
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:13:8
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:14:8
|
13 | struct TupleStruct<T: ?Sized>(T);
14 | struct TupleStruct<T: ?Sized>(T);
| ^^^^^^^^^^^^-^^^^^^^^^
| | |
| | this type parameter needs to be `Sized`
| doesn't have a size known at compile-time
|
note: required because it appears within the type `__TupleStructProjectionOwned<T>`
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:13:8
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:14:8
|
13 | struct TupleStruct<T: ?Sized>(T);
14 | struct TupleStruct<T: ?Sized>(T);
| ^^^^^^^^^^^
= note: the return type of a function must have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
13 - struct TupleStruct<T: ?Sized>(T);
13 + struct TupleStruct<T>(T);
14 - struct TupleStruct<T: ?Sized>(T);
14 + struct TupleStruct<T>(T);
|

error[E0277]: the size for values of type `T` cannot be known at compilation time
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:12:1
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:13:1
|
12 | #[pin_project(project_replace)] //~ ERROR E0277
13 | #[pin_project(project_replace)] //~ ERROR E0277
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
13 | struct TupleStruct<T: ?Sized>(T);
14 | struct TupleStruct<T: ?Sized>(T);
| - this type parameter needs to be `Sized`
|
note: required because it appears within the type `TupleStruct<T>`
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:13:8
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:14:8
|
13 | struct TupleStruct<T: ?Sized>(T);
14 | struct TupleStruct<T: ?Sized>(T);
| ^^^^^^^^^^^
note: required by a bound in `UnsafeOverwriteGuard::<T>::new`
--> src/lib.rs
Expand All @@ -113,6 +113,6 @@ note: required by a bound in `UnsafeOverwriteGuard::<T>::new`
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
13 - struct TupleStruct<T: ?Sized>(T);
13 + struct TupleStruct<T>(T);
14 - struct TupleStruct<T: ?Sized>(T);
14 + struct TupleStruct<T>(T);
|

0 comments on commit 72c21f1

Please sign in to comment.