Skip to content

Commit

Permalink
Update ui tests to nightly-2021-04-13
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Apr 13, 2021
1 parent 6b3aece commit ed562cc
Show file tree
Hide file tree
Showing 29 changed files with 236 additions and 111 deletions.
3 changes: 1 addition & 2 deletions tests/ui/cfg/packed_sneaky-span-issue-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ use auxiliary_macro::hidden_repr;
use pin_project::pin_project;

#[pin_project]
#[hidden_repr(packed)]
#[hidden_repr(packed)] //~ ERROR may not be used on #[repr(packed)] types
struct S {
//~^ ERROR may not be used on #[repr(packed)] types
#[cfg(not(any()))]
#[pin]
f: u32,
Expand Down
14 changes: 4 additions & 10 deletions tests/ui/cfg/packed_sneaky-span-issue-1.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
error: #[pin_project] attribute may not be used on #[repr(packed)] types
--> $DIR/packed_sneaky-span-issue-1.rs:6:1
|
6 | / struct S {
7 | | //~^ ERROR may not be used on #[repr(packed)] types
8 | | #[cfg(not(any()))]
9 | | #[pin]
... |
13 | | f: u8,
14 | | }
| |_^
--> $DIR/packed_sneaky-span-issue-1.rs:5:15
|
5 | #[hidden_repr(packed)] //~ ERROR may not be used on #[repr(packed)] types
| ^^^^^^
3 changes: 1 addition & 2 deletions tests/ui/cfg/packed_sneaky-span-issue-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ use auxiliary_macro::hidden_repr;
use pin_project::pin_project;

#[pin_project]
#[hidden_repr(packed)]
#[hidden_repr(packed)] //~ ERROR may not be used on #[repr(packed)] types
struct S {
//~^ ERROR may not be used on #[repr(packed)] types
#[cfg(any())]
#[pin]
f: u32,
Expand Down
14 changes: 4 additions & 10 deletions tests/ui/cfg/packed_sneaky-span-issue-2.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
error: #[pin_project] attribute may not be used on #[repr(packed)] types
--> $DIR/packed_sneaky-span-issue-2.rs:6:1
|
6 | / struct S {
7 | | //~^ ERROR may not be used on #[repr(packed)] types
8 | | #[cfg(any())]
9 | | #[pin]
... |
13 | | f: u8,
14 | | }
| |_^
--> $DIR/packed_sneaky-span-issue-2.rs:5:15
|
5 | #[hidden_repr(packed)] //~ ERROR may not be used on #[repr(packed)] types
| ^^^^^^
5 changes: 3 additions & 2 deletions tests/ui/cfg/unsupported.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
error: #[pin_project] attribute may not be used on structs with zero fields
--> $DIR/unsupported.rs:4:1
--> $DIR/unsupported.rs:4:10
|
4 | / struct S {
4 | struct S {
| __________^
5 | | //~^ ERROR may not be used on structs with zero fields
6 | | #[cfg(any())]
7 | | #[pin]
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/not_unpin/conflict-unpin.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`:
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`
--> $DIR/conflict-unpin.rs:3:15
|
3 | #[pin_project(!Unpin)] //~ ERROR E0119
Expand All @@ -7,7 +7,7 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
10 | impl<T, U> Unpin for Foo<T, U> where T: Unpin {}
| --------------------------------------------- first implementation here

error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`:
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`
--> $DIR/conflict-unpin.rs:12:15
|
12 | #[pin_project(!Unpin)] //~ ERROR E0119
Expand All @@ -16,7 +16,7 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
19 | impl<T, U> Unpin for Bar<T, U> {}
| ------------------------------ first implementation here

error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`:
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`
--> $DIR/conflict-unpin.rs:21:15
|
21 | #[pin_project(!Unpin)] //~ ERROR E0119
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/not_unpin/impl-unsafe-unpin.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>`:
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>`
--> $DIR/impl-unsafe-unpin.rs:3:1
|
3 | #[pin_project(!Unpin)] //~ ERROR E0119
Expand All @@ -9,7 +9,7 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>`:
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>`
--> $DIR/impl-unsafe-unpin.rs:12:1
|
12 | #[pin_project(!Unpin)] //~ ERROR E0119
Expand All @@ -20,7 +20,7 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>`:
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>`
--> $DIR/impl-unsafe-unpin.rs:21:1
|
21 | #[pin_project(!Unpin)] //~ ERROR E0119
Expand Down
14 changes: 12 additions & 2 deletions tests/ui/pin_project/add-pinned-field.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ error[E0277]: `PhantomPinned` cannot be unpinned
21 | is_unpin::<Foo>(); //~ ERROR E0277
| ^^^^^^^^^^^^^^^ within `__Foo<'_>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
= note: required because it appears within the type `__Foo<'_>`
= note: consider using `Box::pin`
note: required because it appears within the type `__Foo<'_>`
--> $DIR/add-pinned-field.rs:8:8
|
8 | struct Foo {
| ^^^
= note: required because of the requirements on the impl of `Unpin` for `Foo`

error[E0277]: `PhantomPinned` cannot be unpinned
Expand All @@ -19,5 +24,10 @@ error[E0277]: `PhantomPinned` cannot be unpinned
22 | is_unpin::<Bar>(); //~ ERROR E0277
| ^^^^^^^^^^^^^^^ within `__Bar<'_>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
= note: required because it appears within the type `__Bar<'_>`
= note: consider using `Box::pin`
note: required because it appears within the type `__Bar<'_>`
--> $DIR/add-pinned-field.rs:15:8
|
15 | struct Bar {
| ^^^
= note: required because of the requirements on the impl of `Unpin` for `Bar`
4 changes: 2 additions & 2 deletions tests/ui/pin_project/conflict-drop.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0119]: conflicting implementations of trait `_::FooMustNotImplDrop` for type `Foo<_, _>`:
error[E0119]: conflicting implementations of trait `_::FooMustNotImplDrop` for type `Foo<_, _>`
--> $DIR/conflict-drop.rs:5:1
|
5 | #[pin_project] //~ ERROR E0119
Expand All @@ -9,7 +9,7 @@ error[E0119]: conflicting implementations of trait `_::FooMustNotImplDrop` for t
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `Bar<_, _>`:
error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `Bar<_, _>`
--> $DIR/conflict-drop.rs:16:15
|
16 | #[pin_project(PinnedDrop)] //~ ERROR E0119
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/pin_project/conflict-unpin.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`:
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`
--> $DIR/conflict-unpin.rs:5:1
|
5 | #[pin_project] //~ ERROR E0119
Expand All @@ -9,7 +9,7 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`:
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`
--> $DIR/conflict-unpin.rs:17:1
|
17 | #[pin_project] //~ ERROR E0119
Expand All @@ -20,7 +20,7 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`:
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`
--> $DIR/conflict-unpin.rs:27:1
|
27 | #[pin_project] //~ ERROR E0119
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/pin_project/impl-unsafe-unpin.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>`:
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>`
--> $DIR/impl-unsafe-unpin.rs:3:1
|
3 | #[pin_project] //~ ERROR E0119
Expand All @@ -9,7 +9,7 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>`:
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>`
--> $DIR/impl-unsafe-unpin.rs:12:1
|
12 | #[pin_project] //~ ERROR E0119
Expand All @@ -20,7 +20,7 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>`:
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>`
--> $DIR/impl-unsafe-unpin.rs:21:1
|
21 | #[pin_project] //~ ERROR E0119
Expand Down
7 changes: 6 additions & 1 deletion tests/ui/pin_project/overlapping_unpin_struct.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@ error[E0277]: `PhantomPinned` cannot be unpinned
18 | is_unpin::<S<PhantomPinned>>(); //~ ERROR E0277
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `_::__S<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
= note: required because it appears within the type `_::__S<'_, PhantomPinned>`
= note: consider using `Box::pin`
note: required because it appears within the type `_::__S<'_, PhantomPinned>`
--> $DIR/overlapping_unpin_struct.rs:6:8
|
6 | struct S<T> {
| ^
= note: required because of the requirements on the impl of `Unpin` for `S<PhantomPinned>`
41 changes: 38 additions & 3 deletions tests/ui/pin_project/packed-name-value.stderr
Original file line number Diff line number Diff line change
@@ -1,17 +1,52 @@
error[E0552]: unrecognized representation hint
error: internal compiler error: unrecognized representation hint
--> $DIR/packed-name-value.rs:3:8
|
3 | #[repr(packed = "")] //~ ERROR E0552
| ^^^^^^^^^^^
|
= note: delayed at compiler/rustc_attr/src/builtin.rs:940:32

error[E0552]: unrecognized representation hint
error: internal compiler error: unrecognized representation hint
--> $DIR/packed-name-value.rs:9:8
|
9 | #[repr(packed = "")] //~ ERROR E0552
| ^^^^^^^^^^^
|
= note: delayed at compiler/rustc_attr/src/builtin.rs:940:32

error[E0552]: unrecognized representation hint
error: internal compiler error: unrecognized representation hint
--> $DIR/packed-name-value.rs:14:8
|
14 | #[repr(packed = "")] //~ ERROR E0552
| ^^^^^^^^^^^
|
= note: delayed at compiler/rustc_attr/src/builtin.rs:940:32

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1018:13
stack backtrace:
0: _rust_begin_unwind
1: std::panicking::begin_panic_fmt
2: rustc_errors::HandlerInner::flush_delayed
3: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
4: core::ptr::drop_in_place<rustc_session::parse::ParseSess>
5: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
6: core::ptr::drop_in_place<rustc_interface::interface::Compiler>
7: rustc_span::with_source_map
8: rustc_interface::interface::create_compiler_and_run
9: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.53.0-nightly (d0695c908 2021-04-12) running on x86_64-apple-darwin

note: compiler flags: -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
36 changes: 26 additions & 10 deletions tests/ui/pin_project/project_replace_unsized.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
3 | #[pin_project(project_replace)] //~ ERROR E0277
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
4 | struct Struct<T: ?Sized> {
| - this type parameter needs to be `Sized`
| - this type parameter needs to be `std::marker::Sized`
|
= note: required because it appears within the type `Struct<T>`
note: required because it appears within the type `Struct<T>`
--> $DIR/project_replace_unsized.rs:4:8
|
4 | struct Struct<T: ?Sized> {
| ^^^^^^
= help: unsized fn params are gated as an unstable feature
help: function arguments must have a statically known size, borrowed types always have a known size
|
Expand All @@ -19,17 +23,21 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
3 | #[pin_project(project_replace)] //~ ERROR E0277
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
4 | struct Struct<T: ?Sized> {
| - this type parameter needs to be `Sized`
| - this type parameter needs to be `std::marker::Sized`
|
note: required because it appears within the type `Struct<T>`
--> $DIR/project_replace_unsized.rs:4:8
|
= note: required because it appears within the type `Struct<T>`
4 | struct Struct<T: ?Sized> {
| ^^^^^^
= note: required by `UnsafeOverwriteGuard`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/project_replace_unsized.rs:5:5
|
4 | struct Struct<T: ?Sized> {
| - this type parameter needs to be `Sized`
| - this type parameter needs to be `std::marker::Sized`
5 | f: T,
| ^ doesn't have a size known at compile-time

Expand All @@ -39,9 +47,13 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
8 | #[pin_project(project_replace)] //~ ERROR E0277
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
9 | struct TupleStruct<T: ?Sized>(T);
| - this type parameter needs to be `Sized`
| - this type parameter needs to be `std::marker::Sized`
|
note: required because it appears within the type `TupleStruct<T>`
--> $DIR/project_replace_unsized.rs:9:8
|
= note: required because it appears within the type `TupleStruct<T>`
9 | struct TupleStruct<T: ?Sized>(T);
| ^^^^^^^^^^^
= help: unsized fn params are gated as an unstable feature
help: function arguments must have a statically known size, borrowed types always have a known size
|
Expand All @@ -54,17 +66,21 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
8 | #[pin_project(project_replace)] //~ ERROR E0277
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
9 | struct TupleStruct<T: ?Sized>(T);
| - this type parameter needs to be `Sized`
| - this type parameter needs to be `std::marker::Sized`
|
= note: required because it appears within the type `TupleStruct<T>`
note: required because it appears within the type `TupleStruct<T>`
--> $DIR/project_replace_unsized.rs:9:8
|
9 | struct TupleStruct<T: ?Sized>(T);
| ^^^^^^^^^^^
= note: required by `UnsafeOverwriteGuard`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/project_replace_unsized.rs:9:8
|
9 | struct TupleStruct<T: ?Sized>(T);
| ^^^^^^^^^^^ - this type parameter needs to be `Sized`
| ^^^^^^^^^^^ - this type parameter needs to be `std::marker::Sized`
| |
| doesn't have a size known at compile-time
|
Expand Down
Loading

0 comments on commit ed562cc

Please sign in to comment.