aboutsummaryrefslogtreecommitdiff
path: root/tests/ui/pinned_drop
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/pinned_drop')
-rw-r--r--tests/ui/pinned_drop/call-drop-inner.stderr4
-rw-r--r--tests/ui/pinned_drop/conditional-drop-impl.stderr35
-rw-r--r--tests/ui/pinned_drop/forget-pinned-drop-impl.stderr14
-rw-r--r--tests/ui/pinned_drop/invalid-self.stderr8
-rw-r--r--tests/ui/pinned_drop/invalid.stderr50
-rw-r--r--tests/ui/pinned_drop/pinned-drop-no-attr-arg.stderr4
-rw-r--r--tests/ui/pinned_drop/self.stderr16
-rw-r--r--tests/ui/pinned_drop/unsafe-call.stderr2
8 files changed, 61 insertions, 72 deletions
diff --git a/tests/ui/pinned_drop/call-drop-inner.stderr b/tests/ui/pinned_drop/call-drop-inner.stderr
index 8fbe2dc..b11bee5 100644
--- a/tests/ui/pinned_drop/call-drop-inner.stderr
+++ b/tests/ui/pinned_drop/call-drop-inner.stderr
@@ -1,5 +1,5 @@
error[E0061]: this function takes 0 arguments but 1 argument was supplied
- --> $DIR/call-drop-inner.rs:13:9
+ --> tests/ui/pinned_drop/call-drop-inner.rs:13:9
|
13 | __drop_inner(__self);
| ^^^^^^^^^^^^ ------ supplied 1 argument
@@ -7,7 +7,7 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
| expected 0 arguments
|
note: function defined here
- --> $DIR/call-drop-inner.rs:10:1
+ --> tests/ui/pinned_drop/call-drop-inner.rs:10:1
|
10 | #[pinned_drop]
| ^^^^^^^^^^^^^^
diff --git a/tests/ui/pinned_drop/conditional-drop-impl.stderr b/tests/ui/pinned_drop/conditional-drop-impl.stderr
index a512578..0c55bc2 100644
--- a/tests/ui/pinned_drop/conditional-drop-impl.stderr
+++ b/tests/ui/pinned_drop/conditional-drop-impl.stderr
@@ -1,11 +1,11 @@
error[E0367]: `Drop` impl requires `T: Unpin` but the struct it is implemented for does not
- --> $DIR/conditional-drop-impl.rs:11:9
+ --> tests/ui/pinned_drop/conditional-drop-impl.rs:11:9
|
11 | impl<T: Unpin> Drop for DropImpl<T> {
| ^^^^^
|
note: the implementor must specify the same requirement
- --> $DIR/conditional-drop-impl.rs:7:1
+ --> tests/ui/pinned_drop/conditional-drop-impl.rs:7:1
|
7 | / struct DropImpl<T> {
8 | | f: T,
@@ -13,23 +13,18 @@ note: the implementor must specify the same requirement
| |_^
error[E0277]: `T` cannot be unpinned
- --> $DIR/conditional-drop-impl.rs:16:15
- |
-16 | #[pin_project(PinnedDrop)] //~ ERROR E0277
- | ^^^^^^^^^^ the trait `Unpin` is not implemented for `T`
- |
- = note: consider using `Box::pin`
+ --> tests/ui/pinned_drop/conditional-drop-impl.rs:16:15
+ |
+16 | #[pin_project(PinnedDrop)] //~ ERROR E0277
+ | ^^^^^^^^^^ the trait `Unpin` is not implemented for `T`
+ |
+ = note: consider using `Box::pin`
note: required because of the requirements on the impl of `PinnedDrop` for `PinnedDropImpl<T>`
- --> $DIR/conditional-drop-impl.rs:23:16
- |
-23 | impl<T: Unpin> PinnedDrop for PinnedDropImpl<T> {
- | ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
-note: required by `pin_project::__private::PinnedDrop::drop`
- --> $DIR/lib.rs:186:9
- |
-186 | unsafe fn drop(self: Pin<&mut Self>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ --> tests/ui/pinned_drop/conditional-drop-impl.rs:23:16
+ |
+23 | impl<T: Unpin> PinnedDrop for PinnedDropImpl<T> {
+ | ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
help: consider restricting type parameter `T`
- |
-17 | struct PinnedDropImpl<T: std::marker::Unpin> {
- | ^^^^^^^^^^^^^^^^^^^^
+ |
+17 | struct PinnedDropImpl<T: std::marker::Unpin> {
+ | ++++++++++++++++++++
diff --git a/tests/ui/pinned_drop/forget-pinned-drop-impl.stderr b/tests/ui/pinned_drop/forget-pinned-drop-impl.stderr
index d218545..ef8a7bf 100644
--- a/tests/ui/pinned_drop/forget-pinned-drop-impl.stderr
+++ b/tests/ui/pinned_drop/forget-pinned-drop-impl.stderr
@@ -1,11 +1,5 @@
error[E0277]: the trait bound `Struct: PinnedDrop` is not satisfied
- --> $DIR/forget-pinned-drop-impl.rs:3:15
- |
-3 | #[pin_project(PinnedDrop)] //~ ERROR E0277
- | ^^^^^^^^^^ the trait `PinnedDrop` is not implemented for `Struct`
- |
-note: required by `pin_project::__private::PinnedDrop::drop`
- --> $DIR/lib.rs:186:9
- |
-186 | unsafe fn drop(self: Pin<&mut Self>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ --> tests/ui/pinned_drop/forget-pinned-drop-impl.rs:3:15
+ |
+3 | #[pin_project(PinnedDrop)] //~ ERROR E0277
+ | ^^^^^^^^^^ the trait `PinnedDrop` is not implemented for `Struct`
diff --git a/tests/ui/pinned_drop/invalid-self.stderr b/tests/ui/pinned_drop/invalid-self.stderr
index 3248704..464be5e 100644
--- a/tests/ui/pinned_drop/invalid-self.stderr
+++ b/tests/ui/pinned_drop/invalid-self.stderr
@@ -1,23 +1,23 @@
error: expected identifier, found keyword `self`
- --> $DIR/invalid-self.rs:8:26
+ --> tests/ui/pinned_drop/invalid-self.rs:8:26
|
8 | fn take_ref_self(ref self: Pin<&mut Self>) {} //~ ERROR expected identifier, found keyword `self`
| ^^^^ expected identifier, found keyword
error: expected identifier, found keyword `self`
- --> $DIR/invalid-self.rs:9:34
+ --> tests/ui/pinned_drop/invalid-self.rs:9:34
|
9 | fn take_ref_mut_self(ref mut self: Pin<&mut Self>) {} //~ ERROR expected identifier, found keyword `self`
| ^^^^ expected identifier, found keyword
error: expected parameter name, found `@`
- --> $DIR/invalid-self.rs:11:25
+ --> tests/ui/pinned_drop/invalid-self.rs:11:25
|
11 | fn self_subpat(self @ S {}: Self) {} //~ ERROR expected one of `)`, `,`, or `:`, found `@`
| ^ expected parameter name
error: expected one of `)`, `,`, or `:`, found `@`
- --> $DIR/invalid-self.rs:11:25
+ --> tests/ui/pinned_drop/invalid-self.rs:11:25
|
11 | fn self_subpat(self @ S {}: Self) {} //~ ERROR expected one of `)`, `,`, or `:`, found `@`
| -^ expected one of `)`, `,`, or `:`
diff --git a/tests/ui/pinned_drop/invalid.stderr b/tests/ui/pinned_drop/invalid.stderr
index 499b0d9..d509964 100644
--- a/tests/ui/pinned_drop/invalid.stderr
+++ b/tests/ui/pinned_drop/invalid.stderr
@@ -1,143 +1,143 @@
-error: unexpected token: foo
- --> $DIR/invalid.rs:9:19
+error: unexpected token: `foo`
+ --> tests/ui/pinned_drop/invalid.rs:9:19
|
9 | #[pinned_drop(foo)] //~ ERROR unexpected token
| ^^^
error: duplicate #[pinned_drop] attribute
- --> $DIR/invalid.rs:30:5
+ --> tests/ui/pinned_drop/invalid.rs:30:5
|
30 | #[pinned_drop] //~ ERROR duplicate #[pinned_drop] attribute
| ^^^^^^^^^^^^^^
error: #[pinned_drop] may only be used on implementation for the `PinnedDrop` trait
- --> $DIR/invalid.rs:43:10
+ --> tests/ui/pinned_drop/invalid.rs:43:10
|
43 | impl Drop for TraitImpl {} //~ ERROR may only be used on implementation for the `PinnedDrop` trait
| ^^^^
error: #[pinned_drop] may only be used on implementation for the `PinnedDrop` trait
- --> $DIR/invalid.rs:49:10
+ --> tests/ui/pinned_drop/invalid.rs:49:10
|
49 | impl InherentImpl {} //~ ERROR may only be used on implementation for the `PinnedDrop` trait
| ^^^^^^^^^^^^
error: expected `impl`
- --> $DIR/invalid.rs:52:5
+ --> tests/ui/pinned_drop/invalid.rs:52:5
|
52 | fn func(_: Pin<&mut ()>) {} //~ ERROR expected `impl`
| ^^
error: implementing the trait `PinnedDrop` is not unsafe
- --> $DIR/invalid.rs:62:5
+ --> tests/ui/pinned_drop/invalid.rs:62:5
|
62 | unsafe impl PinnedDrop for Impl {
| ^^^^^^
error: implementing the method `drop` is not unsafe
- --> $DIR/invalid.rs:72:9
+ --> tests/ui/pinned_drop/invalid.rs:72:9
|
72 | unsafe fn drop(self: Pin<&mut Self>) {} //~ ERROR implementing the method `drop` is not unsafe
| ^^^^^^
error: not all trait items implemented, missing: `drop`
- --> $DIR/invalid.rs:83:5
+ --> tests/ui/pinned_drop/invalid.rs:83:5
|
83 | impl PinnedDrop for Empty {} //~ ERROR not all trait items implemented, missing: `drop`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: const `A` is not a member of trait `PinnedDrop`
- --> $DIR/invalid.rs:90:9
+ --> tests/ui/pinned_drop/invalid.rs:90:9
|
90 | const A: u8 = 0; //~ ERROR const `A` is not a member of trait `PinnedDrop`
| ^^^^^^^^^^^^^^^^
error: const `A` is not a member of trait `PinnedDrop`
- --> $DIR/invalid.rs:100:9
+ --> tests/ui/pinned_drop/invalid.rs:100:9
|
100 | const A: u8 = 0; //~ ERROR const `A` is not a member of trait `PinnedDrop`
| ^^^^^^^^^^^^^^^^
error: type `A` is not a member of trait `PinnedDrop`
- --> $DIR/invalid.rs:108:9
+ --> tests/ui/pinned_drop/invalid.rs:108:9
|
108 | type A = u8; //~ ERROR type `A` is not a member of trait `PinnedDrop`
| ^^^^^^^^^^^^
error: type `A` is not a member of trait `PinnedDrop`
- --> $DIR/invalid.rs:118:9
+ --> tests/ui/pinned_drop/invalid.rs:118:9
|
118 | type A = u8; //~ ERROR type `A` is not a member of trait `PinnedDrop`
| ^^^^^^^^^^^^
error: duplicate definitions with name `drop`
- --> $DIR/invalid.rs:127:9
+ --> tests/ui/pinned_drop/invalid.rs:127:9
|
127 | fn drop(self: Pin<&mut Self>) {} //~ ERROR duplicate definitions with name `drop`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: method `drop` must return the unit type
- --> $DIR/invalid.rs:149:42
+ --> tests/ui/pinned_drop/invalid.rs:149:42
|
149 | fn drop(self: Pin<&mut Self>) -> Self {} //~ ERROR method `drop` must return the unit type
| ^^^^
error: method `drop` must take an argument `self: Pin<&mut Self>`
- --> $DIR/invalid.rs:157:16
+ --> tests/ui/pinned_drop/invalid.rs:157:16
|
157 | fn drop() {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>`
| ^^
error: method `drop` must take an argument `self: Pin<&mut Self>`
- --> $DIR/invalid.rs:165:17
+ --> tests/ui/pinned_drop/invalid.rs:165:17
|
165 | fn drop(self: Pin<&mut Self>, _: ()) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: method `drop` must take an argument `self: Pin<&mut Self>`
- --> $DIR/invalid.rs:173:17
+ --> tests/ui/pinned_drop/invalid.rs:173:17
|
173 | fn drop(&mut self) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>`
| ^^^^^^^^^
error: method `drop` must take an argument `self: Pin<&mut Self>`
- --> $DIR/invalid.rs:181:17
+ --> tests/ui/pinned_drop/invalid.rs:181:17
|
181 | fn drop(_: Pin<&mut Self>) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>`
| ^^^^^^^^^^^^^^^^^
error: method `drop` must take an argument `self: Pin<&mut Self>`
- --> $DIR/invalid.rs:189:17
+ --> tests/ui/pinned_drop/invalid.rs:189:17
|
189 | fn drop(self: Pin<&Self>) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>`
| ^^^^^^^^^^^^^^^^
error: method `drop` must take an argument `self: Pin<&mut Self>`
- --> $DIR/invalid.rs:197:17
+ --> tests/ui/pinned_drop/invalid.rs:197:17
|
197 | fn drop(self: Pin<&mut ()>) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>`
| ^^^^^^^^^^^^^^^^^^
error: method `pinned_drop` is not a member of trait `PinnedDrop
- --> $DIR/invalid.rs:205:12
+ --> tests/ui/pinned_drop/invalid.rs:205:12
|
205 | fn pinned_drop(self: Pin<&mut Self>) {} //~ ERROR method `pinned_drop` is not a member of trait `PinnedDrop
| ^^^^^^^^^^^
error: implementing the trait `PinnedDrop` on this type is unsupported
- --> $DIR/invalid.rs:213:25
+ --> tests/ui/pinned_drop/invalid.rs:213:25
|
213 | impl PinnedDrop for () {
| ^^
error: implementing the trait `PinnedDrop` on this type is unsupported
- --> $DIR/invalid.rs:219:25
+ --> tests/ui/pinned_drop/invalid.rs:219:25
|
219 | impl PinnedDrop for &mut A {
| ^^^^^^
error: implementing the trait `PinnedDrop` on this type is unsupported
- --> $DIR/invalid.rs:225:25
+ --> tests/ui/pinned_drop/invalid.rs:225:25
|
225 | impl PinnedDrop for [A] {
| ^^^
diff --git a/tests/ui/pinned_drop/pinned-drop-no-attr-arg.stderr b/tests/ui/pinned_drop/pinned-drop-no-attr-arg.stderr
index 9f32149..2542254 100644
--- a/tests/ui/pinned_drop/pinned-drop-no-attr-arg.stderr
+++ b/tests/ui/pinned_drop/pinned-drop-no-attr-arg.stderr
@@ -1,5 +1,5 @@
-error[E0119]: conflicting implementations of trait `pin_project::__private::PinnedDrop` for type `S`
- --> $DIR/pinned-drop-no-attr-arg.rs:12:1
+error[E0119]: conflicting implementations of trait `_::_pin_project::__private::PinnedDrop` for type `S`
+ --> tests/ui/pinned_drop/pinned-drop-no-attr-arg.rs:12:1
|
5 | #[pin_project]
| -------------- first implementation here
diff --git a/tests/ui/pinned_drop/self.stderr b/tests/ui/pinned_drop/self.stderr
index 7de286f..0f96dc9 100644
--- a/tests/ui/pinned_drop/self.stderr
+++ b/tests/ui/pinned_drop/self.stderr
@@ -1,29 +1,29 @@
error: `self` parameter is only allowed in associated functions
- --> $DIR/self.rs:18:26
+ --> tests/ui/pinned_drop/self.rs:18:26
|
18 | fn f(self: ()) {} //~ ERROR `self` parameter is only allowed in associated functions
| ^^^^ not semantically valid as function parameter
...
21 | t!();
- | ----- in this macro invocation
+ | ---- in this macro invocation
|
= note: associated functions are those in `impl` or `trait` definitions
= note: this error originates in the macro `t` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0434]: can't capture dynamic environment in a fn item
- --> $DIR/self.rs:16:29
+ --> tests/ui/pinned_drop/self.rs:16:29
|
16 | let _ = self; //~ ERROR E0434
| ^^^^
...
21 | t!();
- | ----- in this macro invocation
+ | ---- in this macro invocation
|
= help: use the `|| { ... }` closure form instead
= note: this error originates in the macro `t` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0423]: expected value, found struct `S`
- --> $DIR/self.rs:40:27
+ --> tests/ui/pinned_drop/self.rs:40:27
|
32 | / pub struct S {
33 | | f: (),
@@ -34,7 +34,7 @@ error[E0423]: expected value, found struct `S`
| ^^^^ help: use struct literal syntax instead: `S { f: val }`
error[E0308]: mismatched types
- --> $DIR/self.rs:39:25
+ --> tests/ui/pinned_drop/self.rs:39:25
|
39 | let _: () = self; //~ ERROR E0308
| -- ^^^^ expected `()`, found struct `Pin`
@@ -45,7 +45,7 @@ error[E0308]: mismatched types
found struct `Pin<&mut self_span::S>`
error[E0308]: mismatched types
- --> $DIR/self.rs:52:25
+ --> tests/ui/pinned_drop/self.rs:52:25
|
52 | let _: () = self; //~ ERROR E0308
| -- ^^^^ expected `()`, found struct `Pin`
@@ -56,7 +56,7 @@ error[E0308]: mismatched types
found struct `Pin<&mut E>`
error[E0533]: expected unit struct, unit variant or constant, found struct variant `Self::V`
- --> $DIR/self.rs:53:27
+ --> tests/ui/pinned_drop/self.rs:53:27
|
53 | let _: Self = Self::V; //~ ERROR E0533
| ^^^^^^^
diff --git a/tests/ui/pinned_drop/unsafe-call.stderr b/tests/ui/pinned_drop/unsafe-call.stderr
index 6216200..9f7dd44 100644
--- a/tests/ui/pinned_drop/unsafe-call.stderr
+++ b/tests/ui/pinned_drop/unsafe-call.stderr
@@ -1,5 +1,5 @@
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/unsafe-call.rs:14:9
+ --> tests/ui/pinned_drop/unsafe-call.rs:14:9
|
14 | self.project().f.get_unchecked_mut(); //~ ERROR call to unsafe function is unsafe and requires unsafe function or block [E0133]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function