-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
119: Add more tests for trivial_bounds r=taiki-e a=taiki-e Add more tests about the current behavior of `trivial_bounds`. Co-authored-by: Taiki Endo <[email protected]>
- Loading branch information
Showing
76 changed files
with
409 additions
and
324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-fail | ||
|
||
#![feature(optin_builtin_traits)] | ||
#![feature(trivial_bounds)] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error[E0027]: pattern does not mention field `__field` | ||
--> $DIR/field_sneaky.rs:11:14 | ||
| | ||
11 | #[pin_project] //~ ERROR pattern does not mention field `__field` | ||
| ^ missing field `__field` | ||
--> $DIR/field_sneaky.rs:9:14 | ||
| | ||
9 | #[pin_project] //~ ERROR pattern does not mention field `__field` | ||
| ^ missing field `__field` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-fail | ||
|
||
#[macro_use] | ||
extern crate auxiliary_macros; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-fail | ||
|
||
#[macro_use] | ||
extern crate auxiliary_macros; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-fail | ||
|
||
use pin_project::pin_project; | ||
use std::marker::PhantomPinned; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// run-pass | ||
|
||
#[macro_use] | ||
extern crate auxiliary_macros; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-fail | ||
|
||
use pin_project::pin_project; | ||
|
||
#[cfg(not(any()))] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: `cfg` attributes on the field of tuple structs are not supported | ||
--> $DIR/tuple-struct.rs:12:5 | ||
--> $DIR/tuple-struct.rs:10:5 | ||
| | ||
12 | #[cfg(not(any()))] //~ ERROR `cfg` attributes on the field of tuple structs are not supported | ||
10 | #[cfg(not(any()))] //~ ERROR `cfg` attributes on the field of tuple structs are not supported | ||
| ^^^^^^^^^^^^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-fail | ||
|
||
use pin_project::pin_project; | ||
|
||
#[cfg(not(any()))] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: `cfg` attributes on the field of tuple variants are not supported | ||
--> $DIR/tuple-variant.rs:13:9 | ||
--> $DIR/tuple-variant.rs:11:9 | ||
| | ||
13 | #[cfg(not(any()))] //~ ERROR `cfg` attributes on the field of tuple variants are not supported | ||
11 | #[cfg(not(any()))] //~ ERROR `cfg` attributes on the field of tuple variants are not supported | ||
| ^^^^^^^^^^^^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-fail | ||
|
||
use pin_project::pin_project; | ||
|
||
#[pin_project] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
error: #[pin_project] attribute may not be used on structs with zero fields | ||
|
||
error[E0392]: parameter `'_pin` is never used | ||
--> $DIR/unsupported.rs:5:1 | ||
--> $DIR/unsupported.rs:3:1 | ||
| | ||
5 | #[pin_project] | ||
3 | #[pin_project] | ||
| ^^^^^^^^^^^^^^ unused parameter | ||
| | ||
= help: consider removing `'_pin`, referring to it in a field, or using a marker such as `std::marker::PhantomData` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-fail | ||
|
||
use pin_project::{pin_project, pinned_drop}; | ||
use std::pin::Pin; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
error[E0119]: conflicting implementations of trait `FooMustNotImplDrop` for type `Foo<_, _>`: | ||
--> $DIR/conflict-drop.rs:6:1 | ||
--> $DIR/conflict-drop.rs:4:1 | ||
| | ||
6 | #[pin_project] //~ ERROR E0119 | ||
4 | #[pin_project] //~ ERROR E0119 | ||
| ^^^^^^^^^^^^^^ | ||
| | | ||
| first implementation here | ||
| conflicting implementation for `Foo<_, _>` | ||
|
||
error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `Bar<_, _>`: | ||
--> $DIR/conflict-drop.rs:17:1 | ||
--> $DIR/conflict-drop.rs:15:1 | ||
| | ||
17 | #[pin_project(PinnedDrop)] //~ ERROR E0119 | ||
15 | #[pin_project(PinnedDrop)] //~ ERROR E0119 | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Bar<_, _>` | ||
... | ||
29 | impl<T, U> Drop for Bar<T, U> { | ||
27 | impl<T, U> Drop for Bar<T, U> { | ||
| ----------------------------- first implementation here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-fail | ||
|
||
use pin_project::pin_project; | ||
|
||
// The same implementation. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`: | ||
--> $DIR/conflict-unpin.rs:7:1 | ||
--> $DIR/conflict-unpin.rs:5:1 | ||
| | ||
7 | #[pin_project] //~ ERROR E0119 | ||
5 | #[pin_project] //~ ERROR E0119 | ||
| ^^^^^^^^^^^^^^ conflicting implementation for `Foo<_, _>` | ||
... | ||
15 | impl<T, U> Unpin for Foo<T, U> where T: Unpin {} // Conditional Unpin impl | ||
13 | impl<T, U> Unpin for Foo<T, U> where T: Unpin {} // Conditional Unpin impl | ||
| --------------------------------------------- first implementation here | ||
|
||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`: | ||
--> $DIR/conflict-unpin.rs:19:1 | ||
--> $DIR/conflict-unpin.rs:17:1 | ||
| | ||
19 | #[pin_project] //~ ERROR E0119 | ||
17 | #[pin_project] //~ ERROR E0119 | ||
| ^^^^^^^^^^^^^^ conflicting implementation for `Bar<_, _>` | ||
... | ||
27 | impl<T, U> Unpin for Bar<T, U> {} // Non-conditional Unpin impl | ||
25 | impl<T, U> Unpin for Bar<T, U> {} // Non-conditional Unpin impl | ||
| ------------------------------ first implementation here | ||
|
||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`: | ||
--> $DIR/conflict-unpin.rs:29:1 | ||
--> $DIR/conflict-unpin.rs:27:1 | ||
| | ||
29 | #[pin_project] //~ ERROR E0119 | ||
27 | #[pin_project] //~ ERROR E0119 | ||
| ^^^^^^^^^^^^^^ conflicting implementation for `Baz<_, _>` | ||
... | ||
37 | impl<T: Unpin, U: Unpin> Unpin for Baz<T, U> {} // Conditional Unpin impl | ||
35 | impl<T: Unpin, U: Unpin> Unpin for Baz<T, U> {} // Conditional Unpin impl | ||
| -------------------------------------------- first implementation here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-fail | ||
|
||
use pin_project::pin_project; | ||
|
||
#[pin_project] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,53 @@ | ||
error: unexpected token | ||
--> $DIR/invalid.rs:7:10 | ||
--> $DIR/invalid.rs:5:10 | ||
| | ||
7 | #[pin()] //~ ERROR unexpected token | ||
5 | #[pin()] //~ ERROR unexpected token | ||
| ^ | ||
|
||
error: unexpected token | ||
--> $DIR/invalid.rs:12:18 | ||
--> $DIR/invalid.rs:10:18 | ||
| | ||
12 | struct B<T>(#[pin(foo)] T); //~ ERROR unexpected token | ||
10 | struct B<T>(#[pin(foo)] T); //~ ERROR unexpected token | ||
| ^ | ||
|
||
error: unexpected token | ||
--> $DIR/invalid.rs:16:12 | ||
--> $DIR/invalid.rs:14:12 | ||
| | ||
16 | A(#[pin(foo)] T), //~ ERROR unexpected token | ||
14 | A(#[pin(foo)] T), //~ ERROR unexpected token | ||
| ^ | ||
|
||
error: unexpected token | ||
--> $DIR/invalid.rs:22:14 | ||
--> $DIR/invalid.rs:20:14 | ||
| | ||
22 | #[pin(foo)] //~ ERROR unexpected token | ||
20 | #[pin(foo)] //~ ERROR unexpected token | ||
| ^ | ||
|
||
error: expected identifier | ||
--> $DIR/invalid.rs:27:27 | ||
--> $DIR/invalid.rs:25:27 | ||
| | ||
27 | #[pin_project(UnsafeUnpin,,)] //~ ERROR expected identifier | ||
25 | #[pin_project(UnsafeUnpin,,)] //~ ERROR expected identifier | ||
| ^ | ||
|
||
error: duplicate `UnsafeUnpin` argument | ||
--> $DIR/invalid.rs:33:28 | ||
--> $DIR/invalid.rs:31:28 | ||
| | ||
33 | #[pin_project(UnsafeUnpin, UnsafeUnpin)] //~ ERROR duplicate `UnsafeUnpin` argument | ||
31 | #[pin_project(UnsafeUnpin, UnsafeUnpin)] //~ ERROR duplicate `UnsafeUnpin` argument | ||
| ^^^^^^^^^^^ | ||
|
||
error: duplicate `PinnedDrop` argument | ||
--> $DIR/invalid.rs:39:27 | ||
--> $DIR/invalid.rs:37:27 | ||
| | ||
39 | #[pin_project(PinnedDrop, PinnedDrop)] //~ ERROR duplicate `PinnedDrop` argument | ||
37 | #[pin_project(PinnedDrop, PinnedDrop)] //~ ERROR duplicate `PinnedDrop` argument | ||
| ^^^^^^^^^^ | ||
|
||
error: duplicate `UnsafeUnpin` argument | ||
--> $DIR/invalid.rs:45:40 | ||
--> $DIR/invalid.rs:43:40 | ||
| | ||
45 | #[pin_project(PinnedDrop, UnsafeUnpin, UnsafeUnpin)] //~ ERROR duplicate `UnsafeUnpin` argument | ||
43 | #[pin_project(PinnedDrop, UnsafeUnpin, UnsafeUnpin)] //~ ERROR duplicate `UnsafeUnpin` argument | ||
| ^^^^^^^^^^^ | ||
|
||
error: duplicate `PinnedDrop` argument | ||
--> $DIR/invalid.rs:51:40 | ||
--> $DIR/invalid.rs:49:40 | ||
| | ||
51 | #[pin_project(PinnedDrop, UnsafeUnpin, PinnedDrop, PinnedDrop)] //~ ERROR duplicate `PinnedDrop` argument | ||
49 | #[pin_project(PinnedDrop, UnsafeUnpin, PinnedDrop, PinnedDrop)] //~ ERROR duplicate `PinnedDrop` argument | ||
| ^^^^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-fail | ||
|
||
use pin_project::pin_project; | ||
|
||
#[pin_project] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
error: #[pin_project] attribute may not be used on #[repr(packed)] types | ||
--> $DIR/packed.rs:6:8 | ||
--> $DIR/packed.rs:4:8 | ||
| | ||
6 | #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types | ||
4 | #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types | ||
| ^^^^^^ | ||
|
||
error: #[pin_project] attribute may not be used on #[repr(packed)] types | ||
--> $DIR/packed.rs:13:8 | ||
--> $DIR/packed.rs:11:8 | ||
| | ||
13 | #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types | ||
11 | #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types | ||
| ^^^^^^ | ||
|
||
error: #[pin_project] attribute may not be used on #[repr(packed)] types | ||
--> $DIR/packed.rs:21:8 | ||
--> $DIR/packed.rs:19:8 | ||
| | ||
21 | #[repr(packed(2))] //~ ERROR may not be used on #[repr(packed)] types | ||
19 | #[repr(packed(2))] //~ ERROR may not be used on #[repr(packed)] types | ||
| ^^^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// compile-fail | ||
|
||
#[macro_use] | ||
extern crate auxiliary_macros; | ||
|
||
|
Oops, something went wrong.