-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flip the order of binder instantiation for better diagnostics
- Loading branch information
1 parent
d567e4f
commit 473c88d
Showing
4 changed files
with
14 additions
and
23 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
7 changes: 2 additions & 5 deletions
7
tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr
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,18 +1,15 @@ | ||
error: return type captures more lifetimes than trait definition | ||
--> $DIR/signature-mismatch.rs:17:47 | ||
| | ||
LL | fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>; | ||
| - this lifetime was captured | ||
... | ||
LL | fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| -- this lifetime was captured ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: hidden type must only reference lifetimes captured by this impl trait | ||
--> $DIR/signature-mismatch.rs:11:40 | ||
| | ||
LL | fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= note: hidden type inferred to be `impl Future<Output = Vec<u8>> + '_` | ||
= note: hidden type inferred to be `impl Future<Output = Vec<u8>> + 'a` | ||
|
||
error: aborting due to previous error | ||
|
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,18 +1,15 @@ | ||
error: return type captures more lifetimes than trait definition | ||
--> $DIR/signature-mismatch.rs:17:47 | ||
| | ||
LL | fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>; | ||
| - this lifetime was captured | ||
... | ||
LL | fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| -- this lifetime was captured ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: hidden type must only reference lifetimes captured by this impl trait | ||
--> $DIR/signature-mismatch.rs:11:40 | ||
| | ||
LL | fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= note: hidden type inferred to be `impl Future<Output = Vec<u8>> + '_` | ||
= note: hidden type inferred to be `impl Future<Output = Vec<u8>> + 'a` | ||
|
||
error: aborting due to previous error | ||
|