rust/crates
bors[bot] 6c0cdc5f55
Merge #8774
8774: feat: Honor `.cargo/config.toml` r=matklad a=Veykril

![f1Gup1aiAn](https://user-images.githubusercontent.com/3757771/117545448-1dcaae00-b026-11eb-977a-0f35a5e3f2e0.gif)

Implements `cargo/.config` build target and cfg access by using unstable cargo options:

- `cargo config get` to read the target triple out of the config to pass to `cargo metadata` --filter-platform
- `cargo rustc --print` to read out the `rustc_cfgs`, this causes us to honor `rustflags` and the like.

If those commands fail, due to not having a nightly toolchain present for example, they will fall back to invoking rustc directly as we currently do.

I personally think it should be fine to use these unstable options as they are unlikely to change(even if they did it shouldn't be a problem due to the fallback) and don't burden the user if they do not have a nightly toolchain at hand since we fall back to the previous behaviour.

cc #8741
Closes #6604, Closes #5904, Closes #8430, Closes #8480

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-09 10:33:31 +00:00
..
base_db Add one more profiling span to add_dep 2021-04-22 21:48:17 +03:00
cfg internal: expose cfg attrs from hir::Crate 2021-05-07 23:50:24 +03:00
flycheck Code review feedback. 2021-04-19 12:26:04 -07:00
hir Correctly support SelfType when searching for usages 2021-05-08 22:34:55 +02:00
hir_def Reuse database in LowerCtx 2021-05-06 23:23:50 +02:00
hir_expand Merge #8280 2021-05-06 22:19:52 +00:00
hir_ty Correctly support SelfType when searching for usages 2021-05-08 22:34:55 +02:00
ide Don't handle Self as a usage for TraitDefs 2021-05-08 23:35:18 +02:00
ide_assists Merge #8773 2021-05-08 22:09:03 +00:00
ide_completion Add = to pattern recovery 2021-05-08 23:14:08 +02:00
ide_db Don't handle Self as a usage for TraitDefs 2021-05-08 23:35:18 +02:00
ide_ssr
mbe Merge #8560 2021-04-18 02:14:27 +00:00
parser Add = to pattern recovery 2021-05-08 23:14:08 +02:00
paths
proc_macro_api Replace memmap to memmap2 in proc_macro_api 2021-05-03 20:20:47 -04:00
proc_macro_srv
proc_macro_test
profile Use package renaming so source doesn't say tikv 2021-05-07 12:41:07 -07:00
project_model Use RUSTC_BOOTSTRAP=1 instead of +nightly when discovering rust_cfgs throughs cargo 2021-05-09 00:07:04 +02:00
rust-analyzer internal: add rust-analyzer version to panic context 2021-05-08 14:14:06 +03:00
stdx internal: use API stabilized in 1.52 2021-05-06 20:12:15 +03:00
syntax minor: remove dead code 2021-05-08 23:28:36 +03:00
test_utils internal: use API stabilized in 1.52 2021-05-06 20:12:15 +03:00
text_edit
toolchain
tt
vfs
vfs-notify