-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Block expression results #305
Merged
Merged
Conversation
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
Since pprust is authed impure these can be used for debug logging.
…eaking that code path.
This allows blocks to be used in conditional constructs where the block may not ever execute: the drop glue will notice that it was never used and ignore it. Also, beef up the comments.
kazcw
pushed a commit
to kazcw/rust
that referenced
this pull request
Oct 23, 2018
Some intrinsics take `i64` or `u64` arguments which typically means that they're using 64-bit registers and aren't actually available on x86. This commit adds a check to stdsimd-verify to assert this and moves around some intrinsics that I believe should only be available on x86_64. This commit was checked in many places against gcc/clang/MSVC using godbolt.org to ensure that we're agreeing with what other compilers are doing. Closes rust-lang#304
antoyo
added a commit
to antoyo/rust
that referenced
this pull request
Oct 9, 2023
Add support for "pure" function attribute
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Oct 18, 2024
…nishearth Add lint for unnecessary lifetime bounded &str return Closes rust-lang#305. Currently implemented with a pretty strong limitation that it can only see the most basic implicit return, but this should be fixable by something with more time and brain energy than me. Cavets from rust-lang#13388 apply, as I have not had a review on my clippy lints yet so am pretty new to this. ``` changelog: [`unnecessary_literal_bound`]: Add lint for unnecessary lifetime bounded &str return. ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This patch series deals with retrieving the results of block expressions, particularly when those results are boxed. The strategy for pulling boxes out of block expressions is to allocate space to point to the box at the top of the function; when the block evaluates a boxed result it's copied to the alloca and upref'd; when the block's enclosing scope leaves the box is loaded from the alloca and downref'd.
At the end of this series standalone block expressions and if expressions can result in most types except for generic boxed types.
Note that the second commit adds two utility functions, block_to_str and expr_to_str, to pprust. These are unrelated to the rest of the series, but I used them for debugging and didn't feel it was worth putting that commit into a separate pull request.