Repository navigation
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitAsyncAwait-PolishAsync-await issues that are part of the "polish" areaAsync-await issues that are part of the "polish" areaE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Per @Centril's comment, we want to move async unsafe fn to its own feature gate:
I would also like to move
async unsafe fnout of the MVP into its own feature gate because I think a) it has seen little use, b) it is not particularly well tested, c) it ostensibly behaves weirdly because the.awaitpoint is not where you writeunsafe { ... }and this is understandable from "leaky implementation POV" but not so much from an effects POV, d) it has seen little discussion and was not included in the RFC nor this report, and e) we did this withconst fnand it worked fine. (I can write up the feature gating PR)
This issue has been assigned to @delan via this comment.
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitAsyncAwait-PolishAsync-await issues that are part of the "polish" areaAsync-await issues that are part of the "polish" areaE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Activity
Centril commentedon Jul 8, 2019
Mentoring instructions:
In
libsyntax/parse/mod.rsthere's astruct ParseSess. To it, you want to add:pub async_unsafe_spans: Lock<Vec<Span>>,and then modifyfn with_span_handleras well in the same file.In
libsyntax/feature_gate.rsyou want to add a newactivefeature gate to the bottom (see theasync_closureexample) and then modifycheck_crate(also seeasync_closure_spansexample).In
parse_fn_front_matterinsidelibsyntax/parse/parser.rsyou want to modifyfn parse_fn_front_mattersuch that whenasyncness.is_async()andunsafety == Unsafety::Unsafecoincide, you push theSpanof theunsafetoken toasync_unsafe_spans.In
parse_item_implementationinsidelibsyntax/parse/parser.rsyou want to modify theif self.check_keyword(kw::Async) {case analogously.You then want to add a feature gate test to
src/test/ui/async-await/feature-async-unsafe.rswhich also checks that the feature gate is required even under#[cfg(FALSE)]on a function. Make sure you test both free functions and functions in implementations.You will also need to edit various tests which will now fail due to feature gating. Make sure to also move out
async unsafe fntests into standalone test files.For an example of splitting a feature gate see #62292.
Centril commentedon Jul 8, 2019
The tracking issue to use is #62501.
delan commentedon Jul 9, 2019
@rustbot claim
Centril commentedon Jul 11, 2019
I was convinced not to feature gate this after all (see #62149 (comment)). Sorry about the noise!