Skip to content
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

Highlight box #14

Closed
Nokel81 opened this issue Feb 14, 2019 · 7 comments
Closed

Highlight box #14

Nokel81 opened this issue Feb 14, 2019 · 7 comments

Comments

@Nokel81
Copy link

Nokel81 commented Feb 14, 2019

Now that the box keyword has been reserved in Rust2018, and it is possible to use it behind a gate I think it would make sense to highlight it as a keyword

@maxbrunsfeld
Copy link
Contributor

Can you share a link to the docs for this? Upon first search, all I'm seeing is very old discussions about the box syntax that was eventually removed.

@Nokel81
Copy link
Author

Nokel81 commented Jun 10, 2019

Sure, here says that is is a reserved keyword (even in Rust2015 it seems). And here is the uses of box, which are currently unstable in nightly but do work.

@Nokel81
Copy link
Author

Nokel81 commented Jun 26, 2019

@GrayJack So if I read correctly, they are removing the let x = box 1; syntax but might be keeping the if let box Some(y) = Box::new(Some(10))?

@GrayJack
Copy link
Contributor

What I understood was that nothing is clear LOL

@GrayJack
Copy link
Contributor

On another dive into the comments on those features using the box keyword:

Looks like box as expression will probably never go to stable and probably remain as a unstable feature till some problems related to the Box can be fixed, a possible fix for those problems would be this RFC, but it wasn't accepted yet (21/10/2020). Once Box type problems fixed, this feature will probably be removed.

About the box pattern, it also looks like it will never face the light of a stable release (there some thoughts about removing it and adding a deref pattern that will work on any type that can de dereferenced).

Either way, I think it's ok for us to implement those in the parser, since those features are used inside the stdlib and when we open those std files in a editor using tree-sitter the syntax usually breaks. Implementing them would mean that we can get closer to be possible to highlight and parse any Rust code.

@amaanq
Copy link
Member

amaanq commented Feb 17, 2024

I think we're gonna close this out since it probably will never be stabilized, and might be removed in the future, seems like deref patterns will supersede box patterns

@amaanq amaanq closed this as not planned Won't fix, can't repro, duplicate, stale Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants