@matklad I wrote some code to convert RA asts to rustc asts as a pull request for rustc. It is essentially complete and can build real projects, provided they only use the Rust 2018 edition, since the RA parser currently doesn't support 2015. It can be used as a development tool to check that RA and rustc produce the same AST, and could theoretically replace the rustc parser (but that would need much better error reporting, ensuring that all invalid code is rejected and more misc work). Pull request at https://github.com/rust-lang/rust/pull/70745
Can rustc with rust-analyzer's parser build rust-analyzer?
(I am still speechless by the way)
IIRC it can't at least due to some dependencies using Rust 2015
I'd love to fix that (supporting subsets of 2015 shouldn't be too hard I hope)! Not because it would be useful, but because that would be super cool!
I've obviously haven't looked into the PRs yet (and probably won't be able to dig into them today), but, right of the bat, I have an organizational question
@Luca Barbieri how do you feel about driving the task of unifing rustc and rust-analyzer parsers? I guess, at the moment you know more about this than anyone else in the universe :)
actually I don't think I'll do any more significant work on rust-analyzer/rustc at the moment