-
Notifications
You must be signed in to change notification settings - Fork 13.3k
re-use Sized
fast-path
#139577
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
re-use Sized
fast-path
#139577
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 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
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
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
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
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ LL | fn server() -> impl { | |
| ^^^^ | ||
|
||
error[E0412]: cannot find type `F` in this scope | ||
--> $DIR/issue-78720.rs:13:12 | ||
--> $DIR/issue-78720.rs:14:12 | ||
| | ||
LL | _func: F, | ||
| ^ | ||
|
@@ -22,8 +22,14 @@ help: you might be missing a type parameter | |
LL | struct Map2<Segment2, F> { | ||
| +++ | ||
|
||
error[E0282]: type annotations needed | ||
--> $DIR/issue-78720.rs:1:16 | ||
| | ||
LL | fn server() -> impl { | ||
| ^^^^ cannot infer type | ||
Comment on lines
+28
to
+29
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. lmao is this the |
||
|
||
error[E0308]: mismatched types | ||
--> $DIR/issue-78720.rs:7:39 | ||
--> $DIR/issue-78720.rs:8:39 | ||
| | ||
LL | fn map2<F>(self, f: F) -> Map2<F> {} | ||
| ^^ expected `Map2<F>`, found `()` | ||
|
@@ -32,7 +38,7 @@ LL | fn map2<F>(self, f: F) -> Map2<F> {} | |
found unit type `()` | ||
|
||
error[E0277]: the size for values of type `Self` cannot be known at compilation time | ||
--> $DIR/issue-78720.rs:7:16 | ||
--> $DIR/issue-78720.rs:8:16 | ||
| | ||
LL | fn map2<F>(self, f: F) -> Map2<F> {} | ||
| ^^^^ doesn't have a size known at compile-time | ||
|
@@ -47,7 +53,7 @@ help: function arguments must have a statically known size, borrowed types alway | |
LL | fn map2<F>(&self, f: F) -> Map2<F> {} | ||
| + | ||
|
||
error: aborting due to 4 previous errors | ||
error: aborting due to 5 previous errors | ||
|
||
Some errors have detailed explanations: E0277, E0308, E0412. | ||
Some errors have detailed explanations: E0277, E0282, E0308, E0412. | ||
For more information about an error, try `rustc --explain E0277`. |
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
Oops, something went wrong.
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.
Maybe name it
is_sized_pred_for_trivially_sized_type
?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.
I didn't name it that because I add to it later in the Sized work with
MetaSized
and "we have aMetaSized
predicate that we can skip because there's aSized
predicate with the sameself_ty
in theParamEnv
" - I can rename it in this PR as you suggest, and then rename it back to something more general later if you want?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.
hmm... I guess. It's nonobvious enough that you need to read the function anyway unless you already know what it is, then the name is unique enough.