diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-08-02 13:14:22 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-02 13:14:22 +0000 |
| commit | 314e2e75c09cc6115fc35fd94433b146eb3e325a (patch) | |
| tree | 68a6c4959fa1b5a6f5c7e4f62f260f9639369349 /docs/dev | |
| parent | 0d56ff2a02b5d490058f9ea2e6da8d9f44859c0b (diff) | |
| parent | d0b98060d44a3cf2900f5d4504389825a9e2856e (diff) | |
| download | rust-314e2e75c09cc6115fc35fd94433b146eb3e325a.tar.gz rust-314e2e75c09cc6115fc35fd94433b146eb3e325a.zip | |
Merge #9752
9752: feature: Declare proc-macro dependent crates in `rust-project.json` r=matklad a=tobywf
This adds the `is_proc_macro` flag in `rust-project.json`. By default, this is `false` and not required, so existing projects won't break/have the same behavior as before this change. If the flag is true, a dependency to the `proc_macro` sysroot crate is added (if it exists), so that rust-analyzer can resolve those imports.
This fixes #9726 .
I've also added some tests in the second commit. The first is a smoke test for a basic, minimal `rust-project.json` file. The second is a more targeted test for the flag. Both tests depend on the fake sysroot (a bunch of directories in the correct layout with empty `lib.rs` files), and also on `env!("CARGO_MANIFEST_DIR")` being an absolute path. I'm not sure if the later assumption is valid on all platforms. I wanted to at least try and add tests, but I'm happy to rework them or remove them if you don't think that's the way to go.
(You can license/relicense my contribution in any way you wish without contacting me.)
Co-authored-by: Toby Fleming <sourcecode@tobywf.com>
Diffstat (limited to 'docs/dev')
0 files changed, 0 insertions, 0 deletions
