-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5fc224
commit c3164f1
Showing
7 changed files
with
18 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
error: Ouroboros cannot automatically determine if this type is covariant. | ||
|
||
If it is covariant, it should be legal to convert any instance of that type to an instance of that type where all usages of 'this are replaced with a smaller lifetime. For example, Box<&'this i32> is covariant because it is legal to use it as a Box<&'a i32> where 'this: 'a. In contrast, Fn(&'this i32) cannot be used as Fn(&'a i32). | ||
If it is covariant, it should be legal to convert any instance of that type to an instance of that type where all usages of 'this are replaced with a smaller lifetime. For example, Box<&'this i32> is covariant because it is legal to use it as a Box<&'a i32> where 'this: 'a. In contrast, Fn(&'this i32) cannot be used as Fn(&'a i32). | ||
|
||
To resolve this error, add #[covariant] or #[not_covariant] to the field. | ||
|
||
To resolve this error, add #[covariant] or #[not_covariant] to the field. | ||
--> $DIR/auto_covariant.rs:11:12 | ||
| | ||
11 | field: NotGuaranteedCovariant<'this> | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0601]: `main` function not found in crate `$CRATE` | ||
--> $DIR/auto_covariant.rs:12:2 | ||
--> $DIR/auto_covariant.rs:1:1 | ||
| | ||
12 | } | ||
| ^ consider adding a `main` function to `$DIR/src/fail_tests/auto_covariant.rs` | ||
1 | / use ouroboros::self_referencing; | ||
2 | | | ||
3 | | struct NotGuaranteedCovariant<'a> { | ||
4 | | data: &'a (), | ||
... | | ||
11 | | field: NotGuaranteedCovariant<'this> | ||
12 | | } | ||
| |_^ consider adding a `main` function to `$DIR/src/fail_tests/auto_covariant.rs` |
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
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