-
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
Clean up std::task docs, make TaskBuilder a real builder #12232
Conversation
This is a fairly core module, so I'd like to discuss this a bit before merging. I'm in favor of the changes. Could you also delete |
@alexcrichton My understanding based on some of the documentation is that I couldn't make As for missing documentation, I wasn't sure what to write for the If you want to give me a description for |
Ok, I guess |
Pushed new documentation. Running |
FWIW, apropos of nothing in particular: something that's bothered me for a while is (with the appropriate imports) |
Dammit! Too easy to accidentally hit that button. Sigh. |
|
Taking another look at this, I fear that this builder pattern isn't quite as useful as it used to be. Neither I fear that this api still needs a fairly large overhaul because there's still lots of little gotchas here and there. I think that the builder approach is where we want to converge on, but I'm not 100% sure of that. I think we should go ahead with this PR, but I think we have aways to go for finishing |
Glad to see activity to clean up |
I agree with what @alexcrichton's comment, however, I think we should let this PR land. I like the changes in this PR. Just one nit, though. Although all tasks are |
I'm not actually entirely sure what |
watch and unwatched are ignored, neither libnative nor libgreen look at them |
@alexcrichton Should they be removed then? |
Yes. |
+1 for removing them if they're not actually being used anywhere. |
This closes #6399 |
Rebased and removed watched/unwatched. |
@@ -252,9 +199,6 @@ impl TaskBuilder { | |||
* If the function executed successfully then try returns result::ok | |||
* containing the value returned by the function. If the function fails | |||
* then try returns result::err containing nil. | |||
* | |||
* # Failure | |||
* Fails if a future_result was already set for this task. |
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 believe this is still true and shouldn't be deleted.
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.
r=me with this taken care of
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.
Oops.
Delete all the documentation from std::task that references linked failure. Tweak TaskBuilder to be more builder-like. .name() is now .named() and .add_wrapper() is now .with_wrapper(). Remove .watched() and .unwatched() as they didn't actually do anything.
…crichton Delete all the documentation from std::task that references linked failure. Tweak TaskBuilder to be more builder-like. `.name()` is now `.named()` and `.add_wrapper()` is now `.with_wrapper()`. Remove `.watched()` and `.unwatched()` as they didn't actually do anything. Closes #6399.
Suppress the `min_ident_chars` warning for items whose name we cannot control. Do not warn for `use a::b`, but warn for `use a::b as c`, since `c` is a local identifier. Fixes rust-lang#12232
Ignore imported items in `min_ident_chars` Suppress the `min_ident_chars` warning for items whose name we cannot control. Do not warn for `use a::b`, but warn for `use a::b as c`, since `c` is a local identifier. Fixes rust-lang#12232 --- *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: [`min_ident_chars`]: Do not warn on non-local identifiers
Delete all the documentation from std::task that references linked
failure.
Tweak TaskBuilder to be more builder-like.
.name()
is now.named()
and.add_wrapper()
is now.with_wrapper()
. Remove.watched()
and.unwatched()
as they didn't actually do anything.Closes #6399.