-
Notifications
You must be signed in to change notification settings - Fork 26
Support if- and while-let chains #45
Support if- and while-let chains #45
Conversation
559a91b to
7479c18
Compare
|
r? @matklad Basically let chains require use to parse let expressions as the faeture will allow Quoting rust-lang/rust-analyzer#11320 (comment):
I believe this should work for us as well but I'd rather have your input on this grammar change. |
|
@Veykril Turns out we do have a validation pass: rust-lang/rust-analyzer@1eb9d36. |
|
Ok, so, contrary to the RFC, it seems like let's are now treated as expressions syntactically: #![feature(let_chains)]
macro_rules! assert_item {
($i:item) => ()
}
assert_item!(fn f() { let _ = (let 1 = 1); });Than, yeah, I agree we should just make As a follow up, I think it'll than make sense to get rid of |
|
bors r+ |
|
Build succeeded: |
rustc does not do that: |
|
Also: #![feature(let_chains)]
macro_rules! expr {
($e:expr) => ()
}
macro_rules! stmt {
($e:stmt) => ()
}
// expr!(let 1 = 1);
expr!((let 1 = 1));
stmt!(let 1 = 1);
stmt!((let 1 = 1));The |
RFC 2497 https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md.
I'm not sure if this should be a major or minor version bump: it breaks users of rust.ungram but not general users of the crate.