-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Add information to higher-ranked lifetimes conflicts error messages #57901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c1437c9
Make NiceRegionError use the `InferCtxt` instead of its `TyCtxt`
lqd a602826
Handle higher-ranked lifetime conflict errors where the subtype is th…
lqd 823c888
Try to resolve type vars in the placeholder errors trait refs
lqd 55389f9
Try to reword placeholder error messages to make them clearer
lqd ce61b1b
Update two E308 tests to the new placeholder error
lqd a79f135
Update test expectations for new placeholder error messages
lqd f5a74d4
Test new placeholder error messages in previously untested combinations
lqd c5dea57
break apart tests
nikomatsakis ab80162
add a lot more `debug!` to `try_report_placeholders_trait`
nikomatsakis ec6405b
identify when implemented for "some specific lifetime"
nikomatsakis 790ed91
comment the pattern
nikomatsakis 1730ad4
Fix issue-57362-1.rs attributes
lqd 489bc4a
When mentioning lifetimes, put either the trait ref or the self type …
lqd 43c0518
Extract the notes explaining the placeholder region errors to a helpe…
lqd e077501
Fix stray typo
lqd c97d135
Refer to synthetically named lifetimes as "some specific lifetime" ra…
lqd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
identify when implemented for "some specific lifetime"
- Loading branch information
commit ec6405bccd8b1f0933a3604bdd86c43707350275
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,20 +1,11 @@ | ||
error: implementation of `Trait` is not general enough | ||
--> $DIR/issue-57362.rs:20:7 | ||
--> $DIR/issue-57362-1.rs:20:7 | ||
| | ||
LL | a.f(); //~ ERROR not general enough | ||
| ^ | ||
| | ||
= note: `Trait` would have to be implemented for the type `fn(&u8)` | ||
= note: `Trait` would have to be implemented for the type `fn(&'0 u8)`, for some specific lifetime `'0` | ||
= note: but `Trait` is actually implemented for the type `for<'r> fn(&'r u8)` | ||
|
||
error: implementation of `X` is not general enough | ||
--> $DIR/issue-57362.rs:38:13 | ||
| | ||
LL | let x = <fn (&())>::make_g(); //~ ERROR not general enough | ||
| ^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `X` would have to be implemented for the type `for<'r> fn(&'r ())` | ||
= note: but `X` is actually implemented for the type `fn(&'0 ())`, for the specific lifetime `'0` | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to previous error | ||
|
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error: implementation of `X` is not general enough | ||
--> $DIR/issue-57362-2.rs:22:13 | ||
| | ||
LL | let x = <fn (&())>::make_g(); //~ ERROR not general enough | ||
| ^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `X` would have to be implemented for the type `for<'r> fn(&'r ())` | ||
= note: but `X` is actually implemented for the type `fn(&'0 ())`, for the specific lifetime `'0` | ||
lqd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
error: aborting due to previous error | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.