-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-type_ascription`#![feature(type_ascription)]``#![feature(type_ascription)]`S-tracking-remove-implementationStatus: The feature needs to be removed from the Rust toolchain before this issue can be closedStatus: The feature needs to be removed from the Rust toolchain before this issue can be closedT-langRelevant to the language teamRelevant to the language team
Description
This supersedes #23416
This is a tracking issue for the RFC "3307" (rust-lang/rfcs#3307).
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
- Implement the RFC:
- Remove type ascription from the parser and diagnostics
- @rust-lang/compiler: Do y'all have a preference as to how far the removal should go? Unparseable AST nodes could be left in the code, for example (perhaps only instantiable by internal macro)
To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.Adjust documentation: Remove it from the unstable book(No stabilization PR necessary)Remove the feature gate.To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Unresolved Questions
- Should this be completely removed by the compiler, or left behind in a way that cannot be directly accessed through Rust syntax (or requires using a wrapper macro)?
- [ ]
To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Implementation history
BoxyUwU, Noratrieb, clubby789, kadiwa4 and seandewaradaszko, shelvacu, CodeByAidan and sirewix
Metadata
Metadata
Assignees
Labels
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-type_ascription`#![feature(type_ascription)]``#![feature(type_ascription)]`S-tracking-remove-implementationStatus: The feature needs to be removed from the Rust toolchain before this issue can be closedStatus: The feature needs to be removed from the Rust toolchain before this issue can be closedT-langRelevant to the language teamRelevant to the language team
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
SoniEx2 commentedon Sep 12, 2022
Remove type ascription
Noratrieb commentedon Nov 16, 2022
@rustbot claim
I'll remove all the parsing and diagnostic logic/hacks but leave the AST nodes and everything after it behind for now.
type_ascribe!
macro as placeholder syntax for type ascription #104614Rollup merge of rust-lang#104614 - Nilstrieb:type-ascribe!, r=TaKO8Ki
Rollup merge of rust-lang#105614 - lukas-code:ascription, r=Nilstrieb
RalfJung commentedon Jan 10, 2023
Would it make sense to possibly replace type ascription by an unstable macro in the standard library?
I noticed #104614 added a magic macro that preserves the old semantics, but maybe we can implement this entirely in userland?
bjorn3 commentedon Jan 10, 2023
That macro shortens the lifetime of temporaries created in the expression.
2 remaining items
Noratrieb commentedon Feb 13, 2023
This has taken a lot more time than I thought since lots of diagnostics were relying on it in subtle ways and require restructuring. I don't have enough time to work on this and also the other things I'm working on so I'm dropping my assignment here, feel free to take it. There's a WIP PR #106826 which may or may not be useful.
@estebank maybe you're interested in working on it, given all the pains you've had with type ascription :D
@rustbot release-assignment
Auto merge of rust-lang#109128 - chenyukang:yukang/remove-type-ascrip…
pat : type
(ascription) &p0 | ... | pn
(or_patterns) #67309Auto merge of rust-lang#109128 - chenyukang:yukang/remove-type-ascrip…
Auto merge of rust-lang#109128 - chenyukang:yukang/remove-type-ascrip…