-
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
rustc: update the unnecessary parens lint for struct literals. #15157
Closed
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
This isn't quite right (e.g. |
Most of the comments are available on the Task structure itself, but this commit is aimed at making FFI-style usage of Rust tasks a little nicer. Primarily, this commit enables re-use of tasks across multiple invocations. The method `run` will no longer unconditionally destroy the task itself. Rather, the task will be internally re-usable if the closure specified did not fail. Once a task has failed once it is considered poisoned and it can never be used again. Along the way I tried to document shortcomings of the current method of tearing down a task, opening a few issues as well. For now none of the behavior is a showstopper, but it's useful to acknowledge it. Also along the way I attempted to remove as much `unsafe` code as possible, opting for safer abstractions.
…brson Most of the comments are available on the Task structure itself, but this commit is aimed at making FFI-style usage of Rust tasks a little nicer. Primarily, this commit enables re-use of tasks across multiple invocations. The method `run` will no longer unconditionally destroy the task itself. Rather, the task will be internally re-usable if the closure specified did not fail. Once a task has failed once it is considered poisoned and it can never be used again. Along the way I tried to document shortcomings of the current method of tearing down a task, opening a few issues as well. For now none of the behavior is a showstopper, but it's useful to acknowledge it. Also along the way I attempted to remove as much `unsafe` code as possible, opting for safer abstractions.
We use re-exported pathes (e.g. std::io::Command) and original ones (e.g. std::io::process::Command) together in examples now. Using re-exported ones consistently avoids confusion. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
Since procs do not have lifetime bounds, we must do this to maintain safety. This can break code that incorrectly captured references in procedure types. Change such code to not do this, perhaps with a trait object instead. A better solution would be to add higher-rank lifetime support to procs. However, this would be a lot of work for a feature we want to remove in favor of unboxed closures. The corresponding "real fix" is rust-lang#15067. Closes rust-lang#14036. [breaking-change]
…hton Since procs do not have lifetime bounds, we must do this to maintain safety. This can break code that incorrectly captured references in procedure types. Change such code to not do this, perhaps with a trait object instead. Closes rust-lang#14036. [breaking-change] r? @alexcrichton
…crichton We use re-exported pathes (e.g. std::io::Command) and original ones (e.g. std::io::process::Command) together in examples now. Using re-exported ones consistently avoids confusion.
Built on top of rust-lang#15181. steveklabnik@e527192 is the only new commit, you may want to review that separately. I'm not sure if the car analogy is too glib.
Things like `match X { x: 1 } { ... }` now need to be written with parentheses, so the lint should avoid warning in cases like that.
Github picked up a pile of random commits, so this is now over at #15212. (The exact same commit, not sure what happened. shrug) |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 17, 2023
Fix runnable detection for `#[tokio::test]` fix rust-lang#15141 It is hacky, and it wouldn't work for e.g. this case: ```Rust use ::core::prelude; #[prelude::v1::test] fn foo() { } ``` But it works for the tokio case. We should use the name resolution here somehow, and after that we should probably also get rid of the ast based `test_related_attribute` function.
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.
rustc: update the unnecessary parens lint for struct literals.
Things like
match X { x: 1 } { ... }
now need to be written withparentheses, so the lint should avoid warning in cases like that.