-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Impl Termination for Infallible and then make the Result impls of Termination more generic #97803
Merged
Merged
Changes from all commits
Commits
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
error[E0277]: `main` has invalid return type `Result<f32, ParseFloatError>` | ||
error[E0277]: `main` has invalid return type `f32` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This error now is a bit off 🤔 |
||
--> $DIR/termination-trait-test-wrong-type.rs:6:1 | ||
| | ||
LL | #[test] | ||
|
@@ -8,11 +8,8 @@ LL | | "0".parse() | |
LL | | } | ||
| |_^ `main` can only return types that implement `Termination` | ||
| | ||
= help: the trait `Termination` is not implemented for `Result<f32, ParseFloatError>` | ||
= help: the following other types implement trait `Termination`: | ||
Result<!, E> | ||
Result<(), E> | ||
Result<Infallible, E> | ||
= help: the trait `Termination` is not implemented for `f32` | ||
= note: required because of the requirements on the impl of `Termination` for `Result<f32, ParseFloatError>` | ||
note: required by a bound in `assert_test_result` | ||
--> $SRC_DIR/test/src/lib.rs:LL:COL | ||
| | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similarly this impl is technically new but is backfilling removed impls that were since 1.61.0 so..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo backdating them both seems correct since they're both representing existing impls from that release even if they both add new impls as well. We don't have a rule for this AFAIK.
I guess the most pertinent question is "who are these versions for and why?". The only time I end up using these is when I'm curious how long a certain API has been stable or when a decision was made. I also thought that people might be using these versions for MSRV checks but my experience is that I usually just actually test against the MSRV I am aiming for supporting, so I don't think we should consider the MSRV user experience in these attributes, which will likely be inaccurate either way and would be too time consuming to determine manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's for the
stable_features
diagnostic.which means it is pretty much meaningless for impls, since you don't get impls by enabling a feature.